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

[PATCH v2 1/3] xen/arm64: Fix incorrect DIRECTMAP_SIZE calculation


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Tue, 17 Jan 2023 12:43:30 +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
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=iKLHhjoW+RSSaKho/VCljUTUCbTI/+fA3sXMWlAbEYE=; b=HKGNhNjgrOq8ca2QOvPEL8QzXvwrf5FdIOxCHKxOJtbEsWYqjHrya5M0uNT2AdrM6HziH4YuQ4Tf0dN4WK5DgglkL3q9QpF7xwsKJrXT35gDNFZsLJOouS/0Gq2SR/7SibK6QlDImCyqkcxPsGMbhj6odmV56Um8swaHmgYP73aSduLwjdorLd3+aUmI4+9L9aVQ/iu7gcMA/QnxDk5Nk018oziIxAJrvT/Kke8LmuXIKYFAOcWVt/qqe6+sJ08N1Gt+zfVxwTsjfh1UdT9ZT30HmKYSWdNyZH+BEN4cT6GeAEpsz/6AjlcQKWgsL+N0RWq0CEn+TMvS4lUHGd0YVw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ca/QEn6HmGlsQ4o6PNPLIi5ftn6tFmu++O/WupoGI/hjZzIN7XBj5ljRRg4W5G0/C7v5iInvdNEC5mKGX5TK0mm/DIZuqyukiTJ4DqR/IXvLbt3yF9pKXHIjARV60H2iTNnu/FC8YUTq079VvmpyzlRd77vRcMQFzKuqIXf71Zo6XibyelLkDi57T3JryZt/AuvCAy+RjVuokWWQNlp5BiUBDyq++HHpTFmz0Gr6FZlyMvbllfc8wBFimFHyO4b/ypBZCkCJu55pVVyoXXaBu4ACK7vUMH2wyhmYPtmSkoRbkE/qu5ekBSxiKbWiVx7UyEnz652TOSKLQ0Thfnn6rg==
  • Cc: Michal Orzel <michal.orzel@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 17 Jan 2023 11:43:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The direct mapped area occupies L0 slots from 256 to 265 included
(i.e. 10 slots), resulting in 5TB (512GB * 10) of virtual address space.
However, due to incorrect slot subtraction (we take 9 slots into account)
we set DIRECTMAP_SIZE to 4.5TB instead. Fix it.

Note that we only support up to 2TB of physical memory so this is
a latent issue.

Fixes: 5263507b1b4a ("xen: arm: Use a direct mapping of RAM on arm64")
Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
Changes in v2:
 - update commit msg making it clear that this is a latent issue 
---
 xen/arch/arm/include/asm/config.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/include/asm/config.h 
b/xen/arch/arm/include/asm/config.h
index 0fefed1b8aa9..16213c8b677f 100644
--- a/xen/arch/arm/include/asm/config.h
+++ b/xen/arch/arm/include/asm/config.h
@@ -157,7 +157,7 @@
 #define FRAMETABLE_NR          (FRAMETABLE_SIZE / sizeof(*frame_table))
 
 #define DIRECTMAP_VIRT_START   SLOT0(256)
-#define DIRECTMAP_SIZE         (SLOT0_ENTRY_SIZE * (265-256))
+#define DIRECTMAP_SIZE         (SLOT0_ENTRY_SIZE * (266 - 256))
 #define DIRECTMAP_VIRT_END     (DIRECTMAP_VIRT_START + DIRECTMAP_SIZE - 1)
 
 #define XENHEAP_VIRT_START     directmap_virt_start
-- 
2.25.1




 


Rackspace

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