[PATCH v2 1/2] xen: Add dependency on armv8

U-Boot currently implements hypervisor calls only for ARM64 that's why add dependency on ARM64. The hardware functionality is also available on ARMv7a, but currently not supported by U-Boot, hence it is not added to the list of dependencies here.
Signed-off-by: Michal Simek michal.simek@amd.com ---
Changes in v2: - Update commit message based on discussion with Marek
Depends on https://lore.kernel.org/r/1bc97e93ae35da1dba0643845e09b03c1e666cf5.168076824...
--- Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/Kconfig b/Kconfig index b4de17afac7a..888b9984ac3b 100644 --- a/Kconfig +++ b/Kconfig @@ -175,6 +175,7 @@ config CC_HAS_ASM_INLINE
config XEN bool "Select U-Boot be run as a bootloader for XEN Virtual Machine" + depends on ARM64 select SSCANF help Enabling this option will make U-Boot be run as a bootloader

Xen core_init() is calling HVC which should be called from EL1 level that's why do Xen initialization only when U-Boot runs in EL1.
Signed-off-by: Michal Simek michal.simek@amd.com ---
(no changes since v1)
drivers/xen/hypervisor.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/drivers/xen/hypervisor.c b/drivers/xen/hypervisor.c index 16c7c96c94e0..0b2311ba2675 100644 --- a/drivers/xen/hypervisor.c +++ b/drivers/xen/hypervisor.c @@ -264,8 +264,15 @@ void clear_evtchn(uint32_t port)
int xen_init(void) { + int el = current_el(); + debug("%s\n", __func__);
+ if (el != 1) { + puts("XEN:\tnot running from EL1\n"); + return 0; + } + map_shared_info(NULL); init_events(); init_xenbus();

On Tue, Apr 18, 2023 at 02:51:56PM +0200, Michal Simek wrote:
Xen core_init() is calling HVC which should be called from EL1 level that's why do Xen initialization only when U-Boot runs in EL1.
Signed-off-by: Michal Simek michal.simek@amd.com
Applied to u-boot/master, thanks!

On Tue, Apr 18, 2023 at 02:51:55PM +0200, Michal Simek wrote:
U-Boot currently implements hypervisor calls only for ARM64 that's why add dependency on ARM64. The hardware functionality is also available on ARMv7a, but currently not supported by U-Boot, hence it is not added to the list of dependencies here.
Signed-off-by: Michal Simek michal.simek@amd.com
Applied to u-boot/master, thanks!
participants (2)
-
Michal Simek
-
Tom Rini