From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
Cc: Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Julien Grall <julien@xen.org>,
Bertrand Marquis <bertrand.marquis@arm.com>,
Michal Orzel <michal.orzel@amd.com>,
"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>
Subject: [PATCH v3 5/5] xen/arm32: mpu: Stubs to build MPU for arm32
Date: Sun, 30 Mar 2025 19:03:08 +0100 [thread overview]
Message-ID: <20250330180308.2551195-6-ayan.kumar.halder@amd.com> (raw)
In-Reply-To: <20250330180308.2551195-1-ayan.kumar.halder@amd.com>
Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
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@arm.com/
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
next prev parent reply other threads:[~2025-03-30 18:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-30 18:03 [PATCH v3 0/5] Enable early bootup of Armv8-R AArch32 systems Ayan Kumar Halder
2025-03-30 18:03 ` [PATCH v3 1/5] xen/arm32: Move MM specific registers to enable_mmu Ayan Kumar Halder
2025-03-30 18:03 ` [PATCH v3 2/5] xen/arm: Move some of the functions to common file Ayan Kumar Halder
2025-03-30 21:06 ` Julien Grall
2025-03-31 8:28 ` Orzel, Michal
2025-03-31 12:38 ` Ayan Kumar Halder
2025-03-31 13:04 ` Julien Grall
2025-03-30 18:03 ` [PATCH v3 3/5] xen/arm32: Create the same boot-time MPU regions as arm64 Ayan Kumar Halder
2025-03-30 18:03 ` [PATCH v3 4/5] xen/arm32: Allow ARM_PA_BITS_40 only if !MPU Ayan Kumar Halder
2025-03-30 21:07 ` Julien Grall
2025-03-30 18:03 ` Ayan Kumar Halder [this message]
2025-03-30 21:11 ` [PATCH v3 5/5] xen/arm32: mpu: Stubs to build MPU for arm32 Julien Grall
2025-04-03 16:35 ` Ayan Kumar Halder
2025-03-31 10:13 ` [PATCH v3 0/5] Enable early bootup of Armv8-R AArch32 systems Orzel, Michal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250330180308.2551195-6-ayan.kumar.halder@amd.com \
--to=ayan.kumar.halder@amd.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=bertrand.marquis@arm.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.