[PATCH v3 3/6] arm/mpu: Move domain-page.c to arm32 specific dir

Ayan Kumar Halder posted 6 patches 4 months, 3 weeks ago
There is a newer version of this series
[PATCH v3 3/6] arm/mpu: Move domain-page.c to arm32 specific dir
Posted by Ayan Kumar Halder 4 months, 3 weeks ago
Create xen/arch/arm/mpu/arm32 to hold arm32 specific bits.

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

v1..v2 - New patch in v3.

 xen/arch/arm/mpu/Makefile                  | 2 +-
 xen/arch/arm/mpu/arm32/Makefile            | 1 +
 xen/arch/arm/mpu/{ => arm32}/domain-page.c | 0
 3 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 xen/arch/arm/mpu/arm32/Makefile
 rename xen/arch/arm/mpu/{ => arm32}/domain-page.c (100%)

diff --git a/xen/arch/arm/mpu/Makefile b/xen/arch/arm/mpu/Makefile
index 808e3e2cb3..9359d79332 100644
--- a/xen/arch/arm/mpu/Makefile
+++ b/xen/arch/arm/mpu/Makefile
@@ -1,4 +1,4 @@
-obj-$(CONFIG_ARM_32) += domain-page.o
+obj-$(CONFIG_ARM_32) += arm32/
 obj-y += mm.o
 obj-y += p2m.o
 obj-y += setup.init.o
diff --git a/xen/arch/arm/mpu/arm32/Makefile b/xen/arch/arm/mpu/arm32/Makefile
new file mode 100644
index 0000000000..e15ce2f7be
--- /dev/null
+++ b/xen/arch/arm/mpu/arm32/Makefile
@@ -0,0 +1 @@
+obj-y += domain-page.o
diff --git a/xen/arch/arm/mpu/domain-page.c b/xen/arch/arm/mpu/arm32/domain-page.c
similarity index 100%
rename from xen/arch/arm/mpu/domain-page.c
rename to xen/arch/arm/mpu/arm32/domain-page.c
-- 
2.25.1
Re: [PATCH v3 3/6] arm/mpu: Move domain-page.c to arm32 specific dir
Posted by Luca Fancellu 4 months, 3 weeks ago
Hi Ayan,

> On 11 Jun 2025, at 15:35, Ayan Kumar Halder <ayan.kumar.halder@amd.com> wrote:
> 
> Create xen/arch/arm/mpu/arm32 to hold arm32 specific bits.
> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> ---
> Changes from :-
> 
> v1..v2 - New patch in v3.
> 
> xen/arch/arm/mpu/Makefile                  | 2 +-
> xen/arch/arm/mpu/arm32/Makefile            | 1 +
> xen/arch/arm/mpu/{ => arm32}/domain-page.c | 0
> 3 files changed, 2 insertions(+), 1 deletion(-)
> create mode 100644 xen/arch/arm/mpu/arm32/Makefile
> rename xen/arch/arm/mpu/{ => arm32}/domain-page.c (100%)

Uhm, why?

Arm64 is using domain-page.c:
https://gitlab.com/xen-project/people/lucafancellu/xen/-/commit/b28198d00078991d4a6502e94c8779d84fec0120

Did I miss something?

Cheers,
Luca
Re: [PATCH v3 3/6] arm/mpu: Move domain-page.c to arm32 specific dir
Posted by Ayan Kumar Halder 4 months, 2 weeks ago
On 11/06/2025 20:46, Luca Fancellu wrote:
> Hi Ayan,
Hi Luca,
>
>> On 11 Jun 2025, at 15:35, Ayan Kumar Halder <ayan.kumar.halder@amd.com> wrote:
>>
>> Create xen/arch/arm/mpu/arm32 to hold arm32 specific bits.
>>
>> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
>> ---
>> Changes from :-
>>
>> v1..v2 - New patch in v3.
>>
>> xen/arch/arm/mpu/Makefile                  | 2 +-
>> xen/arch/arm/mpu/arm32/Makefile            | 1 +
>> xen/arch/arm/mpu/{ => arm32}/domain-page.c | 0
>> 3 files changed, 2 insertions(+), 1 deletion(-)
>> create mode 100644 xen/arch/arm/mpu/arm32/Makefile
>> rename xen/arch/arm/mpu/{ => arm32}/domain-page.c (100%)
> Uhm, why?
>
> Arm64 is using domain-page.c:
> https://gitlab.com/xen-project/people/lucafancellu/xen/-/commit/b28198d00078991d4a6502e94c8779d84fec0120
>
> Did I miss something?

Oh, I did not look at the future patches. I can drop this patch in my 
next series once you and Michal/Julien reviews the other patches.

I feel it is cleaner to have separate implementations for 
prepare_selector(), read_protection_region(), write_protection_region() 
between arm32 and arm64. (Refer patch 4 and 6)

Let me know how it looks like.

- Ayan

>
> Cheers,
> Luca