[PATCH v3 06/52] xen/arm: introduce CONFIG_HAS_MMU

Penny Zheng posted 52 patches 2 years, 3 months ago
There is a newer version of this series
[PATCH v3 06/52] xen/arm: introduce CONFIG_HAS_MMU
Posted by Penny Zheng 2 years, 3 months ago
This commit wants to introduce a new Kconfig CONFIG_HAS_MMU to guard
MMU-related codes, to tell two different memory management architecture:
VMAS and PMSA.

In a VMSA system, a Memory Management Unit (MMU) provides fine-grained
control of a memory system through a set of virtual to physical address
mappings and associated memory properties held in memory-mapped tables
known as translation tables.

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Signed-off-by: Wei Chen <wei.chen@arm.com>
---
v3:
- new patch
---
 xen/arch/arm/Kconfig | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index ff17345cdb..fb77392b82 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -60,6 +60,14 @@ config PADDR_BITS
 
 source "arch/Kconfig"
 
+config HAS_MMU
+	bool "Memory Management Unit support in a VMSA system"
+	default y
+	help
+	  In a VMSA system, a Memory Management Unit (MMU) provides fine-grained control of
+	  a memory system through a set of virtual to physical address mappings and associated memory
+	  properties held in memory-mapped tables known as translation tables.
+
 config ACPI
 	bool "ACPI (Advanced Configuration and Power Interface) Support (UNSUPPORTED)" if UNSUPPORTED
 	depends on ARM_64
-- 
2.25.1
Re: [PATCH v3 06/52] xen/arm: introduce CONFIG_HAS_MMU
Posted by Ayan Kumar Halder 2 years, 3 months ago
Hi Penny,

On 26/06/2023 04:33, Penny Zheng wrote:
> CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
>
>
> This commit wants to introduce a new Kconfig CONFIG_HAS_MMU to guard
> MMU-related codes, to tell two different memory management architecture:
> VMAS and PMSA.
>
> In a VMSA system, a Memory Management Unit (MMU) provides fine-grained
> control of a memory system through a set of virtual to physical address
> mappings and associated memory properties held in memory-mapped tables
> known as translation tables.
>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> ---
> v3:
> - new patch
> ---
>   xen/arch/arm/Kconfig | 8 ++++++++
>   1 file changed, 8 insertions(+)
>
> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> index ff17345cdb..fb77392b82 100644
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -60,6 +60,14 @@ config PADDR_BITS
>
>   source "arch/Kconfig"
>
> +config HAS_MMU
> +       bool "Memory Management Unit support in a VMSA system"
> +       default y
> +       help
> +         In a VMSA system, a Memory Management Unit (MMU) provides fine-grained control of
> +         a memory system through a set of virtual to physical address mappings and associated memory
> +         properties held in memory-mapped tables known as translation tables.
> +
>   config ACPI
>          bool "ACPI (Advanced Configuration and Power Interface) Support (UNSUPPORTED)" if UNSUPPORTED
>          depends on ARM_64

I don't think you need this option.

