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

[PATCH 1/5] xen/arm: mpu: Ensure that the page size is 4KB (arm32)


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • Date: Tue, 4 Feb 2025 19:23:53 +0000
  • 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=oO+GghfFL4JgTxoRWMrv1S6PLgVtgiVvBOKgB4uNX/M=; b=OIyjyisM1Rwjog7sj8o+2nkXc0ICKcQu8141MyGv64nbUlS8OaFbIxalBQdXpXwBSMH5oP0rV8y8T/w5Bi6GQQLKOdY3/1VP25l+rlTAD6lVgI5KPnj+Q8SqsYOoa57lZhV2qpvVBrdZQcneBQ/KeZ1jxGTARB5XG9+k5Klc3rAhS7nKLuHPYLBLcDkrD51NbJYlAD7ZTgicguR52JU+Dk1ay2LaAkYuhgOReQn3vL0evegm8sMjOR0oZiiGWGpRBURks8TqJlDp2jzFlrAhg3KxvU/g/5qRFoir01eq3n+lbdovOCfpqXGBAy7tbi63J/2xr7w8J2gJ6BgzydcEdw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=x3FYZ5/1vPER+8lA56j6wwtMQDq98QxLM8FgLPxjtgQiO/z7cHs0AiFqRW4CQ72Vlcu0FjLyFP+Ce1iD7Lx91ffJzx9J8P/2z+HyBpHrWRirV1w4jgGyHF0QlQVgUmbULkqHXLuQIOt63dSf5B5lUdz5pD5j7FcvTCEYu5nX4MfQJ9ObXqo7ybwdXw6MSJ5wOSQvYNHA0VkbipM6oTlrwxNMh3y6d+vog2JpzvVdgZMu+q5QEdvIZN108P/U5HUQTfRB6mQDmsNb1UCPqj4gokmEiozxjHmbZ8NOkDV91LGKTsmXWz5KY95/CbknrrX+bw+Nod6YbXqm7VDEoRm/Tw==
  • 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: Tue, 04 Feb 2025 19:24:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Similar to "xen/arm: mpu: Define Xen start address for MPU systems", added
a build assertion to ensure that the page size is 4KB.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
---
 xen/arch/arm/arm32/Makefile     |  1 +
 xen/arch/arm/arm32/mpu/Makefile |  1 +
 xen/arch/arm/arm32/mpu/mm.c     | 15 +++++++++++++++
 3 files changed, 17 insertions(+)
 create mode 100644 xen/arch/arm/arm32/mpu/Makefile
 create mode 100644 xen/arch/arm/arm32/mpu/mm.c

diff --git a/xen/arch/arm/arm32/Makefile b/xen/arch/arm/arm32/Makefile
index 40a2b4803f..537969d753 100644
--- a/xen/arch/arm/arm32/Makefile
+++ b/xen/arch/arm/arm32/Makefile
@@ -1,5 +1,6 @@
 obj-y += lib/
 obj-$(CONFIG_MMU) += mmu/
+obj-$(CONFIG_MPU) += mpu/
 
 obj-$(CONFIG_EARLY_PRINTK) += debug.o
 obj-y += domctl.o
diff --git a/xen/arch/arm/arm32/mpu/Makefile b/xen/arch/arm/arm32/mpu/Makefile
new file mode 100644
index 0000000000..b18cec4836
--- /dev/null
+++ b/xen/arch/arm/arm32/mpu/Makefile
@@ -0,0 +1 @@
+obj-y += mm.o
diff --git a/xen/arch/arm/arm32/mpu/mm.c b/xen/arch/arm/arm32/mpu/mm.c
new file mode 100644
index 0000000000..0b8748e575
--- /dev/null
+++ b/xen/arch/arm/arm32/mpu/mm.c
@@ -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);
+}
-- 
2.25.1




 


Rackspace

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