]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: xen: De-initialize before jumping to Linux
authorOleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Thu, 6 Aug 2020 09:43:00 +0000 (12:43 +0300)
committerTom Rini <trini@konsulko.com>
Fri, 14 Aug 2020 19:18:30 +0000 (15:18 -0400)
Free resources used by Xen board before jumping to Linux kernel.

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
board/xen/xenguest_arm64/xenguest_arm64.c
drivers/xen/hypervisor.c
include/xen.h

index cd3693892a0d7ecdc6413d46e984cc5334d88ec0..cce54369bb30e9b9a7f75a6a23f7cadaebbf5bcf 100644 (file)
@@ -12,6 +12,7 @@
 #include <dm.h>
 #include <errno.h>
 #include <malloc.h>
+#include <xen.h>
 
 #include <asm/io.h>
 #include <asm/armv8/mmu.h>
@@ -194,3 +195,8 @@ int print_cpuinfo(void)
        return 0;
 }
 
+void board_cleanup_before_linux(void)
+{
+       xen_fini();
+}
+
index 58b0865e6a8bfce7e2829a90c8b824f1d4d8fe21..178c206f5bf40a4420f212216e05ebec770de170 100644 (file)
@@ -242,3 +242,11 @@ void xen_init(void)
        init_gnttab();
 }
 
+void xen_fini(void)
+{
+       debug("%s\n", __func__);
+
+       fini_gnttab();
+       fini_xenbus();
+       fini_events();
+}
index 686b7148b5d1a333e1d76ce3e4a7f22ee06e239f..a952a2c84b8b586ecb35c468e842f58bc6c62619 100644 (file)
  */
 void xen_init(void);
 
+/**
+ * xen_fini() - Board cleanup before Linux kernel start
+ *
+ * Unmap Xen memory pages the specified guest's pseudophysical
+ * address space and unbind all event channels.
+ */
+void xen_fini(void);
+
 #endif /* __XEN_H__ */