spapr: Fix support of POWER5+ processors
cover spapr: Fix support of POWER5+ processors
Hello,
Grab the images under :
and run with :
qemu-system-ppc64 -M pseries -cpu POWER5+ -m 1G -smp 2 -kernel ./vmlinux -append "root=/dev/sda" -drive file=./rootfs.ext2,if=scsi,index=0,format=raw -device spapr-vlan,netdev=net0 -netdev user,id=net0 -serial mon:stdio -nographic -nodefaults
CPU 970, 970MP are also well supported.
Virtio devices and USB should be avoided because SLOF would use a 'stdbrx' instruction (cpu_to_le64 helper) which is invalid under POWER5+ and 970 CPUs. SLOF needs to be compiled with -mcpu=power5 to fix this issue.
Thanks,
C.
Cédric Le Goater (2):
target/ppc: Add popcntb instruction to POWER5+ processors
spapr: Fix support of POWER5+ processors
hw/ppc/spapr.c | 10 ++++++---- target/ppc/cpu_init.c | 1 + 2 files changed, 7 insertions(+), 4 deletions(-)
Signature · 1 line
2.31.1
PATCH 1/2 target/ppc: Add popcntb instruction to POWER5+ processors
popcntb instruction was added in ISA v2.02. Add support for POWER5+ processors since they implement ISA v2.03.
PPC970 CPUs implement v2.01 and do not support popcntb.
--- target/ppc/cpu_init.c | 1 + 1 file changed, 1 insertion(+)
target/ppc/cpu_init.c +1 -0
@@ -6957,6 +6957,7 @@ POWERPC_FAMILY(POWER5P)(ObjectClass *oc, void *data)PPC_MEM_SYNC |PPC_MEM_EIEIO |PPC_MEM_TLBIE |PPC_MEM_TLBSYNC |PPC_64B | +PPC_POPCNTB |PPC_SEGMENT_64B |PPC_SLBI ; pcc->insns_flags2 =PPC2_FP_CVT_S64 ; pcc->msr_mask = (1ull << MSR_SF) |
Signature · 1 line
2.31.1
Re: [PATCH 1/2] target/ppc: Add popcntb instruction to POWER5+ processors
Quoted 6 lines · Cédric Le Goater
popcntb instruction was added in ISA v2.02. Add support for POWER5+ processors since they implement ISA v2.03.
PPC970 CPUs implement v2.01 and do not support popcntb.
Signed-off-by Cédric Le Goater <[email protected]>
PATCH 2/2 spapr: Fix support of POWER5+ processors
In reply to Cédric Le GoaterPOWER5+ (ISA v2.03) processors are supported by the pseries machine but they do not have Altivec instructions. Do not advertise support for it in the DT.
To be noted that this test is in contradiction with the assert in cap_vsx_apply().
--- hw/ppc/spapr.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
hw/ppc/spapr.c +6 -4
@@ -723,10 +723,12 @@ static void spapr_dt_cpu(CPUState *cs, void *fdt, int offset,* * Only CPUs for which we create core types in spapr_cpu_core.c * are possible, and all of those have VMX */ -if (spapr_get_cap (spapr,SPAPR_CAP_VSX ) !=0 ) { -_FDT ((fdt_setprop_cell (fdt, offset,"ibm,vmx" ,2 ))); - }else { -_FDT ((fdt_setprop_cell (fdt, offset,"ibm,vmx" ,1 ))); +if (env->insns_flags &PPC_ALTIVEC ) { +if (spapr_get_cap (spapr,SPAPR_CAP_VSX ) !=0 ) { +_FDT ((fdt_setprop_cell (fdt, offset,"ibm,vmx" ,2 ))); + }else { +_FDT ((fdt_setprop_cell (fdt, offset,"ibm,vmx" ,1 ))); + } }/* Advertise DFP (Decimal Floating Point) if available
Signature · 1 line
2.31.1
Quoted 8 lines · Cédric Le Goater
POWER5+ (ISA v2.03) processors are supported by the pseries machine but they do not have Altivec instructions. Do not advertise support for it in the DT.
To be noted that this test is in contradiction with the assert in
cap_vsx_apply().Signed-off-by Cédric Le Goater <[email protected]>
Cédric Le Goater
AppliedQuoted 21 lines · Cédric Le Goater
Hello,
Grab the images under :
https://github.com/legoater/qemu-ppc-boot/tree/main/buildroot/qemu_ppc64_pseries_p5p-2021.11-730-g4f325ce788-20220104and run with :
qemu-system-ppc64 -M pseries -cpu POWER5+ -m 1G -smp 2 -kernel ./vmlinux -append "root=/dev/sda" -drive file=./rootfs.ext2,if=scsi,index=0,format=raw -device spapr-vlan,netdev=net0 -netdev user,id=net0 -serial mon:stdio -nographic -nodefaults
CPU 970, 970MP are also well supported.
Virtio devices and USB should be avoided because SLOF would use a 'stdbrx' instruction (
cpu_to_le64helper) which is invalid under POWER5+ and 970 CPUs. SLOF needs to be compiled with -mcpu=power5 to fix this issue.Thanks,
C.
Quoted 8 lines
Cédric Le Goater (2):
target/ppc: Add popcntb instruction to POWER5+ processors
spapr: Fix support of POWER5+ processorshw/ppc/spapr.c | 10 ++++++---- target/ppc/cpu_init.c | 1 + 2 files changed, 7 insertions(+), 4 deletions(-)
Applied to ppc7.0.
Thanks,
C.