diff mbox series

[v2,4/4] xen/arm: mpu: Implement a dummy enable_secondary_cpu_mm

Message ID 20240918175102.223076-5-ayan.kumar.halder@amd.com (mailing list archive)
State New
Headers show
Series Enable early bootup of AArch64 MPU systems | expand

Commit Message

Ayan Kumar Halder Sept. 18, 2024, 5:51 p.m. UTC
Secondary cpus initialization is not yet supported. Thus, we print an
appropriate message and put the secondary cpus in WFE state.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
Changes from :-

v1 - 1. NR_CPUS is defined as 1 for MPU

2. Added a message in enable_secondary_cpu_mm()

 xen/arch/Kconfig              |  1 +
 xen/arch/arm/arm64/mpu/head.S | 10 ++++++++++
 2 files changed, 11 insertions(+)

Comments

Julien Grall Sept. 19, 2024, 1:20 p.m. UTC | #1
Hi,

On 18/09/2024 19:51, Ayan Kumar Halder wrote:
> Secondary cpus initialization is not yet supported. Thus, we print an
> appropriate message and put the secondary cpus in WFE state.
> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> ---
> Changes from :-
> 
> v1 - 1. NR_CPUS is defined as 1 for MPU
> 
> 2. Added a message in enable_secondary_cpu_mm()
> 
>   xen/arch/Kconfig              |  1 +
>   xen/arch/arm/arm64/mpu/head.S | 10 ++++++++++
>   2 files changed, 11 insertions(+)
> 
> diff --git a/xen/arch/Kconfig b/xen/arch/Kconfig
> index 308ce129a8..8640b7ec8b 100644
> --- a/xen/arch/Kconfig
> +++ b/xen/arch/Kconfig
> @@ -11,6 +11,7 @@ config NR_CPUS
>   	default "8" if ARM && RCAR3
>   	default "4" if ARM && QEMU
>   	default "4" if ARM && MPSOC
> +	default "1" if ARM && MPU
>   	default "128" if ARM
>   	help
>   	  Controls the build-time size of various arrays and bitmaps
> diff --git a/xen/arch/arm/arm64/mpu/head.S b/xen/arch/arm/arm64/mpu/head.S
> index ef55c8765c..3dfbbf8879 100644
> --- a/xen/arch/arm/arm64/mpu/head.S
> +++ b/xen/arch/arm/arm64/mpu/head.S
> @@ -168,6 +168,16 @@ FUNC(enable_boot_cpu_mm)
>       b   1b
>   END(enable_boot_cpu_mm)
>   
> +/*
> + * Secondary cpu has not yet been supported on MPU systems. We will block the
> + * secondary cpu bringup at this stage.

Given that NR_CPUS is 1, this should not be reachable. How about the 
following comment:

"We don't yet support secondary CPUs bring-up. Implement a dummy helper 
to please the common code."

> + */
> +ENTRY(enable_secondary_cpu_mm)
> +1:  PRINT("- SMP not enabled yet -\r\n")

You want the print to be outside of the loop. Otherwise, it will spam 
the console in the unlikely case the code is reached.

> +    wfe
> +    b 1b
> +ENDPROC(enable_secondary_cpu_mm)
> +
>   /*
>    * Local variables:
>    * mode: ASM

Cheers,
diff mbox series

Patch

diff --git a/xen/arch/Kconfig b/xen/arch/Kconfig
index 308ce129a8..8640b7ec8b 100644
--- a/xen/arch/Kconfig
+++ b/xen/arch/Kconfig
@@ -11,6 +11,7 @@  config NR_CPUS
 	default "8" if ARM && RCAR3
 	default "4" if ARM && QEMU
 	default "4" if ARM && MPSOC
+	default "1" if ARM && MPU
 	default "128" if ARM
 	help
 	  Controls the build-time size of various arrays and bitmaps
diff --git a/xen/arch/arm/arm64/mpu/head.S b/xen/arch/arm/arm64/mpu/head.S
index ef55c8765c..3dfbbf8879 100644
--- a/xen/arch/arm/arm64/mpu/head.S
+++ b/xen/arch/arm/arm64/mpu/head.S
@@ -168,6 +168,16 @@  FUNC(enable_boot_cpu_mm)
     b   1b
 END(enable_boot_cpu_mm)
 
+/*
+ * Secondary cpu has not yet been supported on MPU systems. We will block the
+ * secondary cpu bringup at this stage.
+ */
+ENTRY(enable_secondary_cpu_mm)
+1:  PRINT("- SMP not enabled yet -\r\n")
+    wfe
+    b 1b
+ENDPROC(enable_secondary_cpu_mm)
+
 /*
  * Local variables:
  * mode: ASM