Enable early bootup of AArch32 MPU systems (pre-requisite patches)
v2 cover Enable early bootup of AArch32 MPU systems (pre-requisite patches)
Hi,
I have extracted patches 1, 2 from "https://patchew.org/Xen/[email protected]/" as it will introduce the common files on which the following can be based :-
1. "[PATCH 0/9] First chunk for Arm R82 and MPU support"
2. "Enable early bootup of AArch32 MPU systems" (patches 3-5)
Ayan Kumar Halder (2):
xen/arm: mpu: Move some of the definitions to common file xen/arm: mpu: Ensure that the page size is 4KB
xen/arch/arm/Makefile | 1 +
xen/arch/arm/arm64/mpu/Makefile | 1 -
xen/arch/arm/arm64/mpu/head.S | 2 +-
xen/arch/arm/include/asm/early_printk.h | 2 +-
xen/arch/arm/include/asm/{arm64 => }/mpu.h | 6 +++---
xen/arch/arm/mpu/Makefile | 1 +
xen/arch/arm/{arm64 => }/mpu/mm.c | 0
7 files changed, 7 insertions(+), 6 deletions(-)
rename xen/arch/arm/include/asm/{arm64 => }/mpu.h (87%)
create mode 100644 xen/arch/arm/mpu/Makefile
rename xen/arch/arm/{arm64 => }/mpu/mm.c (100%)Signature · 1 line
2.25.1
PATCH v2 2/2 xen/arm: mpu: Ensure that the page size is 4KB
Similar to commit (d736b6eb451b, "xen/arm: mpu: Define Xen start address for MPU systems"), one needs to add a build assertion to ensure that the page size is 4KB on arm32 based systems as well.
The existing build assertion is moved under "xen/arch/arm/mpu" as it applies for both arm64 and arm32 based systems.
---
Changes from :-
v1 - 1. Extracted the changes to a common file. (I have dropped Luca's R-b as there were code changes.)
xen/arch/arm/Makefile | 1 +
xen/arch/arm/arm64/mpu/Makefile | 1 -
xen/arch/arm/mpu/Makefile | 1 +
xen/arch/arm/{arm64 => }/mpu/mm.c | 0
4 files changed, 2 insertions(+), 1 deletion(-)
create mode 100644 xen/arch/arm/mpu/Makefile
rename xen/arch/arm/{arm64 => }/mpu/mm.c (100%)xen/arch/arm/Makefile +1 -0
@@ -1,6 +1,7 @@ obj-$(CONFIG_ARM_32) += arm32/ obj-$(CONFIG_ARM_64) += arm64/ obj-$(CONFIG_MMU) += mmu/ +obj-$(CONFIG_MPU) += mpu/ obj-$(CONFIG_ACPI) += acpi/ obj-$(CONFIG_HAS_PCI) += pci/ ifneq ($(CONFIG_NO_PLAT),y)
xen/arch/arm/arm64/mpu/Makefile +0 -1
@@ -1,2 +1 @@ obj-y += head.o -obj-y += mm.o
xen/arch/arm/mpu/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-y += mm.o
xen/arch/arm/mpu/mm.c renamed from xen/arch/arm/arm64/mpu/mm.c +0 -0
Signature · 1 line
2.25.1
PATCH v2 1/2 xen/arm: mpu: Move some of the definitions to common file
In reply to Ayan Kumar HalderFor AArch32, refer to ARM DDI 0568A.c ID110520. MPU_REGION_SHIFT is same between AArch32 and AArch64 (HPRBAR). Also, NUM_MPU_REGIONS_SHIFT is same between AArch32 and AArch64 (HMPUIR).
---
Changes from
v1 - 1. Add the R-b.
xen/arch/arm/arm64/mpu/head.S | 2 +-
xen/arch/arm/include/asm/early_printk.h | 2 +-
xen/arch/arm/include/asm/{arm64 => }/mpu.h | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
rename xen/arch/arm/include/asm/{arm64 => }/mpu.h (87%)xen/arch/arm/arm64/mpu/head.S +1 -1
@@ -3,7 +3,7 @@ * Start-of-day code for an Armv8-R MPU system. */ -#include <asm/arm64/mpu.h> +#include <asm/mpu.h> #include <asm/early_printk.h> /* Backgroud region enable/disable */
xen/arch/arm/include/asm/early_printk.h +1 -1
@@ -11,7 +11,7 @@#define __ARM_EARLY_PRINTK_H__#include <xen/page-size.h> -#include <asm/arm64/mpu.h> +#include <asm/mpu.h> #include <asm/fixmap.h> #ifdef CONFIG_EARLY_PRINTK
xen/arch/arm/include/asm/mpu.h renamed from xen/arch/arm/include/asm/arm64/mpu.h +3 -3
@@ -3,8 +3,8 @@* mpu.h: Arm Memory Protection Unit definitions. */ -#ifndef __ARM64_MPU_H__ -#define __ARM64_MPU_H__ +#ifndef __ARM_MPU_H__ +#define __ARM_MPU_H__#define MPU_REGION_SHIFT 6#define MPU_REGION_ALIGN (_AC(1, UL) << MPU_REGION_SHIFT)
@@ -13,7 +13,7 @@#define NUM_MPU_REGIONS_SHIFT 8#define NUM_MPU_REGIONS (_AC(1, UL) << NUM_MPU_REGIONS_SHIFT)#define NUM_MPU_REGIONS_MASK (NUM_MPU_REGIONS - 1) -#endif /* __ARM64_MPU_H__ */ +#endif /* __ARM_MPU_H__ */ /* * Local variables:
Signature · 1 line
2.25.1
Re: [PATCH v2 1/2] xen/arm: mpu: Move some of the definitions to common file
Quoted 23 lines · Ayan Kumar Halder
For AArch32, refer to ARM DDI
0568A.cID110520.MPU_REGION_SHIFTis same between AArch32 and AArch64 (HPRBAR). Also,NUM_MPU_REGIONS_SHIFTis same between AArch32 and AArch64 (HMPUIR).Signed-off-by Ayan Kumar Halder <[email protected]>Reviewed-by Luca Fancellu <[email protected]>---
Changes fromv1 - 1. Add the R-b.
xen/arch/arm/arm64/mpu/head.S | 2 +- xen/arch/arm/include/asm/early_printk.h | 2 +- xen/arch/arm/include/asm/{arm64 => }/mpu.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) rename xen/arch/arm/include/asm/{arm64 => }/mpu.h (87%)xen/arch/arm/arm64/mpu/head.S +0
-0
xen/arch/arm/arm64/mpu/head.S line 7
Quoted 6 lines
xen/arch/arm/arm64/mpu/head.S +1
-1@@ -3,7 +3,7 @@ * Start-of-day code for an Armv8-R MPU system. */ -#include <asm/arm64/mpu.h> +#include <asm/mpu.h> #include <asm/early_printk.h>
These should be sorted alphabetically
xen/arch/arm/include/asm/early_printk.h line 15
Quoted 13 lines
xen/arch/arm/arm64/mpu/head.S +0
-0/* Backgroud region enable/disable */xen/arch/arm/include/asm/early_printk.h +1
-1@@ -11,7 +11,7 @@#define __ARM_EARLY_PRINTK_H__#include <xen/page-size.h> -#include <asm/arm64/mpu.h> +#include <asm/mpu.h> #include <asm/fixmap.h>
These should be sorted alphabetically
Quoted 21 lines
xen/arch/arm/include/asm/early_printk.h +0
-0#ifdef CONFIG_EARLY_PRINTK xen/arch/arm/include/asm/mpu.h renamed from xen/arch/arm/include/asm/arm64/mpu.h +2
-2@@ -3,8 +3,8 @@* mpu.h: Arm Memory Protection Unit definitions. */ -#ifndef __ARM64_MPU_H__ -#define __ARM64_MPU_H__ +#ifndef __ARM_MPU_H__ +#define __ARM_MPU_H__#define MPU_REGION_SHIFT 6#define MPU_REGION_ALIGN (_AC(1, UL) << MPU_REGION_SHIFT)
xen/arch/arm/include/asm/mpu.h line 16
Quoted 5 lines
xen/arch/arm/include/asm/mpu.h renamed from xen/arch/arm/include/asm/arm64/mpu.h +1
-1@@ -13,7 +13,7 @@#define NUM_MPU_REGIONS_SHIFT 8#define NUM_MPU_REGIONS (_AC(1, UL) << NUM_MPU_REGIONS_SHIFT)#define NUM_MPU_REGIONS_MASK (NUM_MPU_REGIONS - 1) -#endif /* __ARM64_MPU_H__ */ +#endif /* __ARM_MPU_H__ */
Would you mind adding extra line between last definition and #endif?
With that:
~Michal
Re: [PATCH v2 2/2] xen/arm: mpu: Ensure that the page size is 4KB
In reply to Ayan Kumar HalderQuoted 7 lines · Ayan Kumar Halder
Similar to commit (
d736b6eb451b, "xen/arm: mpu: Define Xen start address for MPU systems"), one needs to add a build assertion to ensure that the page size is 4KB on arm32 based systems as well.
The existing build assertion is moved under "xen/arch/arm/mpu" as it applies for both arm64 and arm32 based systems.Signed-off-by Ayan Kumar Halder <[email protected]>
~Michal
Re: [PATCH v2 2/2] xen/arm: mpu: Ensure that the page size is 4KB
In reply to Ayan Kumar HalderHi Ayan,
Quoted 10 lines · Ayan Kumar Halder
Similar to commit (
d736b6eb451b, "xen/arm: mpu: Define Xen start address for MPU systems"), one needs to add a build assertion to ensure that the page size is 4KB on arm32 based systems as well.
The existing build assertion is moved under "xen/arch/arm/mpu" as it applies for both arm64 and arm32 based systems.Signed-off-by Ayan Kumar Halder <[email protected]>---
Re: [PATCH v2 1/2] xen/arm: mpu: Move some of the definitions to common file
In reply to Orzel, MichalHi Michal
Quoted 42 lines · Michal
Quoted 23 lines · Ayan Kumar Halder
For AArch32, refer to ARM DDI
0568A.cID110520.MPU_REGION_SHIFTis same between AArch32 and AArch64 (HPRBAR). Also,NUM_MPU_REGIONS_SHIFTis same between AArch32 and AArch64 (HMPUIR).Signed-off-by Ayan Kumar Halder <[email protected]>Reviewed-by Luca Fancellu <[email protected]>---
Changes fromv1 - 1. Add the R-b.
xen/arch/arm/arm64/mpu/head.S | 2 +- xen/arch/arm/include/asm/early_printk.h | 2 +- xen/arch/arm/include/asm/{arm64 => }/mpu.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-)rename xen/arch/arm/include/asm/{arm64 =>
}/mpu.h(87%)xen/arch/arm/arm64/mpu/head.S +0
-0xen/arch/arm/arm64/mpu/head.S line 7
Quoted 6 lines
xen/arch/arm/arm64/mpu/head.S +1
-1@@ -3,7 +3,7 @@ * Start-of-day code for an Armv8-R MPU system. */ -#include <asm/arm64/mpu.h> +#include <asm/mpu.h> #include <asm/early_printk.h>These should be sorted alphabetically
Quoted 9 lines
xen/arch/arm/arm64/mpu/head.S +0
-0/* Backgroud region enable/disable */xen/arch/arm/include/asm/early_printk.h +0
-0@@ -11,7 +11,7 @@#define __ARM_EARLY_PRINTK_H__
Quoted 5 lines
xen/arch/arm/include/asm/early_printk.h line 15
Quoted 4 lines
xen/arch/arm/include/asm/early_printk.h +1
-1#include <xen/page-size.h> -#include <asm/arm64/mpu.h> +#include <asm/mpu.h> #include <asm/fixmap.h> These should be sorted alphabetically
This and ..
Quoted 19 lines
Quoted 19 lines
xen/arch/arm/include/asm/early_printk.h +0
-0#ifdef CONFIG_EARLY_PRINTK xen/arch/arm/include/asm/mpu.h renamed from xen/arch/arm/include/asm/arm64/mpu.h +2
-2@@ -3,8 +3,8 @@* mpu.h: Arm Memory Protection Unit definitions. */ -#ifndef __ARM64_MPU_H__ -#define __ARM64_MPU_H__ +#ifndef __ARM_MPU_H__ +#define __ARM_MPU_H__
Quoted 9 lines
xen/arch/arm/include/asm/mpu.h line 16
Quoted 8 lines
xen/arch/arm/include/asm/mpu.h renamed from xen/arch/arm/include/asm/arm64/mpu.h +1
-1#define MPU_REGION_SHIFT 6#define MPU_REGION_ALIGN (_AC(1, UL) << MPU_REGION_SHIFT)@@ -13,7 +13,7 @@#define NUM_MPU_REGIONS_SHIFT 8#define NUM_MPU_REGIONS (_AC(1, UL) << NUM_MPU_REGIONS_SHIFT)#define NUM_MPU_REGIONS_MASK (NUM_MPU_REGIONS - 1) -#endif /* __ARM64_MPU_H__ */ +#endif /* __ARM_MPU_H__ */ Would you mind adding extra line between last definition and #endif?
this, can you fix them on commit, please ? Or do you want me to send a v3.
I am fine either way.
Quoted 3 lines
With that:
Acked-by Michal Orzel <[email protected]>
- Ayan
Quoted 3 lines
~Michal
Re: [PATCH v2 1/2] xen/arm: mpu: Move some of the definitions to common file
Quoted 80 lines · Ayan Kumar Halder
Hi Michal
Quoted 42 lines · Michal
Quoted 23 lines · Ayan Kumar Halder
For AArch32, refer to ARM DDI
0568A.cID110520.MPU_REGION_SHIFTis same between AArch32 and AArch64 (HPRBAR). Also,NUM_MPU_REGIONS_SHIFTis same between AArch32 and AArch64 (HMPUIR).Signed-off-by Ayan Kumar Halder <[email protected]>Reviewed-by Luca Fancellu <[email protected]>---
Changes fromv1 - 1. Add the R-b.
xen/arch/arm/arm64/mpu/head.S | 2 +- xen/arch/arm/include/asm/early_printk.h | 2 +- xen/arch/arm/include/asm/{arm64 => }/mpu.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-)rename xen/arch/arm/include/asm/{arm64 =>
}/mpu.h(87%)xen/arch/arm/arm64/mpu/head.S +0
-0xen/arch/arm/arm64/mpu/head.S line 7
Quoted 6 lines
xen/arch/arm/arm64/mpu/head.S +1
-1@@ -3,7 +3,7 @@ * Start-of-day code for an Armv8-R MPU system. */ -#include <asm/arm64/mpu.h> +#include <asm/mpu.h> #include <asm/early_printk.h>These should be sorted alphabetically
Quoted 9 lines
xen/arch/arm/arm64/mpu/head.S +0
-0/* Backgroud region enable/disable */xen/arch/arm/include/asm/early_printk.h +0
-0@@ -11,7 +11,7 @@#define __ARM_EARLY_PRINTK_H__Quoted 5 lines
xen/arch/arm/include/asm/early_printk.h line 15
Quoted 4 lines
xen/arch/arm/include/asm/early_printk.h +1
-1#include <xen/page-size.h> -#include <asm/arm64/mpu.h> +#include <asm/mpu.h> #include <asm/fixmap.h> These should be sorted alphabetically
This and ..
Quoted 19 lines
Quoted 19 lines
xen/arch/arm/include/asm/early_printk.h +0
-0#ifdef CONFIG_EARLY_PRINTK xen/arch/arm/include/asm/mpu.h renamed from xen/arch/arm/include/asm/arm64/mpu.h +2
-2@@ -3,8 +3,8 @@* mpu.h: Arm Memory Protection Unit definitions. */ -#ifndef __ARM64_MPU_H__ -#define __ARM64_MPU_H__ +#ifndef __ARM_MPU_H__ +#define __ARM_MPU_H__Quoted 9 lines
xen/arch/arm/include/asm/mpu.h line 16
Quoted 8 lines
xen/arch/arm/include/asm/mpu.h renamed from xen/arch/arm/include/asm/arm64/mpu.h +1
-1#define MPU_REGION_SHIFT 6#define MPU_REGION_ALIGN (_AC(1, UL) << MPU_REGION_SHIFT)@@ -13,7 +13,7 @@#define NUM_MPU_REGIONS_SHIFT 8#define NUM_MPU_REGIONS (_AC(1, UL) << NUM_MPU_REGIONS_SHIFT)#define NUM_MPU_REGIONS_MASK (NUM_MPU_REGIONS - 1) -#endif /* __ARM64_MPU_H__ */ +#endif /* __ARM_MPU_H__ */ Would you mind adding extra line between last definition and #endif?
Quoted 1 line
this, can you fix them on commit, please ? Or do you want me to send a v3.
If I end up committing this patch (I can do that tomorrow), then I can do these changes on commit.
~Michal