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

Re: [PATCH 6/6] arm/mpu: Implement remove_early_mappings for MPU systems


  • To: Hari Limaye <hari.limaye@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • Date: Wed, 25 Jun 2025 18:26:32 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • 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=L08ObTZ2rdiNkLCpPBNhf5bX/1KhDny2ZiY1FyFu6Fc=; b=k+0alFl7vZmhhRx34zv+SaG8dttn1yyIjM7GlPKZ9ZfC3EFW/ZpD9ZQaM1NtbAc882+2oX5gB8R3Zbt7RsWLLSzRJal/0MgwN0iUQObq188KjqqUAetcBoh64PbBv77zZFhYWXZ/lyXNNyQP2xtoNvK/dNvfMpHA3Qa5Ef8GosnYd9z6j6v2uITRrq4nMs26IovO2/C+I/Q2hb6HCBUKSb1tsvprqASzqyTCHjvROZo+4J4A8HoKzVAErAKBbQ0BTXO0BJcJ5Yz6ckadYIdOHgqqP4FZ6qAcOYquD79cuyZucEDHL2LqtqzZPcRNeCwWdQIgojKTHkqT079TBa9FAw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KQrvy4ODv6g7TWGIlOFOTd3GW/dt9ZRLtpno57uw5I7KLE86bN4rrVEoCg1b1P0QSBycqg9BMFuL9pzW2j63WJ6PhZFR6Tvm8WsmQmE4gWm+iAClvtHUWTnFiJt5N3cnAfGsvGc+EIAH5yoOO+XoV466ir//UOQBUeby3v+yRqrzyWGeJ4Dv76i4r8oj6iJHEalClK6tIskHF4fXR8kICQob5Dt5cEuJdKhSngBpZcKrxUbNbbwpC5wTYMirG6MJ9kvU6z2/jeoKJ6SzacuxmqPsGpkjvZLpSD9eIw95Eac99j0UCBe1k9193PVccVGJQuyEJnf1XJuvxZcnwUdMhQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: luca.fancellu@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: Wed, 25 Jun 2025 17:26:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi,

On 20/06/2025 10:49, Hari Limaye wrote:
CAUTION: This message has originated from an External Source. Please use proper 
judgment and caution when opening attachments, clicking links, or responding to 
this email.


From: Luca Fancellu <luca.fancellu@xxxxxxx>

Implement remove_early_mappings for MPU systems.

Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
Signed-off-by: Hari Limaye <hari.limaye@xxxxxxx>

Reviewed-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>

I have tested the series on R52 and R82 and it works fine.

- Ayan

---
  xen/arch/arm/mpu/setup.c | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/mpu/setup.c b/xen/arch/arm/mpu/setup.c
index ab00cb944b..5928b534d5 100644
--- a/xen/arch/arm/mpu/setup.c
+++ b/xen/arch/arm/mpu/setup.c
@@ -97,7 +97,14 @@ void __init copy_from_paddr(void *dst, paddr_t paddr, 
unsigned long len)

  void __init remove_early_mappings(void)
  {
-    BUG_ON("unimplemented");
+    int rc;
+
+    if ( mapped_fdt_paddr == INVALID_PADDR )
+        return;
+
+    rc = destroy_xen_mappings(round_pgdown(mapped_fdt_paddr), 
mapped_fdt_limit);
+    if ( rc )
+        panic("Unable to unmap the device-tree.\n");
  }

  /*
--
2.34.1





 


Rackspace

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