[FSL P50x0] lscpu reports wrong values since the RC1 of kernel 5.13

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

4 messages, 2 authors, 2021-08-27 · open the first message on its own page

[FSL P50x0] lscpu reports wrong values since the RC1 of kernel 5.13

From: Christian Zigotzky <hidden>
Date: 2021-08-09 12:38:38

Hi All,

Lscpu reports wrong values [1] since the RC1 of kernel 5.13 on my FSL 
P5040 Cyrus+ board (A-EON AmigaOne X5000). [2]
The differences are:

Since the RC1 of kernel 5.13 (wrong values):

Core(s) per socket: 1
Socket(s): 3

Before (correct values):

Core(s) per socket: 4
Socket(s): 1

Through the wrong values, I can't use "-smp 4" with a virtual e5500 QEMU 
machine with KVM HV anymore.  [3]
"-smp 3" works with KVM HV.

Maybe the file_load_64 commit from the PowerPC updates 5.13-2 is the 
problem ( powerpc/kexec_file: Use current CPU info while setting up 
FDT). [4]

Or maybe this change (PowerPC updates 5.13-1):

-#ifdef CONFIG_PPC_BOOK3E_64
-    state->ctx_state = exception_enter();
-    if (user_mode(regs))
-        account_cpu_user_entry();
-#endif

---

Or maybe this change (PowerPC updates 5.13-1):
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index 7a13bc20f0a0c..03b3d010cbab6 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -31,6 +31,7 @@ extern u32 *cpu_to_phys_id;
  extern bool coregroup_enabled;

  extern int cpu_to_chip_id(int cpu);
+extern int *chip_id_lookup_table;

  #ifdef CONFIG_SMP
@@ -121,6 +122,11 @@ static inline struct cpumask *cpu_sibling_mask(int cpu)
      return per_cpu(cpu_sibling_map, cpu);
  }

+static inline struct cpumask *cpu_core_mask(int cpu)
+{
+    return per_cpu(cpu_core_map, cpu);
+}
+
  static inline struct cpumask *cpu_l2_cache_mask(int cpu)
  {
      return per_cpu(cpu_l2_cache_map, cpu);

---
I have found a lot of other changes in the PowerPC updates 5.13-1 
regarding the CPU.

Could you please check the CPU changes in the PowerPC updates 5.13-1 and 
5.13-2?

Please find attached the kernel 5.14-rc5 config.

Thanks,
Christian


[1]

lscpu with the correct values before the RC1 of kernel 5.13:

Architecture: ppc64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Big Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
Model: 1.2 (pvr 8024 0012)
Model name: e5500
L1d cache: 128 KiB
L1i cache: 128 KiB
L2 cache: 2 MiB
L3 cache: 2 MiB
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Spec store bypass: Not affected
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Branch predictor state flush
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected

---

lscpu with the wrong values since the RC1 of kernel 5.13:

Architecture: ppc64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Big Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 3
Model: 1.2 (pvr 8024 0012)
Model name: e5500
L1d cache: 128 KiB
L1i cache: 128 KiB
L2 cache: 2 MiB
L3 cache: 2 MiB
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Spec store bypass: Not affected
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Branch predictor state flush
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected

---

[2] http://wiki.amiga.org/index.php?title=X5000

[3] https://lists.ozlabs.org/pipermail/linuxppc-dev/2021-May/229103.html

[4] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/diff/arch/powerpc/kexec/file_load_64.c?id=ab159ac569fddf812c0a217d6dbffaa5d93ef88f

Re: [FSL P50x0] lscpu reports wrong values since the RC1 of kernel 5.13

From: Christian Zigotzky <hidden>
Date: 2021-08-16 12:30:16

Hi All,

I tested the RC6 of kernel 5.14 today and unfortunately the issue still 
exists. We have figured out that only P5040 SoCs are affected. [1]
P5020 SoCs display the correct values.
Please check the CPU changes in the PowerPC updates 5.13-1 and 5.13-2.

Thanks,
Christian

[1] https://forum.hyperion-entertainment.com/viewtopic.php?p=53775#p53775


On 09 August 2021 um 02:37 pm, Christian Zigotzky wrote:
quoted hunk
Hi All,

Lscpu reports wrong values [1] since the RC1 of kernel 5.13 on my FSL 
P5040 Cyrus+ board (A-EON AmigaOne X5000). [2]
The differences are:

Since the RC1 of kernel 5.13 (wrong values):

Core(s) per socket: 1
Socket(s): 3

Before (correct values):

Core(s) per socket: 4
Socket(s): 1

Through the wrong values, I can't use "-smp 4" with a virtual e5500 
QEMU machine with KVM HV anymore.  [3]
"-smp 3" works with KVM HV.

Maybe the file_load_64 commit from the PowerPC updates 5.13-2 is the 
problem ( powerpc/kexec_file: Use current CPU info while setting up 
FDT). [4]

Or maybe this change (PowerPC updates 5.13-1):

-#ifdef CONFIG_PPC_BOOK3E_64
-    state->ctx_state = exception_enter();
-    if (user_mode(regs))
-        account_cpu_user_entry();
-#endif

---

Or maybe this change (PowerPC updates 5.13-1):
diff --git a/arch/powerpc/include/asm/smp.h 
b/arch/powerpc/include/asm/smp.h
index 7a13bc20f0a0c..03b3d010cbab6 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -31,6 +31,7 @@ extern u32 *cpu_to_phys_id;
 extern bool coregroup_enabled;

 extern int cpu_to_chip_id(int cpu);
+extern int *chip_id_lookup_table;

 #ifdef CONFIG_SMP
@@ -121,6 +122,11 @@ static inline struct cpumask 
*cpu_sibling_mask(int cpu)
     return per_cpu(cpu_sibling_map, cpu);
 }

