[PATCH 17/17] board: xen: De-initialize before jumping to Linux

Simon Glass sjg at chromium.org
Fri Jul 3 05:50:33 CEST 2020


On Wed, 1 Jul 2020 at 10:30, Anastasiia Lukianenko <vicooodin at gmail.com> wrote:
>
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko at epam.com>
>
> Free resources used by Xen board before jumping to Linux kernel.
>
> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko at epam.com>
> Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko at epam.com>
> ---
>  board/xen/xenguest_arm64/xenguest_arm64.c | 6 ++++++
>  drivers/xen/hypervisor.c                  | 8 ++++++++
>  include/xen.h                             | 1 +
>  3 files changed, 15 insertions(+)

Reviewed-by: Simon Glass <sjg at chromium.org>



>
> diff --git a/board/xen/xenguest_arm64/xenguest_arm64.c b/board/xen/xenguest_arm64/xenguest_arm64.c
> index b4e1650f99..76a18bea8b 100644
> --- a/board/xen/xenguest_arm64/xenguest_arm64.c
> +++ b/board/xen/xenguest_arm64/xenguest_arm64.c
> @@ -13,6 +13,7 @@
>  #include <dm.h>
>  #include <errno.h>
>  #include <malloc.h>
> +#include <xen.h>
>
>  #include <asm/io.h>
>  #include <asm/armv8/mmu.h>
> @@ -195,3 +196,8 @@ int print_cpuinfo(void)
>         return 0;
>  }
>
> +void board_cleanup_before_linux(void)
> +{
> +       xen_fini();
> +}
> +
> diff --git a/drivers/xen/hypervisor.c b/drivers/xen/hypervisor.c
> index f3c2504d72..8d7d320839 100644
> --- a/drivers/xen/hypervisor.c
> +++ b/drivers/xen/hypervisor.c
> @@ -279,3 +279,11 @@ void xen_init(void)
>         init_gnttab();
>  }
>
> +void xen_fini(void)
> +{
> +       debug("%s\n", __func__);
> +
> +       fini_gnttab();
> +       fini_xenbus();
> +       fini_events();
> +}
> diff --git a/include/xen.h b/include/xen.h
> index 1d6f74cc92..327d7e132b 100644
> --- a/include/xen.h
> +++ b/include/xen.h
> @@ -7,5 +7,6 @@
>  #define __XEN_H__
>
>  void xen_init(void);
> +void xen_fini(void);

Comment? What does this do?


>
>  #endif /* __XEN_H__ */
> --
> 2.17.1
>

- SImon


More information about the U-Boot mailing list