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

[XEN v2 02/12] xen/Arm: GICv3: Move the macros to compute the affnity level to arm64/arm32


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • Date: Mon, 31 Oct 2022 15:13:16 +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=adYAdT9Zx/p/A9R392/UHvgvSHlcP+ELYd9uABjHU/Q=; b=A1JOzk5lDpl9/YEY7z1weMjhCfTFxGhrxclfPxQyVLpisQZcs/3LiD8sj+FIpv1VQh7VlQWVWBCyXZFOwhiI+o+Y/tE+rZpjCAKgztz7xRGQTyQ/71TaWfs+YiPYYKDdJQtdCyW23K8JF5/rRtK1WszcIO6RSvtlEhQ8sbiTtobWwnS7a2gmC5px+IgWrUcVoiNVAC3xt82UOMQrU73p37D6J+q+qW1p9nLKrfnSCWxcPiDm8ZuEWdkcyR5UgZ+VPflaUS7NQZE8sc4sQ2FnJlmKDrNyyg+X/fJqEHBosfHX7pUEu56ghdc5U8UIqtib/k3kGOlakF+l7A3HzJd/fQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=coLUsn+FnEhbZRtmCf0D6FaqiVG1/orZMiO9xvSKBsTlYe5eS+ZUtO9OpnKbHVXbbPJ8fsSxbTxlbT9j9wIkc8QFdLebT5AWegv4WpnySvwIJrF0rUvT9QqwFR/fCkjxq9RZgDlQv9WRSgcbaSDX48lb/MJSCUWkZ74ugM5oYuP+QS7rJCgkiJnW6yxX6g1q4YwutxTGt0mIdvfU/pfNAvuwr1Ih4w5H6vkdNPm50JqTE940ljO6AEk3mUSEOaVAVftjUYZ0Bwf5TOGl3HjmoNOA5CKBN0QlZaPd6RMVlUk1KZaMk6LN1TGrCskrv6NbK5HcySU12fY9QBTiQ6ksCA==
  • Cc: <sstabellini@xxxxxxxxxx>, <stefanos@xxxxxxxxxx>, <julien@xxxxxxx>, <Volodymyr_Babchuk@xxxxxxxx>, <bertrand.marquis@xxxxxxx>, <burzalodowa@xxxxxxxxx>, Ayan Kumar Halder <ayankuma@xxxxxxx>
  • Delivery-date: Mon, 31 Oct 2022 15:14:05 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Refer https://elixir.bootlin.com/linux/v6.1-rc1/source/arch/arm64/ \
include/asm/cputype.h#L14 , for the macros specific for arm64.

Refer https://elixir.bootlin.com/linux/v6.1-rc1/source/arch/arm/include/ \
asm/cputype.h#L54  , for the macros specific for arm32.

MPIDR_LEVEL_SHIFT() differs between 64 and 32 bit.
For 64 bit :-

 aff_lev3          aff_lev2 aff_lev1 aff_lev0
|________|________|________|________|________|
40       32       24       16       8        0

For 32 bit :-

 aff_lev3 aff_lev2 aff_lev1 aff_lev0
|________|________|________|________|
32       24       16       8        0

Signed-off-by: Ayan Kumar Halder <ayankuma@xxxxxxx>
---

Changes from :-
v1 - 1. Rearranged the macro defines so that the common code (between arm32
and arm64) is placed in "arm/include/asm/processor.h".

 xen/arch/arm/include/asm/arm32/processor.h | 5 +++++
 xen/arch/arm/include/asm/arm64/processor.h | 8 ++++++++
 xen/arch/arm/include/asm/processor.h       | 6 ------
 3 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/include/asm/arm32/processor.h 
b/xen/arch/arm/include/asm/arm32/processor.h
index 4e679f3273..82aa7f8d9d 100644
--- a/xen/arch/arm/include/asm/arm32/processor.h
+++ b/xen/arch/arm/include/asm/arm32/processor.h
@@ -56,6 +56,11 @@ struct cpu_user_regs
     uint32_t pad1; /* Doubleword-align the user half of the frame */
 };
 
+/*
+ * Macros to extract affinity level. Picked from kernel
+ */
+#define MPIDR_LEVEL_SHIFT(level) (MPIDR_LEVEL_BITS * (level))
+
 #endif
 
 #endif /* __ASM_ARM_ARM32_PROCESSOR_H */
diff --git a/xen/arch/arm/include/asm/arm64/processor.h 
b/xen/arch/arm/include/asm/arm64/processor.h
index c749f80ad9..295483a9dd 100644
--- a/xen/arch/arm/include/asm/arm64/processor.h
+++ b/xen/arch/arm/include/asm/arm64/processor.h
@@ -84,6 +84,14 @@ struct cpu_user_regs
     uint64_t sp_el1, elr_el1;
 };
 
+/*
+ * Macros to extract affinity level. picked from kernel
+ */
+#define MPIDR_LEVEL_BITS_SHIFT  3
+
+#define MPIDR_LEVEL_SHIFT(level) \
+         (((1 << (level)) >> 1) << MPIDR_LEVEL_BITS_SHIFT)
+
 #undef __DECL_REG
 
 #endif /* __ASSEMBLY__ */
diff --git a/xen/arch/arm/include/asm/processor.h 
b/xen/arch/arm/include/asm/processor.h
index 1dd81d7d52..ecfb62bbbe 100644
--- a/xen/arch/arm/include/asm/processor.h
+++ b/xen/arch/arm/include/asm/processor.h
@@ -122,13 +122,7 @@
 /*
  * Macros to extract affinity level. picked from kernel
  */
-
-#define MPIDR_LEVEL_BITS_SHIFT  3
 #define MPIDR_LEVEL_MASK        ((1 << MPIDR_LEVEL_BITS) - 1)
-
-#define MPIDR_LEVEL_SHIFT(level) \
-         (((1 << (level)) >> 1) << MPIDR_LEVEL_BITS_SHIFT)
-
 #define MPIDR_AFFINITY_LEVEL(mpidr, level) \
          (((mpidr) >> MPIDR_LEVEL_SHIFT(level)) & MPIDR_LEVEL_MASK)
 
-- 
2.17.1




 


Rackspace

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