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

[XEN v1 7/9] xen/arm: Restrict zeroeth_table_offset for ARM_64


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • Date: Thu, 15 Dec 2022 19:32:43 +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
  • 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=Z5+olvGyXYR/FH3N6U5mKGmd6Dy3PG3BDHmi9oMXULE=; b=N+GHsaFKPeXrFU99lw1lcl2dYbKoga//yfaH/nHSOYNicsfTTazahN2f/7Gy+KxKokom8zboF31bw4LFYz2dTHRy2Q58hULPLCDTdNU3SKAqrmUZyCIlMPtWePkOJSIjcdxUl2GZkwNRgl9rMofzmQIlmlKJSEZEh3/KbQgRKh1EiyQDXpCqPgo88uIttgylcwpRtzAgSAHfmIV6tWwJex2gKA8JfRH9/ABtw3HysPhJmsIAfmUYXoO2JW4IhWQA4BiTRIwo76HdQsDCibsj2WqpMpVInYnX9BJNv1PTZyVWgcJix/GehaXzM2sTJ0h8oCIS911E+6GzqvFQA/AECQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dqUfJaGLBhYdgVd71pA74NpcmBICD0/sol8EoHZkdTt8WwltGKmf3j4tFZ4IBhAD02a4M/8LDfozJU+2bCUMl+mR8DrRSw2sLplTnEuNtQOTq9+fGjjwCcG0NHGPVGX8Mwk9gN8Zt7rJXe95N90alxAqUtkXP9gya7dW4xZC0rT4TaoyNv3jewoJXQEieXR1KRyeGU4JpERAcK0sV2OWSn7OXjAItcKQDbDgqSE4Zol4XDGF3TWmUR1LnajKYFFbDq4ehK+d9ohJ7FG2atBr+RylLNRgfrFjEPXD9mVsChOyLpYEvYZNkX3b2WaUiKKmn834nRsbohHJDO2sHGyNuQ==
  • Cc: <sstabellini@xxxxxxxxxx>, <stefano.stabellini@xxxxxxx>, <julien@xxxxxxx>, <Volodymyr_Babchuk@xxxxxxxx>, <bertrand.marquis@xxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • Delivery-date: Thu, 15 Dec 2022 19:33:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

zeroeth_table_offset is not accessed for ARM_32.
This is a left over of the following commit

"
commit 5fa6e9abfb11
Author: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date:   Thu Sep 18 01:09:48 2014 +0100

    xen: arm: Implement variable levels in dump_pt_walk
"

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
---
 xen/arch/arm/include/asm/lpae.h | 10 ++++++++++
 xen/arch/arm/mm.c               |  4 ++++
 2 files changed, 14 insertions(+)

diff --git a/xen/arch/arm/include/asm/lpae.h b/xen/arch/arm/include/asm/lpae.h
index 3fdd5d0de2..35769debf9 100644
--- a/xen/arch/arm/include/asm/lpae.h
+++ b/xen/arch/arm/include/asm/lpae.h
@@ -161,6 +161,7 @@ static inline bool lpae_is_superpage(lpae_t pte, unsigned 
int level)
 #define lpae_set_mfn(pte, mfn)  ((pte).walk.base = mfn_x(mfn))
 
 /* Generate an array @var containing the offset for each level from @addr */
+#ifdef CONFIG_ARM_64
 #define DECLARE_OFFSETS(var, addr)          \
     const unsigned int var[4] = {           \
         zeroeth_table_offset(addr),         \
@@ -168,6 +169,15 @@ static inline bool lpae_is_superpage(lpae_t pte, unsigned 
int level)
         second_table_offset(addr),          \
         third_table_offset(addr)            \
     }
+#else
+#define DECLARE_OFFSETS(var, addr)          \
+    const unsigned int var[4] = {           \
+        0,                                  \
+        first_table_offset(addr),           \
+        second_table_offset(addr),          \
+        third_table_offset(addr)            \
+    }
+#endif
 
 /*
  * Standard entry type that we'll use to build Xen's own pagetables.
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 630175276f..be939fb106 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -184,7 +184,11 @@ void dump_pt_walk(paddr_t ttbr, paddr_t addr,
     static const char *level_strs[4] = { "0TH", "1ST", "2ND", "3RD" };
     const mfn_t root_mfn = maddr_to_mfn(ttbr);
     const unsigned int offsets[4] = {
+#ifdef CONFIG_ARM_64
         zeroeth_table_offset(addr),
+#else
+        0,
+#endif
         first_table_offset(addr),
         second_table_offset(addr),
         third_table_offset(addr)
-- 
2.17.1




 


Rackspace

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