[PATCH v5 02/13] xen/arm: Introduce CONFIG_MMU Kconfig option

Henry Wang posted 13 patches 2 years, 5 months ago
There is a newer version of this series
[PATCH v5 02/13] xen/arm: Introduce CONFIG_MMU Kconfig option
Posted by Henry Wang 2 years, 5 months ago
There are two types of memory system architectures available for
Arm-based systems, namely the Virtual Memory System Architecture (VMSA)
and the Protected Memory System Architecture (PMSA). According to
ARM DDI 0487G.a, A VMSA provides a Memory Management Unit (MMU) that
controls address translation, access permissions, and memory attribute
determination and checking, for memory accesses made by the PE. And
refer to ARM DDI 0600A.c, the PMSA supports a unified memory protection
scheme where an Memory Protection Unit (MPU) manages instruction and
data access. Currently, Xen only suuports VMSA.

Introduce a Kconfig option CONFIG_MMU, which is currently default
set to y and unselectable because currently only VMSA is supported.

Suggested-by: Julien Grall <jgrall@amazon.com>
Signed-off-by: Henry Wang <Henry.Wang@arm.com>
---
v5:
- Only introduce the unselectable CONFIG_MMU, add the 'choice' in
  future commits.
v4:
- Completely rework "[v3,06/52] xen/arm: introduce CONFIG_HAS_MMU"
---
 xen/arch/arm/Kconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 57bd1d01d7..eb0413336b 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -59,6 +59,9 @@ config PADDR_BITS
 	default 40 if ARM_PA_BITS_40
 	default 48 if ARM_64
 
+config MMU
+	def_bool y
+
 source "arch/Kconfig"
 
 config ACPI
-- 
2.25.1
Re: [PATCH v5 02/13] xen/arm: Introduce CONFIG_MMU Kconfig option
Posted by Julien Grall 2 years, 5 months ago
Hi Henry,

On 14/08/2023 05:25, Henry Wang wrote:
> There are two types of memory system architectures available for
> Arm-based systems, namely the Virtual Memory System Architecture (VMSA)
> and the Protected Memory System Architecture (PMSA). According to
> ARM DDI 0487G.a, A VMSA provides a Memory Management Unit (MMU) that
> controls address translation, access permissions, and memory attribute
> determination and checking, for memory accesses made by the PE. And
> refer to ARM DDI 0600A.c, the PMSA supports a unified memory protection
> scheme where an Memory Protection Unit (MPU) manages instruction and
> data access. Currently, Xen only suuports VMSA.

Typo: s/suuports/supports/

> 
> Introduce a Kconfig option CONFIG_MMU, which is currently default
> set to y and unselectable because currently only VMSA is supported.

NIT: It would be worth to explicit mention that this will be used in 
follow-up patches. So one will wonder what's the goal of introducing an 
unused config.

Or it could have been merged in the first patch splitting the MMU code 
so we don't introduce a config without any use.

> 
> Suggested-by: Julien Grall <jgrall@amazon.com>
> Signed-off-by: Henry Wang <Henry.Wang@arm.com>

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall
Re: [PATCH v5 02/13] xen/arm: Introduce CONFIG_MMU Kconfig option
Posted by Henry Wang 2 years, 5 months ago
Hi Julien,

> On Aug 21, 2023, at 16:43, Julien Grall <julien@xen.org> wrote:
> 
> Hi Henry,
> 
> On 14/08/2023 05:25, Henry Wang wrote:
>> There are two types of memory system architectures available for
>> Arm-based systems, namely the Virtual Memory System Architecture (VMSA)
>> and the Protected Memory System Architecture (PMSA). According to
>> ARM DDI 0487G.a, A VMSA provides a Memory Management Unit (MMU) that
>> controls address translation, access permissions, and memory attribute
>> determination and checking, for memory accesses made by the PE. And
>> refer to ARM DDI 0600A.c, the PMSA supports a unified memory protection
>> scheme where an Memory Protection Unit (MPU) manages instruction and
>> data access. Currently, Xen only suuports VMSA.
> 
> Typo: s/suuports/supports/

Oops, sorry about this, will fix in v6.

> 
>> Introduce a Kconfig option CONFIG_MMU, which is currently default
>> set to y and unselectable because currently only VMSA is supported.
> 
> NIT: It would be worth to explicit mention that this will be used in follow-up patches. So one will wonder what's the goal of introducing an unused config.
> 
> Or it could have been merged in the first patch splitting the MMU code so we don't introduce a config without any use.

Sure, I will think about this and fix in v6.

> 
>> Suggested-by: Julien Grall <jgrall@amazon.com>
>> Signed-off-by: Henry Wang <Henry.Wang@arm.com>
> 
> Acked-by: Julien Grall <jgrall@amazon.com>

Thanks!

Kind regards,
Henry

> 
> Cheers,
> 
> -- 
> Julien Grall