Skip to contentSkip to conversation

ARM/ARM64: Move cpu_logical_map[] to smp.h

PATCH In review Florian Fainelli 3 participants 7 messages Jun 3, 2019 – Jun 21, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover ARM/ARM64: Move cpu_logical_map[] to smp.h

Hi all,

These two patches make ARM and ARM64 consistent with other
architectures: sh, sparc, xtensa, mips, etc. to define cpu_logical_map under asm/smp.h, which is included by linux/smp.h. This allows other pieces of code like irqchip drivers to get access to cpu_logical_map[] using linux/smp.h.

Changes in v2:

- just move __cpu_logical_map[]/cpu_logical_map[] to smp.h

Florian Fainelli (2):
arm64: smp: Moved cpu_logical_map[] to smp.h
ARM: smp: Moved cpu_logical_map[] to smp.h

 arch/arm/include/asm/smp.h        | 6 ++++++
 arch/arm/include/asm/smp_plat.h   | 5 -----
 arch/arm64/include/asm/smp.h      | 6 ++++++
 arch/arm64/include/asm/smp_plat.h | 5 -----
 4 files changed, 12 insertions(+), 10 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/2 arm64: smp: Moved cpu_logical_map[] to smp.h

asm/smp.h is included by linux/smp.h and some drivers, in particular irqchip drivers can access cpu_logical_map[] in order to perform SMP affinity tasks. Make arm64 consistent with other architectures here.

---
 arch/arm64/include/asm/smp.h      | 6 ++++++
 arch/arm64/include/asm/smp_plat.h | 5 -----
 2 files changed, 6 insertions(+), 5 deletions(-)
arch/arm64/include/asm/smp.h +6 -0
index 18553f399e08..eae2d6c01262 100644
@@ -53,6 +53,12 @@ DECLARE_PER_CPU_READ_MOSTLY(int, cpu_number);
  */
 #define raw_smp_processor_id() (*raw_cpu_ptr(&cpu_number))
 