In patch 52 ("xen/arm: add Kconfig option CONFIG_HAS_MPU to enable MPU 
system support"), you have introduced "HAS_MPU" option.

May be you can introduce "HAS_MPU" option a bit earlier, so that 
"!HAS_MPU" is "HAS_MMU". So, you will not need this new option.

Let me know if this makes sense.

- Ayan

> --
> 2.25.1
>
>
Re: [PATCH v3 06/52] xen/arm: introduce CONFIG_HAS_MMU
Posted by Julien Grall 2 years, 3 months ago
Hi,

On 04/07/2023 12:14, Ayan Kumar Halder wrote:
> On 26/06/2023 04:33, Penny Zheng wrote:
>> CAUTION: This message has originated from an External Source. Please 
>> use proper judgment and caution when opening attachments, clicking 
>> links, or responding to this email.
>>
>>
>> This commit wants to introduce a new Kconfig CONFIG_HAS_MMU to guard
>> MMU-related codes, to tell two different memory management architecture:
>> VMAS and PMSA.
>>
>> In a VMSA system, a Memory Management Unit (MMU) provides fine-grained
>> control of a memory system through a set of virtual to physical address
>> mappings and associated memory properties held in memory-mapped tables
>> known as translation tables.
>>
>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> ---
>> v3:
>> - new patch
>> ---
>>   xen/arch/arm/Kconfig | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>> index ff17345cdb..fb77392b82 100644
>> --- a/xen/arch/arm/Kconfig
>> +++ b/xen/arch/arm/Kconfig
>> @@ -60,6 +60,14 @@ config PADDR_BITS
>>
>>   source "arch/Kconfig"
>>
>> +config HAS_MMU
>> +       bool "Memory Management Unit support in a VMSA system"
>> +       default y

I don't think you can disable HAS_MMU right now. So you want to drop the 
description to prevent a user to select it. This could then be combined to

"def_bool y".

>> +       help
>> +         In a VMSA system, a Memory Management Unit (MMU) provides 
>> fine-grained control of
>> +         a memory system through a set of virtual to physical address 
>> mappings and associated memory
>> +         properties held in memory-mapped tables known as translation 
>> tables.
>> +
>>   config ACPI
>>          bool "ACPI (Advanced Configuration and Power Interface) 
>> Support (UNSUPPORTED)" if UNSUPPORTED
>>          depends on ARM_64
> 
> I don't think you need this option.

I think we want to introduce a 'choice' where the user can select either 
the MPU or MMU. But not both.

This would be similar to how we select the Physical address space size.

Cheers,

-- 
Julien Grall

Re: [PATCH v3 06/52] xen/arm: introduce CONFIG_HAS_MMU
Posted by Ayan Kumar Halder 2 years, 3 months ago
On 04/07/2023 12:44, Julien Grall wrote:
> Hi,
>
> On 04/07/2023 12:14, Ayan Kumar Halder wrote:
>> On 26/06/2023 04:33, Penny Zheng wrote:
>>> CAUTION: This message has originated from an External Source. Please 
>>> use proper judgment and caution when opening attachments, clicking 
>>> links, or responding to this email.
>>>
>>>
>>> This commit wants to introduce a new Kconfig CONFIG_HAS_MMU to guard
>>> MMU-related codes, to tell two different memory management 
>>> architecture:
>>> VMAS and PMSA.
>>>
>>> In a VMSA system, a Memory Management Unit (MMU) provides fine-grained
>>> control of a memory system through a set of virtual to physical address
>>> mappings and associated memory properties held in memory-mapped tables
>>> known as translation tables.
>>>
>>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>>> ---
>>> v3:
>>> - new patch
>>> ---
>>>   xen/arch/arm/Kconfig | 8 ++++++++
>>>   1 file changed, 8 insertions(+)
>>>
>>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>>> index ff17345cdb..fb77392b82 100644
>>> --- a/xen/arch/arm/Kconfig
>>> +++ b/xen/arch/arm/Kconfig
>>> @@ -60,6 +60,14 @@ config PADDR_BITS
>>>
>>>   source "arch/Kconfig"
>>>
>>> +config HAS_MMU
>>> +       bool "Memory Management Unit support in a VMSA system"
>>> +       default y
>
> I don't think you can disable HAS_MMU right now. So you want to drop 
> the description to prevent a user to select it. This could then be 
> combined to
>
> "def_bool y".
>
>>> +       help
>>> +         In a VMSA system, a Memory Management Unit (MMU) provides 
>>> fine-grained control of
>>> +         a memory system through a set of virtual to physical 
>>> address mappings and associated memory
>>> +         properties held in memory-mapped tables known as 
>>> translation tables.
>>> +
>>>   config ACPI
>>>          bool "ACPI (Advanced Configuration and Power Interface) 
>>> Support (UNSUPPORTED)" if UNSUPPORTED
>>>          depends on ARM_64
>>
>> I don't think you need this option.
>
> I think we want to introduce a 'choice' where the user can select 
> either the MPU or MMU. But not both.

+1 (I like this approach).

>
> This would be similar to how we select the Physical address space size.
>
> Cheers,
>

Re: [PATCH v3 06/52] xen/arm: introduce CONFIG_HAS_MMU
Posted by Penny Zheng 2 years, 3 months ago
Hi Julien and Ayan

On 2023/7/4 20:04, Ayan Kumar Halder wrote:
> 
> On 04/07/2023 12:44, Julien Grall wrote:
>> Hi,
>>
>> On 04/07/2023 12:14, Ayan Kumar Halder wrote:
>>> On 26/06/2023 04:33, Penny Zheng wrote:
>>>> CAUTION: This message has originated from an External Source. Please 
>>>> use proper judgment and caution when opening attachments, clicking 
>>>> links, or responding to this email.
>>>>
>>>>
>>>> This commit wants to introduce a new Kconfig CONFIG_HAS_MMU to guard
>>>> MMU-related codes, to tell two different memory management 
>>>> architecture:
>>>> VMAS and PMSA.
>>>>
>>>> In a VMSA system, a Memory Management Unit (MMU) provides fine-grained
>>>> control of a memory system through a set of virtual to physical address
>>>> mappings and associated memory properties held in memory-mapped tables
>>>> known as translation tables.
>>>>
>>>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>>>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>>>> ---
>>>> v3:
>>>> - new patch
>>>> ---
>>>>   xen/arch/arm/Kconfig | 8 ++++++++
>>>>   1 file changed, 8 insertions(+)
>>>>
>>>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>>>> index ff17345cdb..fb77392b82 100644
>>>> --- a/xen/arch/arm/Kconfig
>>>> +++ b/xen/arch/arm/Kconfig
>>>> @@ -60,6 +60,14 @@ config PADDR_BITS
>>>>
>>>>   source "arch/Kconfig"
>>>>
>>>> +config HAS_MMU
>>>> +       bool "Memory Management Unit support in a VMSA system"
>>>> +       default y
>>
>> I don't think you can disable HAS_MMU right now. So you want to drop 
>> the description to prevent a user to select it. This could then be 
>> combined to
>>
>> "def_bool y".
>>
>>>> +       help
>>>> +         In a VMSA system, a Memory Management Unit (MMU) provides 
>>>> fine-grained control of
>>>> +         a memory system through a set of virtual to physical 
>>>> address mappings and associated memory
>>>> +         properties held in memory-mapped tables known as 
>>>> translation tables.
>>>> +
>>>>   config ACPI
>>>>          bool "ACPI (Advanced Configuration and Power Interface) 
>>>> Support (UNSUPPORTED)" if UNSUPPORTED
>>>>          depends on ARM_64
>>>
>>> I don't think you need this option.
>>
>> I think we want to introduce a 'choice' where the user can select 
>> either the MPU or MMU. But not both.
> 
> +1 (I like this approach).

+1 from me

I will introduce the choice "ARM Memory Management Architecture" and 
default HAS_MMU


> 
>>
>> This would be similar to how we select the Physical address space size.
>>
>> Cheers,
>>