powerpc/pseries: Add POWER8NVL support to ibm,client-architecture-support call
PATCH 1/1 powerpc/pseries: Add POWER8NVL support to ibm,client-architecture-support call
If we do not provide the PVR for POWER8NVL, a guest on this system currently ends up in PowerISA 2.06 compatibility mode on KVM, since QEMU does not provide a generic PowerISA 2.07 mode yet. So some new instructions from POWER8 (like "mtvsrd") get disabled for the guest, resulting in crashes when using code compiled explicitly for POWER8 (e.g. with the "-mcpu=power8" option of GCC).
--- arch/powerpc/kernel/prom_init.c | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/kernel/prom_init.c +1 -0
@@ -656,6 +656,7 @@ unsigned char ibm_architecture_vec[] = {W (0xffff0000 ),W (0x003e0000 ),/* POWER6 */ W (0xffff0000 ),W (0x003f0000 ),/* POWER7 */ W (0xffff0000 ),W (0x004b0000 ),/* POWER8E */ +W (0xffff0000 ),W (0x004c0000 ),/* POWER8NVL */ W (0xffff0000 ),W (0x004d0000 ),/* POWER8 */ W (0xffffffff ),W (0x0f000004 ),/* all 2.07-compliant */ W(0xffffffff), W(0x0f000003), /* all 2.06-compliant */
Signature · 1 line
1.8.3.1
Michael Ellerman
reviewerQuoted 8 lines · Thomas Huth
If we do not provide the PVR for POWER8NVL, a guest on this system currently ends up in PowerISA 2.06 compatibility mode on KVM, since QEMU does not provide a generic PowerISA 2.07 mode yet. So some new instructions from POWER8 (like "mtvsrd") get disabled for the guest, resulting in crashes when using code compiled explicitly for POWER8 (e.g. with the "-mcpu=power8" option of GCC).
Signed-off-by Thomas Huth <[email protected]>
So this should say:
And therefore:
Am I right?
cheers
Quoted 12 lines
arch/powerpc/kernel/prom_init.c +1
-0@@ -656,6 +656,7 @@ unsigned char ibm_architecture_vec[] = {W (0xffff0000 ),W (0x003e0000 ),/* POWER6 */ W (0xffff0000 ),W (0x003f0000 ),/* POWER7 */ W (0xffff0000 ),W (0x004b0000 ),/* POWER8E */ +W (0xffff0000 ),W (0x004c0000 ),/* POWER8NVL */ W (0xffff0000 ),W (0x004d0000 ),/* POWER8 */ W (0xffffffff ),W (0x0f000004 ),/* all 2.07-compliant */ W(0xffffffff), W(0x0f000003), /* all 2.06-compliant */
Quoted 13 lines · Michael Ellerman
Quoted 8 lines · Thomas Huth
If we do not provide the PVR for POWER8NVL, a guest on this system currently ends up in PowerISA 2.06 compatibility mode on KVM, since QEMU does not provide a generic PowerISA 2.07 mode yet. So some new instructions from POWER8 (like "mtvsrd") get disabled for the guest, resulting in crashes when using code compiled explicitly for POWER8 (e.g. with the "-mcpu=power8" option of GCC).
Signed-off-by Thomas Huth <[email protected]>So this should say:
Quoted 7 lines
Fixes ddee09c099c3 ("powerpc: Add PVR for POWER8NVL processor")And therefore:
Cc [email protected] # v4.0+Am I right?
Right. (At least for virtualized systems ... for bare-metal systems, that original patch was enough). So shall I resubmit my patch with these two lines, or could you add them when you pick this patch up?
Thomas
Michael Ellerman
reviewerQuoted 17 lines · Thomas Huth
Quoted 16 lines · Michael Ellerman
Quoted 8 lines · Thomas Huth
If we do not provide the PVR for POWER8NVL, a guest on this system currently ends up in PowerISA 2.06 compatibility mode on KVM, since QEMU does not provide a generic PowerISA 2.07 mode yet. So some new instructions from POWER8 (like "mtvsrd") get disabled for the guest, resulting in crashes when using code compiled explicitly for POWER8 (e.g. with the "-mcpu=power8" option of GCC).
Signed-off-by Thomas Huth <[email protected]>So this should say:
Fixes ddee09c099c3 ("powerpc: Add PVR for POWER8NVL processor")And therefore:
Quoted 7 lines
Quoted 3 lines
Cc [email protected] # v4.0+Am I right?
Right. (At least for virtualized systems ... for bare-metal systems, that original patch was enough). So shall I resubmit my patch with these two lines, or could you add them when you pick this patch up?
Thanks, I'll add them here.
cheers
Quoted 20 lines · Michael Ellerman
Quoted 19 lines · Thomas Huth
Quoted 18 lines · Michael Ellerman
Quoted 8 lines · Thomas Huth
If we do not provide the PVR for POWER8NVL, a guest on this system currently ends up in PowerISA 2.06 compatibility mode on KVM, since QEMU does not provide a generic PowerISA 2.07 mode yet. So some new instructions from POWER8 (like "mtvsrd") get disabled for the guest, resulting in crashes when using code compiled explicitly for POWER8 (e.g. with the "-mcpu=power8" option of GCC).
Signed-off-by Thomas Huth <[email protected]>So this should say:
Fixes ddee09c099c3 ("powerpc: Add PVR for POWER8NVL processor")And therefore:
Cc [email protected] # v4.0+
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Am I right?
Right. (At least for virtualized systems ... for bare-metal systems, that original patch was enough). So shall I resubmit my patch with these two lines, or could you add them when you pick this patch up?
Thanks, I'll add them here.
Don't we need to update IBM_ARCH_VEC_NRCORES_OFFSET as well?
Balbir Singh
Michael Ellerman
reviewerQuoted 23 lines · Balbir Singh
Quoted 22 lines · Michael Ellerman
Quoted 21 lines · Thomas Huth
Quoted 19 lines · Michael Ellerman
Quoted 8 lines · Thomas Huth
If we do not provide the PVR for POWER8NVL, a guest on this system currently ends up in PowerISA 2.06 compatibility mode on KVM, since QEMU does not provide a generic PowerISA 2.07 mode yet. So some new instructions from POWER8 (like "mtvsrd") get disabled for the guest, resulting in crashes when using code compiled explicitly for POWER8 (e.g. with the "-mcpu=power8" option of GCC).
Signed-off-by Thomas Huth <[email protected]>So this should say:
Fixes ddee09c099c3 ("powerpc: Add PVR for POWER8NVL processor")And therefore:
Cc [email protected] # v4.0+Am I right?
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Right. (At least for virtualized systems ... for bare-metal systems, that original patch was enough). So shall I resubmit my patch with these two lines, or could you add them when you pick this patch up?
Thanks, I'll add them here.
Don't we need to update
IBM_ARCH_VEC_NRCORES_OFFSETas well?
Yep, patch sent this morning.
cheers
Quoted 28 lines · Michael Ellerman
Quoted 27 lines · Balbir Singh
Quoted 26 lines · Michael Ellerman
Quoted 24 lines · Thomas Huth
Quoted 12 lines · Michael Ellerman
Quoted 8 lines · Thomas Huth
If we do not provide the PVR for POWER8NVL, a guest on this system currently ends up in PowerISA 2.06 compatibility mode on KVM, since QEMU does not provide a generic PowerISA 2.07 mode yet. So some new instructions from POWER8 (like "mtvsrd") get disabled for the guest, resulting in crashes when using code compiled explicitly for POWER8 (e.g. with the "-mcpu=power8" option of GCC).
Signed-off-by Thomas Huth <[email protected]>So this should say:
Quoted 7 lines
Fixes ddee09c099c3 ("powerpc: Add PVR for POWER8NVL processor")And therefore:
Cc [email protected] # v4.0+Am I right?
Right. (At least for virtualized systems ... for bare-metal systems, that original patch was enough). So shall I resubmit my patch with these two lines, or could you add them when you pick this patch up?
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Thanks, I'll add them here.
Don't we need to update
IBM_ARCH_VEC_NRCORES_OFFSETas well?Yep, patch sent this morning.
Ok, looks like BenH already posted a patch ... anyway, what do you think about aborting the boot process here in case cores != NR_CPUS, rather than just printing out a small warning which can easily get lost in the kernel log?
Thomas
Michael Ellerman
reviewerQuoted 7 lines · Thomas Huth
Quoted 4 lines · Michael Ellerman
Quoted 1 line · Balbir Singh
Don't we need to update
IBM_ARCH_VEC_NRCORES_OFFSETas well?Yep, patch sent this morning.
Ok, looks like BenH already posted a patch ...
And me before him :)
To be clear I'm not blaming you in any way for this, the existing code is terrible and incredibly fragile.
Quoted 3 lines
anyway, what do you think about aborting the boot process here in case cores !=
NR_CPUS, rather than just printing out a small warning which can easily get lost in the kernel log?
Yeah I agree it's easy to miss. And it's not part of dmesg (because it's from prom_init()), so you *only* see it if you're actually staring at the console as it boots (which is why my boot tests missed it).
I actually have plans to rewrite the whole thing to make it robust, so that should avoid it ever being a problem again.
cheers
Quoted 24 lines · Balbir Singh
Quoted 22 lines · Michael Ellerman
Quoted 21 lines · Thomas Huth
Quoted 19 lines · Michael Ellerman
Quoted 8 lines · Thomas Huth
If we do not provide the PVR for POWER8NVL, a guest on this system currently ends up in PowerISA 2.06 compatibility mode on KVM, since QEMU does not provide a generic PowerISA 2.07 mode yet. So some new instructions from POWER8 (like "mtvsrd") get disabled for the guest, resulting in crashes when using code compiled explicitly for POWER8 (e.g. with the "-mcpu=power8" option of GCC).
Signed-off-by Thomas Huth <[email protected]>So this should say:
Fixes ddee09c099c3 ("powerpc: Add PVR for POWER8NVL processor")And therefore:
Cc [email protected] # v4.0+Am I right?
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Right. (At least for virtualized systems ... for bare-metal systems, that original patch was enough). So shall I resubmit my patch with these two lines, or could you add them when you pick this patch up?
Thanks, I'll add them here.
Don't we need to update
IBM_ARCH_VEC_NRCORES_OFFSETas well?
D'oh! You're right, that needs to be changed, too! I'll send a fixup patch once I've tested it...
By the way, there seems to be already a check for ibm_architecture_vec[IBM_ARCH_VEC_NRCORES_OFFSET] != NR_CPUS in prom_send_capabilities(), but it only prints out a warning which easily gets lost in the kernel log ... I wonder whether we should rather stop the boot there instead to catch this problem more easily?
Thomas
Re: powerpc/pseries: Add POWER8NVL support to ibm, client-architecture-support call
In reply to Thomas HuthQuoted 8 lines · Thomas Huth
If we do not provide the PVR for POWER8NVL, a guest on this system currently ends up in PowerISA 2.06 compatibility mode on KVM, since QEMU does not provide a generic PowerISA 2.07 mode yet. So some new instructions from POWER8 (like "mtvsrd") get disabled for the guest, resulting in crashes when using code compiled explicitly for POWER8 (e.g. with the "-mcpu=power8" option of GCC).
Signed-off-by Thomas Huth <[email protected]>
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/7cc851039d643a2ee7df4d1817
cheers