[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] xen/arm: mpu: Implement a dummy enable_secondary_cpu_mm



commit ee7edb0d29cc17ab69524a7991e86b0c411426df
Author:     Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
AuthorDate: Mon Nov 18 12:12:50 2024 +0000
Commit:     Julien Grall <jgrall@xxxxxxxxxx>
CommitDate: Mon Dec 2 18:28:54 2024 +0000

    xen/arm: mpu: Implement a dummy enable_secondary_cpu_mm
    
    Secondary cpus initialization is not yet supported. Thus, we print an
    appropriate message and put the secondary cpus in WFE state.
    And we introduce to BUILD_BUG_ON to prevent users using from building Xen
    on multiprocessor based MPU systems.
    
    In Arm, there is no clean way to disable SMP. As of now, we wish to support
    MPU on UNP only. So, we have defined the default range of NR_CPUs to be 1 
for
    MPU.
    
    Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
    Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>
    Acked-by: Julien Grall <jgrall@xxxxxxxxxx>
---
 xen/arch/Kconfig              |  2 ++
 xen/arch/arm/arm64/mpu/head.S | 10 ++++++++++
 xen/arch/arm/smp.c            | 11 +++++++++++
 3 files changed, 23 insertions(+)

diff --git a/xen/arch/Kconfig b/xen/arch/Kconfig
index 308ce129a8..9f4835e37f 100644
--- a/xen/arch/Kconfig
+++ b/xen/arch/Kconfig
@@ -6,8 +6,10 @@ config PHYS_ADDR_T_32
 
 config NR_CPUS
        int "Maximum number of CPUs"
+       range 1 1 if ARM && MPU
        range 1 16383
        default "256" if X86
+       default "1" if ARM && MPU
        default "8" if ARM && RCAR3
        default "4" if ARM && QEMU
        default "4" if ARM && MPSOC
diff --git a/xen/arch/arm/arm64/mpu/head.S b/xen/arch/arm/arm64/mpu/head.S
index bacf8315f9..d3db5e53af 100644
--- a/xen/arch/arm/arm64/mpu/head.S
+++ b/xen/arch/arm/arm64/mpu/head.S
@@ -144,6 +144,16 @@ FUNC(enable_boot_cpu_mm)
     ret
 END(enable_boot_cpu_mm)
 
+/*
+ * We don't yet support secondary CPUs bring-up. Implement a dummy helper to
+ * please the common code.
+ */
+ENTRY(enable_secondary_cpu_mm)
+    PRINT("- SMP not enabled yet -\r\n")
+1:  wfe
+    b 1b
+ENDPROC(enable_secondary_cpu_mm)
+
 /*
  * Local variables:
  * mode: ASM
diff --git a/xen/arch/arm/smp.c b/xen/arch/arm/smp.c
index c11bba93ad..b372472188 100644
--- a/xen/arch/arm/smp.c
+++ b/xen/arch/arm/smp.c
@@ -1,4 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
+#include <xen/init.h>
 #include <xen/mm.h>
 #include <asm/system.h>
 #include <asm/smp.h>
@@ -6,6 +7,16 @@
 #include <asm/gic.h>
 #include <asm/flushtlb.h>
 
+static void __init __maybe_unused build_assertions(void)
+{
+#ifdef CONFIG_MPU
+    /*
+     * Currently, SMP is not enabled on MPU based systems.
+     */
+    BUILD_BUG_ON(NR_CPUS > 1);
+#endif
+}
+
 void arch_flush_tlb_mask(const cpumask_t *mask)
 {
     /* No need to IPI other processors on ARM, the processor takes care of it. 
*/
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.