+static inline struct cpumask *cpu_core_mask(int cpu)
+{
+    return per_cpu(cpu_core_map, cpu);
+}
+
 static inline struct cpumask *cpu_l2_cache_mask(int cpu)
 {
     return per_cpu(cpu_l2_cache_map, cpu);

---

I have found a lot of other changes in the PowerPC updates 5.13-1 
regarding the CPU.

Could you please check the CPU changes in the PowerPC updates 5.13-1 
and 5.13-2?

Please find attached the kernel 5.14-rc5 config.

Thanks,
Christian


[1]

lscpu with the correct values before the RC1 of kernel 5.13:

Architecture: ppc64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Big Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
Model: 1.2 (pvr 8024 0012)
Model name: e5500
L1d cache: 128 KiB
L1i cache: 128 KiB
L2 cache: 2 MiB
L3 cache: 2 MiB
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Spec store bypass: Not affected
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Branch predictor state flush
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected

---

lscpu with the wrong values since the RC1 of kernel 5.13:

Architecture: ppc64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Big Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 3
Model: 1.2 (pvr 8024 0012)
Model name: e5500
L1d cache: 128 KiB
L1i cache: 128 KiB
L2 cache: 2 MiB
L3 cache: 2 MiB
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Spec store bypass: Not affected
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Branch predictor state flush
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected

---

[2] http://wiki.amiga.org/index.php?title=X5000

[3] https://lists.ozlabs.org/pipermail/linuxppc-dev/2021-May/229103.html

[4] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/diff/arch/powerpc/kexec/file_load_64.c?id=ab159ac569fddf812c0a217d6dbffaa5d93ef88f

Re: [FSL P50x0] lscpu reports wrong values since the RC1 of kernel 5.13

From: Srikar Dronamraju <hidden>
Date: 2021-08-26 03:44:18

* Christian Zigotzky [off-list ref] [2021-08-16 14:29:21]:


Hi Christian,
I tested the RC6 of kernel 5.14 today and unfortunately the issue still
exists. We have figured out that only P5040 SoCs are affected. [1]
P5020 SoCs display the correct values.
Please check the CPU changes in the PowerPC updates 5.13-1 and 5.13-2.
Thanks for reporting the issue.
Would it be possible to try
https://lore.kernel.org/linuxppc-dev/20210821092419.167454-3-srikar@linux.vnet.ibm.com/t/#u

If the above patch is not helping, then can you please collect the output of

cat /sys/devices/system/cpu/cpu*/topology/core_siblings

Were all the CPUs online at the time of boot?
Did we do any CPU online/offline operations post boot?

If we did CPU online/offline, can you capture the output just after the
boot along with lscpu output..

Since this is being seen on few SOCs, can you summarize the difference
between P5040 and P5020.
[1] https://forum.hyperion-entertainment.com/viewtopic.php?p=53775#p53775


On 09 August 2021 um 02:37 pm, Christian Zigotzky wrote:
quoted
Hi All,

Lscpu reports wrong values [1] since the RC1 of kernel 5.13 on my FSL
P5040 Cyrus+ board (A-EON AmigaOne X5000). [2]
The differences are:

Since the RC1 of kernel 5.13 (wrong values):

Core(s) per socket: 1
Socket(s): 3
I know that the socket count was off by 1, but I cant explain how its off by
2 here.
quoted
Before (correct values):

Core(s) per socket: 4
Socket(s): 1
-- 
Thanks and Regards
Srikar Dronamraju

Re: [FSL P50x0] lscpu reports wrong values since the RC1 of kernel 5.13

From: Christian Zigotzky <hidden>
Date: 2021-08-27 18:37:09

On 26. Aug 2021, at 05:43, Srikar Dronamraju [off-list ref] wrote:

* Christian Zigotzky [off-list ref] [2021-08-16 14:29:21]:


Hi Christian,
quoted
I tested the RC6 of kernel 5.14 today and unfortunately the issue still
exists. We have figured out that only P5040 SoCs are affected. [1]
P5020 SoCs display the correct values.
Please check the CPU changes in the PowerPC updates 5.13-1 and 5.13-2.
Thanks for reporting the issue.
Would it be possible to try
https://lore.kernel.org/linuxppc-dev/20210821092419.167454-3-srikar@linux.vnet.ibm.com/t/#u
Hi Srikar,

This patch works! Thanks a lot!

Cheers,
Christian
If the above patch is not helping, then can you please collect the output of

cat /sys/devices/system/cpu/cpu*/topology/core_siblings

Were all the CPUs online at the time of boot?
Did we do any CPU online/offline operations post boot?

If we did CPU online/offline, can you capture the output just after the
boot along with lscpu output..

Since this is being seen on few SOCs, can you summarize the difference
between P5040 and P5020.
quoted
[1] https://forum.hyperion-entertainment.com/viewtopic.php?p=53775#p53775

quoted
On 09 August 2021 um 02:37 pm, Christian Zigotzky wrote:
Hi All,

Lscpu reports wrong values [1] since the RC1 of kernel 5.13 on my FSL
P5040 Cyrus+ board (A-EON AmigaOne X5000). [2]
The differences are:

Since the RC1 of kernel 5.13 (wrong values):

Core(s) per socket: 1
Socket(s): 3
I know that the socket count was off by 1, but I cant explain how its off by
2 here.
quoted
quoted
Before (correct values):

Core(s) per socket: 4
Socket(s): 1
-- 
Thanks and Regards
Srikar Dronamraju

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help