From: Anastasiia Lukianenko <vicooodin@gmail.com>
To: u-boot@lists.denx.de
Subject: [RESEND PATCH v2 17/18] board: xen: De-initialize before jumping to Linux
Date: Thu, 6 Aug 2020 12:43:00 +0300 [thread overview]
Message-ID: <20200806094301.4999-18-vicooodin@gmail.com> (raw)
In-Reply-To: <20200806094301.4999-1-vicooodin@gmail.com>
From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
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>
---
Changes since v1:
- add comment
board/xen/xenguest_arm64/xenguest_arm64.c | 6 ++++++
drivers/xen/hypervisor.c | 8 ++++++++
include/xen.h | 8 ++++++++
3 files changed, 22 insertions(+)
diff --git a/board/xen/xenguest_arm64/xenguest_arm64.c b/board/xen/xenguest_arm64/xenguest_arm64.c
index 9861edac33..927d87ae37 100644
--- a/board/xen/xenguest_arm64/xenguest_arm64.c
+++ b/board/xen/xenguest_arm64/xenguest_arm64.c
@@ -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();
+}
+
diff --git a/drivers/xen/hypervisor.c b/drivers/xen/hypervisor.c
index 58b0865e6a..178c206f5b 100644
--- a/drivers/xen/hypervisor.c
+++ b/drivers/xen/hypervisor.c
@@ -242,3 +242,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 686b7148b5..a952a2c84b 100644
--- a/include/xen.h
+++ b/include/xen.h
@@ -13,4 +13,12 @@
*/
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__ */
--
2.17.1
next prev parent reply other threads:[~2020-08-06 9:43 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-06 9:42 [RESEND PATCH v2 00/18] Add new board: Xen guest for ARM64 Anastasiia Lukianenko
2020-08-06 9:42 ` [RESEND PATCH v2 01/18] Add MIT License Anastasiia Lukianenko
2020-08-14 19:49 ` Tom Rini
2020-08-06 9:42 ` [RESEND PATCH v2 02/18] Kconfig: Introduce CONFIG_XEN Anastasiia Lukianenko
2020-08-14 19:50 ` Tom Rini
2020-08-06 9:42 ` [RESEND PATCH v2 03/18] xen: Add essential and required interface headers Anastasiia Lukianenko
2020-08-14 19:50 ` Tom Rini
2020-08-06 9:42 ` [RESEND PATCH v2 04/18] board: Introduce xenguest_arm64 board Anastasiia Lukianenko
2020-08-14 19:50 ` Tom Rini
2020-08-06 9:42 ` [RESEND PATCH v2 05/18] xen: Port Xen hypervisor related code from mini-os Anastasiia Lukianenko
2020-08-14 19:50 ` Tom Rini
2020-08-06 9:42 ` [RESEND PATCH v2 06/18] xen: Port Xen event channel driver " Anastasiia Lukianenko
2020-08-14 19:50 ` Tom Rini
2020-08-06 9:42 ` [RESEND PATCH v2 07/18] serial: serial_xen: Add Xen PV serial driver Anastasiia Lukianenko
2020-08-14 19:50 ` Tom Rini
2020-08-06 9:42 ` [RESEND PATCH v2 08/18] linux/compat.h: Add wait_event_timeout macro Anastasiia Lukianenko
2020-08-14 19:50 ` Tom Rini
2020-08-06 9:42 ` [RESEND PATCH v2 09/18] lib: sscanf: add sscanf implementation Anastasiia Lukianenko
2020-08-14 19:50 ` Tom Rini
2020-08-16 8:23 ` Andy Shevchenko
[not found] ` <999cf014-ac1b-51b6-0522-f75e5ac3a3ed@epam.com>
2020-08-17 12:12 ` Artem Mygaiev
2020-08-17 14:19 ` Tom Rini
2020-08-06 9:42 ` [RESEND PATCH v2 10/18] xen: Port Xen bus driver from mini-os Anastasiia Lukianenko
2020-08-14 19:50 ` Tom Rini
2020-08-06 9:42 ` [RESEND PATCH v2 11/18] xen: Port Xen grant table " Anastasiia Lukianenko
2020-08-14 19:50 ` Tom Rini
2020-08-06 9:42 ` [RESEND PATCH v2 12/18] xen: pvblock: Add initial support for para-virtualized block driver Anastasiia Lukianenko
2020-08-14 19:50 ` Tom Rini
2020-08-06 9:42 ` [RESEND PATCH v2 13/18] xen: pvblock: Enumerate virtual block devices Anastasiia Lukianenko
2020-08-14 19:51 ` Tom Rini
2020-08-06 9:42 ` [RESEND PATCH v2 14/18] xen: pvblock: Read XenStore configuration and initialize Anastasiia Lukianenko
2020-08-14 19:51 ` Tom Rini
2020-08-06 9:42 ` [RESEND PATCH v2 15/18] xen: pvblock: Implement front-back protocol and do IO Anastasiia Lukianenko
2020-08-14 19:51 ` Tom Rini
2020-08-06 9:42 ` [RESEND PATCH v2 16/18] xen: pvblock: Print found devices indices Anastasiia Lukianenko
2020-08-14 19:51 ` Tom Rini
2020-08-06 9:43 ` Anastasiia Lukianenko [this message]
2020-08-14 19:51 ` [RESEND PATCH v2 17/18] board: xen: De-initialize before jumping to Linux Tom Rini
2020-08-06 9:43 ` [RESEND PATCH v2 18/18] doc: xen: Add Xen guest ARM64 board documentation Anastasiia Lukianenko
2020-08-14 19:51 ` Tom Rini
2020-08-13 7:57 ` [RESEND PATCH v2 00/18] Add new board: Xen guest for ARM64 Oleksandr Andrushchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200806094301.4999-18-vicooodin@gmail.com \
--to=vicooodin@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox