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

[PATCH v3 5/5] xen/arm32: mpu: Stubs to build MPU for arm32


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • Date: Sun, 30 Mar 2025 19:03:08 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zk+vRuec4fDRob1b6VKS0/iKJpo2k5z+nvuNuE8XdSY=; b=muMGQC+oi2k06pmqwm+NP6I/jlnT096A/qaiiTUuuU36lbI24uHjBx2uHCRc+AT0CDTrp3S6orap4/CHnupKCxAtaFSi/ZqZWCSUd/jbcMnHZCkLvpryOjvZMwkiGRo2Ma1oJc5iNVz/mN0p/RqgfsQM729qUFxSoGVmFCDpGdF8xfUV3ikpbAHoTF8/cOJayGw0pBhf0dg8PTb9v8rljE3Ws8xfavk5KWJSj3IBpnAEBGziRsx5Z9Mz8334z1hr79CIi0/0BU6doYZhxODNAA5CWQSm41giwvMdwoCUQO+oeFakuxD3qQhMPbkFfno/G9TJVrZ7uzmQAybzqa+upQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=g9Kyje7ezUgHmtBbc8GAtYgdYx6CT4eZnz/nDJHRrtnOfO9MSIhYbj2c3Z3GnOQSz2eR+bxkL5MTrmzFvqteaErARPfUxQknEi5yOYBdbbVWcYk5uFaHs6w4kIMHdZiCcuSFGlGdNLL3dpwS5u6Mu+v3aWDlNDx2T6l2VTMZma6o7RT0ltxiQb7ootDW3L+iZJs1avSH3K4K5AHN0bXxchPeNveoMgPq0PfNmDaHk6rYs08j/CFvFZzQrAzV66tw04lDEoLr9D5rkXbCBEm3GMg3DHgtwx1jIrpRPJ5VUv0PalYGAcdBag1ZM0I0d+EgjNhMsRwl0cF7Gi7YmtQhrQ==
  • Cc: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Sun, 30 Mar 2025 18:03:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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

v1, v2 -
1. New patch introduced in v3.
2. Should be applied on top of
https://patchwork.kernel.org/project/xen-devel/cover/20250316192445.2376484-1-luca.fancellu@xxxxxxx/

 xen/arch/arm/Kconfig             |  2 +-
 xen/arch/arm/arm32/mpu/Makefile  |  2 ++
 xen/arch/arm/arm32/mpu/p2m.c     | 18 ++++++++++++++++++
 xen/arch/arm/arm32/mpu/smpboot.c | 23 +++++++++++++++++++++++
 xen/arch/arm/include/asm/mm.h    |  5 +++++
 5 files changed, 49 insertions(+), 1 deletion(-)
 create mode 100644 xen/arch/arm/arm32/mpu/p2m.c
 create mode 100644 xen/arch/arm/arm32/mpu/smpboot.c

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 565f288331..a1dd942091 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -1,7 +1,7 @@
 config ARM_32
        def_bool y
        depends on "$(ARCH)" = "arm32"
-       select ARCH_MAP_DOMAIN_PAGE
+       select ARCH_MAP_DOMAIN_PAGE if MMU
 
 config ARM_64
        def_bool y
diff --git a/xen/arch/arm/arm32/mpu/Makefile b/xen/arch/arm/arm32/mpu/Makefile
index 3340058c08..38797f28af 100644
--- a/xen/arch/arm/arm32/mpu/Makefile
+++ b/xen/arch/arm/arm32/mpu/Makefile
@@ -1 +1,3 @@
 obj-y += head.o
+obj-y += smpboot.o
+obj-y += p2m.o
diff --git a/xen/arch/arm/arm32/mpu/p2m.c b/xen/arch/arm/arm32/mpu/p2m.c
new file mode 100644
index 0000000000..df8de5c7d8
--- /dev/null
+++ b/xen/arch/arm/arm32/mpu/p2m.c
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/init.h>
+#include <asm/p2m.h>
+
+void __init setup_virt_paging(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/arm32/mpu/smpboot.c b/xen/arch/arm/arm32/mpu/smpboot.c
new file mode 100644
index 0000000000..3f3e54294e
--- /dev/null
+++ b/xen/arch/arm/arm32/mpu/smpboot.c
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/mm.h>
+
+int prepare_secondary_mm(int cpu)
+{
+    BUG_ON("unimplemented");
+    return -EINVAL;
+}
+
+void update_boot_mapping(bool enable)
+{
+    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/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index fbffaccef4..a894e28ac9 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -171,12 +171,17 @@ struct page_info
 #define PGC_need_scrub    PGC_allocated
 
 #ifdef CONFIG_ARM_32
+#ifdef CONFIG_MPU
+#define is_xen_heap_page(page) false
+#define is_xen_heap_mfn(mfn) false
+#else
 #define is_xen_heap_page(page) is_xen_heap_mfn(page_to_mfn(page))
 #define is_xen_heap_mfn(mfn) ({                                 \
     unsigned long mfn_ = mfn_x(mfn);                            \
     (mfn_ >= mfn_x(directmap_mfn_start) &&                      \
      mfn_ < mfn_x(directmap_mfn_end));                          \
 })
+#endif
 #else
 #define is_xen_heap_page(page) ((page)->count_info & PGC_xen_heap)
 #define is_xen_heap_mfn(mfn) \
-- 
2.25.1




 


Rackspace

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