diff mbox series

[08/10] xen/arm: Rename setup_pagetables with a more generic name

Message ID 20250312135258.1815706-9-luca.fancellu@arm.com (mailing list archive)
State New
Headers show
Series MPU mm subsistem skeleton | expand

Commit Message

Luca Fancellu March 12, 2025, 1:52 p.m. UTC
Rename the setup_pagetables function to setup_mappings in
order to be implemented also for MPU system that does not
have page tables.

Introduce a stub implementation for MPU in order to allow
the compilation.

Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/arch/arm/include/asm/mm.h |  2 +-
 xen/arch/arm/mmu/setup.c      |  2 +-
 xen/arch/arm/mpu/Makefile     |  1 +
 xen/arch/arm/mpu/setup.c      | 18 ++++++++++++++++++
 xen/arch/arm/setup.c          |  6 +++---
 5 files changed, 24 insertions(+), 5 deletions(-)
 create mode 100644 xen/arch/arm/mpu/setup.c
diff mbox series

Patch

diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index c96d33aceaf0..9bf5c846c86c 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -206,7 +206,7 @@  extern unsigned long frametable_base_pdx;
 #define PDX_GROUP_SHIFT SECOND_SHIFT
 
 /* Boot-time pagetable setup */
-extern void setup_pagetables(void);
+extern void setup_mappings(void);
 /* Map FDT in boot pagetable */
 extern void *early_fdt_map(paddr_t fdt_paddr);
 /* Remove early mappings */
diff --git a/xen/arch/arm/mmu/setup.c b/xen/arch/arm/mmu/setup.c
index 30afe9778194..35ffa5479dd3 100644
--- a/xen/arch/arm/mmu/setup.c
+++ b/xen/arch/arm/mmu/setup.c
@@ -354,7 +354,7 @@  static void __init create_llc_coloring_mappings(void)
  * Boot-time pagetable setup.
  * Changes here may need matching changes in head.S
  */
-void __init setup_pagetables(void)
+void __init setup_mappings(void)
 {
     uint64_t ttbr;
     lpae_t pte, *p;
diff --git a/xen/arch/arm/mpu/Makefile b/xen/arch/arm/mpu/Makefile
index b18cec483671..04df0b2ee760 100644
--- a/xen/arch/arm/mpu/Makefile
+++ b/xen/arch/arm/mpu/Makefile
@@ -1 +1,2 @@ 
 obj-y += mm.o
+obj-y += setup.init.o
diff --git a/xen/arch/arm/mpu/setup.c b/xen/arch/arm/mpu/setup.c
new file mode 100644
index 000000000000..45214bfeb661
--- /dev/null
+++ b/xen/arch/arm/mpu/setup.c
@@ -0,0 +1,18 @@ 
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bug.h>
+#include <xen/init.h>
+
+void __init setup_mappings(void)
+{
+    BUG_ON("unimplemented");
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index ffcae900d72e..4c9ed747f9a8 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -338,10 +338,10 @@  void asmlinkage __init start_xen(unsigned long fdt_paddr)
     llc_coloring_init();
 
     /*
-     * Page tables must be setup after LLC coloring initialization because
-     * coloring info are required in order to create colored mappings
+     * On MMU, page tables must be setup after LLC coloring initialization
+     * because coloring info are required in order to create colored mappings
      */
-    setup_pagetables();
+    setup_mappings();
     /* Device-tree was mapped in boot page tables, remap it in the new tables */
     device_tree_flattened = early_fdt_map(fdt_paddr);