[PATCH] xen/mpu: make Xen boot to idle on MPU systems(DNM)

Penny Zheng posted 1 patch 1 year, 3 months ago
Failed in applying to current master (apply log)
xen/arch/arm/mm_mpu.c |  3 +++
xen/arch/arm/setup.c  | 21 ++++++++++++---------
xen/arch/arm/traps.c  |  2 ++
3 files changed, 17 insertions(+), 9 deletions(-)
[PATCH] xen/mpu: make Xen boot to idle on MPU systems(DNM)
Posted by Penny Zheng 1 year, 3 months ago
From: Wei Chen <wei.chen@arm.com>

As we have not implmented guest support in part#1 series of MPU
support, Xen can not create any guest in boot time. So in this
patch we make Xen boot to idle on MPU system for reviewer to
test part#1 series.

THIS PATCH IS ONLY FOR TESTING, NOT FOR REVIEWING.

Signed-off-by: Wei Chen <wei.chen@arm.com>
---
 xen/arch/arm/mm_mpu.c |  3 +++
 xen/arch/arm/setup.c  | 21 ++++++++++++---------
 xen/arch/arm/traps.c  |  2 ++
 3 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/mm_mpu.c b/xen/arch/arm/mm_mpu.c
index 434ed872c1..73d5779ab4 100644
--- a/xen/arch/arm/mm_mpu.c
+++ b/xen/arch/arm/mm_mpu.c
@@ -32,6 +32,9 @@
 #include <asm/page.h>
 #include <asm/setup.h>
 
+/* Non-boot CPUs use this to find the correct pagetables. */
+uint64_t init_ttbr;
+
 #ifdef NDEBUG
 static inline void
 __attribute__ ((__format__ (__printf__, 1, 2)))
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index b21fc4b8e2..d04ad8f838 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -803,16 +803,19 @@ void __init start_xen(unsigned long boot_phys_offset,
 #endif
     enable_cpu_features();
 
-    /* Create initial domain 0. */
-    if ( !is_dom0less_mode() )
-        create_dom0();
-    else
-        printk(XENLOG_INFO "Xen dom0less mode detected\n");
-
-    if ( acpi_disabled )
+    if ( !IS_ENABLED(CONFIG_ARM_V8R) )
     {
-        create_domUs();
-        alloc_static_evtchn();
+        /* Create initial domain 0. */
+        if ( !is_dom0less_mode() )
+            create_dom0();
+        else
+            printk(XENLOG_INFO "Xen dom0less mode detected\n");
+
+        if ( acpi_disabled )
+        {
+            create_domUs();
+            alloc_static_evtchn();
+        }
     }
 
     /*
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 061c92acbd..2444f7f6d8 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -963,7 +963,9 @@ void vcpu_show_registers(const struct vcpu *v)
     ctxt.ifsr32_el2 = v->arch.ifsr;
 #endif
 
+#ifndef CONFIG_HAS_MPU
     ctxt.vttbr_el2 = v->domain->arch.p2m.vttbr;
+#endif
 
     _show_registers(&v->arch.cpu_info->guest_cpu_user_regs, &ctxt, 1, v);
 }
-- 
2.25.1