+/*
+ * Logical CPU mapping.
+ */
+extern u64 __cpu_logical_map[NR_CPUS];
+#define cpu_logical_map(cpu)    __cpu_logical_map[cpu]
+
 struct seq_file;
 
 /*
arch/arm64/include/asm/smp_plat.h +0 -5
index af58dcdefb21..7a495403a18a 100644
@@ -36,11 +36,6 @@ static inline u32 mpidr_hash_size(void)
 	return 1 << mpidr_hash.bits;
 }
 
-/*
- * Logical CPU mapping.
- */
-extern u64 __cpu_logical_map[NR_CPUS];
-#define cpu_logical_map(cpu)    __cpu_logical_map[cpu]
 /*
  * Retrieve logical cpu index corresponding to a given MPIDR.Aff*
  *  - mpidr: MPIDR.Aff* bits to be used for the look-up
Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH v2 1/2] arm64: smp: Moved cpu_logical_map[] to smp.h

Quoted 9 lines · Florian Fainelli

asm/smp.h is included by linux/smp.h and some drivers, in particular irqchip drivers can access cpu_logical_map[] in order to perform SMP affinity tasks. Make arm64 consistent with other architectures here.

---
 arch/arm64/include/asm/smp.h      | 6 ++++++
 arch/arm64/include/asm/smp_plat.h | 5 -----
 2 files changed, 6 insertions(+), 5 deletions(-)

Thanks. I'll grab this as a fix in an attempt to save you having to wait an extra cycle before you can rely on it.

Will

#3 lore raw

Re: [PATCH v2 1/2] arm64: smp: Moved cpu_logical_map[] to smp.h

Quoted 5 lines · Will Deacon
Quoted 4 lines · Florian Fainelli

asm/smp.h is included by linux/smp.h and some drivers, in particular irqchip drivers can access cpu_logical_map[] in order to perform SMP affinity tasks. Make arm64 consistent with other architectures here.

Quoted 8 lines
Quoted 5 lines
---
 arch/arm64/include/asm/smp.h      | 6 ++++++
 arch/arm64/include/asm/smp_plat.h | 5 -----
 2 files changed, 6 insertions(+), 5 deletions(-)

Thanks. I'll grab this as a fix in an attempt to save you having to wait an extra cycle before you can rely on it.

Saw those in v5.3-rc4, thanks a lot!

Russell I dropped those in your patch tracker:

https://www.armlinux.org.uk/developer/patches/viewpatch.php?id=8866/1

Signature · 1 line
Florian
#4 lore raw

PATCH v2 2/2 ARM: smp: Moved cpu_logical_map[] to smp.h

In reply to Florian Fainelli

asm/smp.h is included by linux/smp.h and some drivers, in particular irqchip drivers can access cpu_logical_map[] in order to perform SMP affinity tasks. Make arm64 consistent with other architectures here.

---
 arch/arm/include/asm/smp.h      | 6 ++++++
 arch/arm/include/asm/smp_plat.h | 5 -----
 2 files changed, 6 insertions(+), 5 deletions(-)
arch/arm/include/asm/smp.h +6 -0
index 451ae684aaf4..112d78e82f35 100644
@@ -20,6 +20,12 @@
 
 #define raw_smp_processor_id() (current_thread_info()->cpu)
 
+/*
+ * Logical CPU mapping.
+ */
+extern u32 __cpu_logical_map[];
+#define cpu_logical_map(cpu)	__cpu_logical_map[cpu]
+
 struct seq_file;
 
 /*
arch/arm/include/asm/smp_plat.h +0 -5
index f2c36acf9886..ca6b91d400cf 100644
@@ -66,11 +66,6 @@ static inline int cache_ops_need_broadcast(void)
 }
 #endif
 
-/*
- * Logical CPU mapping.
- */
-extern u32 __cpu_logical_map[];
-#define cpu_logical_map(cpu)	__cpu_logical_map[cpu]
 /*
  * Retrieve logical cpu index corresponding to a given MPIDR[23:0]
  *  - mpidr: MPIDR[23:0] to be used for the look-up
Signature · 1 line
2.17.1
#5 lore raw

Re: [PATCH v2 2/2] ARM: smp: Moved cpu_logical_map[] to smp.h

Quoted 5 lines · Florian Fainelli

asm/smp.h is included by linux/smp.h and some drivers, in particular irqchip drivers can access cpu_logical_map[] in order to perform SMP affinity tasks. Make arm64 consistent with other architectures here.

I merged this last night, and it causes ojn's builder to fail 98 defconfigs with errors like:

arch/arm/include/asm/smp_plat.h:79:7: error: implicit declaration of function 'cpu_logical_map' [-Werror=implicit-function-declaration] arch/arm/kernel/setup.c:594:21: error: lvalue required as left operand of assignment arch/arm/kernel/setup.c:596:22: error: lvalue required as left operand of assignment

Dropping this patch.

Also, you may wish to make the patch description refer to the correct architecture.

Quoted 47 lines
---
 arch/arm/include/asm/smp.h      | 6 ++++++
 arch/arm/include/asm/smp_plat.h | 5 -----
 2 files changed, 6 insertions(+), 5 deletions(-)
arch/arm/include/asm/smp.h +6 -0
index 451ae684aaf4..112d78e82f35 100644
@@ -20,6 +20,12 @@
 
 #define raw_smp_processor_id() (current_thread_info()->cpu)
 
+/*
+ * Logical CPU mapping.
+ */
+extern u32 __cpu_logical_map[];
+#define cpu_logical_map(cpu)	__cpu_logical_map[cpu]
+
 struct seq_file;
 
 /*
arch/arm/include/asm/smp_plat.h +0 -5
index f2c36acf9886..ca6b91d400cf 100644
@@ -66,11 +66,6 @@ static inline int cache_ops_need_broadcast(void)
 }
 #endif
 
-/*
- * Logical CPU mapping.
- */
-extern u32 __cpu_logical_map[];
-#define cpu_logical_map(cpu)	__cpu_logical_map[cpu]
 /*
  * Retrieve logical cpu index corresponding to a given MPIDR[23:0]
  *  - mpidr: MPIDR[23:0] to be used for the look-up
Signature · 7 lines
2.17.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 3 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up
#6 lore raw

Re: [PATCH v2 2/2] ARM: smp: Moved cpu_logical_map[] to smp.h

Quoted 10 lines · Russell King - ARM Linux admin
Quoted 5 lines · Florian Fainelli

asm/smp.h is included by linux/smp.h and some drivers, in particular irqchip drivers can access cpu_logical_map[] in order to perform SMP affinity tasks. Make arm64 consistent with other architectures here.

I merged this last night, and it causes ojn's builder to fail 98 defconfigs with errors like:

Quoted 8 lines

arch/arm/include/asm/smp_plat.h:79:7: error: implicit declaration of function 'cpu_logical_map' [-Werror=implicit-function-declaration] arch/arm/kernel/setup.c:594:21: error: lvalue required as left operand of assignment arch/arm/kernel/setup.c:596:22: error: lvalue required as left operand of assignment

Dropping this patch.

Also, you may wish to make the patch description refer to the correct architecture.

Sorry about that, I will go back and revisit this patch.

Signature · 1 line
Florian