Skip to contentSkip to conversation

powerpc: Fix IBM_ARCH_VEC_NRCORES_OFFSET value

PATCH In review Benjamin Herrenschmidt 2 participants 2 messages Jun 7, 2016 – Jun 8, 2016 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Fix IBM_ARCH_VEC_NRCORES_OFFSET value

Commit 7cc851039d643a2ee7df4d18177150f2c3a484f5
"powerpc/pseries: Add POWER8NVL support to ibm,client-architecture-support call" introduced a regression by adding fields to the beginning of the ibm_architecture_vec structure without updating IBM_ARCH_VEC_NRCORES_OFFSET.

This causes the kernel to print a warning at boot and to fail to adjust the number of cores based on the number of threads before doing the CAS call to firmware.

This is quite a fragile piece of code sadly, we should try to find a way to avoid that hard coded offset at some point, but for now this fixes it.

---

arch/powerpc/kernel/prom_init.c +0 -0
index ccd2037..6ee4b72 100644
@@ -719,7 +719,7 @@ unsigned char ibm_architecture_vec[] = {

   * must match by the macro below. Update the definition if
   * the structure layout changes.
   */
-#define IBM_ARCH_VEC_NRCORES_OFFSET 125
+#define IBM_ARCH_VEC_NRCORES_OFFSET 133
  W(NR_CPUS), /* number of cores supported */
  0,
  0,

Reviewed-by on v1 1/1
#1 lore raw
Quoted 20 lines · Benjamin Herrenschmidt

Commit 7cc851039d643a2ee7df4d18177150f2c3a484f5
"powerpc/pseries: Add POWER8NVL support to ibm,client-architecture-support call" introduced a regression by adding fields to the beginning of the ibm_architecture_vec structure without updating IBM_ARCH_VEC_NRCORES_OFFSET.

This causes the kernel to print a warning at boot and to fail to adjust the number of cores based on the number of threads before doing the CAS call to firmware.

This is quite a fragile piece of code sadly, we should try to find a way to avoid that hard coded offset at some point, but for now this fixes it.

---

arch/powerpc/kernel/prom_init.c +0 -0
index ccd2037..6ee4b72 100644

arch/powerpc/kernel/prom_init.c unsigned char ibm_architecture_vec[] = { · line 725

Quoted 8 lines
arch/powerpc/kernel/prom_init.c +1 -1
@@ -719,7 +719,7 @@ unsigned char ibm_architecture_vec[] = {
 	 * must match by the macro below. Update the definition if
 	 * the structure layout changes.
 	 */
-#define IBM_ARCH_VEC_NRCORES_OFFSET	125
+#define IBM_ARCH_VEC_NRCORES_OFFSET	133
 	W(NR_CPUS),			/* number of cores supported */
 	0,
 	0,

Yes, that should be the right offset now!

Please also add "Cc: [email protected] # v4.0+" to the patch since the commit 7cc851039d64 did have that as well.

And sorry for breaking this!