[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] arm/mpu: Map domain page in MPU systems



commit 4b3cad91a13a03f4c2e03e9147a42949df33ee57
Author:     Penny Zheng <Penny.Zheng@xxxxxxx>
AuthorDate: Wed Jan 14 14:27:34 2026 +0000
Commit:     Michal Orzel <michal.orzel@xxxxxxx>
CommitDate: Fri Jan 16 09:38:30 2026 +0100

    arm/mpu: Map domain page in MPU systems
    
    In MPU systems, we implement map_domain_page()/unmap_domain_page()
    through mapping the domain page with a MPU region on demand.
    
    Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx>
    Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
    Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
    Signed-off-by: Harry Ramsey <harry.ramsey@xxxxxxx>
    Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
---
 xen/arch/arm/Kconfig           |  1 +
 xen/arch/arm/mpu/Makefile      |  1 +
 xen/arch/arm/mpu/domain-page.c | 46 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 48 insertions(+)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index cf6af68299..0d81a4d8b4 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -91,6 +91,7 @@ config MMU
 
 config MPU
        bool "MPU" if UNSUPPORTED
+       select ARCH_MAP_DOMAIN_PAGE
        select STATIC_MEMORY
        help
          Memory Protection Unit (MPU). Select if you plan to run Xen on ARMv8-R
diff --git a/xen/arch/arm/mpu/Makefile b/xen/arch/arm/mpu/Makefile
index 4963c8b550..3327fadd5d 100644
--- a/xen/arch/arm/mpu/Makefile
+++ b/xen/arch/arm/mpu/Makefile
@@ -1,5 +1,6 @@
 obj-$(CONFIG_ARM_32) += arm32/
 obj-$(CONFIG_ARM_64) += arm64/
+obj-y += domain-page.o
 obj-y += mm.o
 obj-y += p2m.o
 obj-y += setup.init.o
diff --git a/xen/arch/arm/mpu/domain-page.c b/xen/arch/arm/mpu/domain-page.c
new file mode 100644
index 0000000000..b79afc493b
--- /dev/null
+++ b/xen/arch/arm/mpu/domain-page.c
@@ -0,0 +1,46 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bug.h>
+#include <xen/domain_page.h>
+#include <xen/mm.h>
+#include <xen/mm-frame.h>
+#include <xen/types.h>
+#include <xen/vmap.h>
+
+void *map_domain_page_global(mfn_t mfn)
+{
+    BUG_ON("unimplemented");
+    return NULL;
+}
+
+/* Map a page of domheap memory */
+void *map_domain_page(mfn_t mfn)
+{
+    return vmap_contig(mfn, 1);
+}
+
+/* Release a mapping taken with map_domain_page() */
+void unmap_domain_page(const void *ptr)
+{
+    vunmap(ptr);
+}
+
+mfn_t domain_page_map_to_mfn(const void *ptr)
+{
+    BUG_ON("unimplemented");
+    return INVALID_MFN;
+}
+
+void unmap_domain_page_global(const void *va)
+{
+    BUG_ON("unimplemented");
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.