]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
xen/arm: mpu: Ensure that the page size is 4KB
authorAyan Kumar Halder <ayan.kumar.halder@amd.com>
Tue, 4 Mar 2025 17:57:08 +0000 (17:57 +0000)
committerMichal Orzel <michal.orzel@amd.com>
Thu, 6 Mar 2025 07:09:29 +0000 (08:09 +0100)
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 <ayan.kumar.halder@amd.com>
Acked-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
xen/arch/arm/Makefile
xen/arch/arm/arm64/mpu/Makefile
xen/arch/arm/arm64/mpu/mm.c [deleted file]
xen/arch/arm/mpu/Makefile [new file with mode: 0644]
xen/arch/arm/mpu/mm.c [new file with mode: 0644]

index 43ab5e8f2550681f19258ec9a0bce20fe559ee5a..fb0948f067bdd64c1a720b3f336c2b7e5a143f31 100644 (file)
@@ -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)
index a8a750a3d0a106ced80e42218da88f3836ea7a96..3340058c08c662fef193595cea7aeba62a25b210 100644 (file)
@@ -1,2 +1 @@
 obj-y += head.o
-obj-y += mm.o
diff --git a/xen/arch/arm/arm64/mpu/mm.c b/xen/arch/arm/arm64/mpu/mm.c
deleted file mode 100644 (file)
index 0b8748e..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <xen/lib.h>
-#include <xen/init.h>
-#include <xen/sizes.h>
-
-static void __init __maybe_unused build_assertions(void)
-{
-    /*
-     * Unlike MMU, MPU does not use pages for translation. However, we continue
-     * to use PAGE_SIZE to denote 4KB. This is so that the existing memory
-     * management based on pages, continue to work for now.
-     */
-    BUILD_BUG_ON(PAGE_SIZE != SZ_4K);
-}
diff --git a/xen/arch/arm/mpu/Makefile b/xen/arch/arm/mpu/Makefile
new file mode 100644 (file)
index 0000000..b18cec4
--- /dev/null
@@ -0,0 +1 @@
+obj-y += mm.o
diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
new file mode 100644 (file)
index 0000000..0b8748e
--- /dev/null
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/lib.h>
+#include <xen/init.h>
+#include <xen/sizes.h>
+
+static void __init __maybe_unused build_assertions(void)
+{
+    /*
+     * Unlike MMU, MPU does not use pages for translation. However, we continue
+     * to use PAGE_SIZE to denote 4KB. This is so that the existing memory
+     * management based on pages, continue to work for now.
+     */
+    BUILD_BUG_ON(PAGE_SIZE != SZ_4K);
+}