]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
xen: Limit execution to EL1 only
authorMichal Simek <michal.simek@amd.com>
Tue, 18 Apr 2023 12:51:56 +0000 (14:51 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 25 Apr 2023 19:31:28 +0000 (15:31 -0400)
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>
drivers/xen/hypervisor.c

index 16c7c96c94e0306e542ce2f903788b785a7885dc..0b2311ba26756385e008a76d982534846cab212d 100644 (file)
@@ -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();