Skip to content

Commit

Permalink
spapr: Fix support of POWER5+ processors
Browse files Browse the repository at this point in the history
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 <clg@kaod.org>
Tested-by: Fabiano Rosas <farosas@linux.ibm.com>
Message-Id: <20220105095142.3990430-3-clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
  • Loading branch information
legoater committed Jan 12, 2022
1 parent 23ab6d8 commit 2460e1d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions hw/ppc/spapr.c
Expand Up @@ -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
Expand Down

0 comments on commit 2460e1d

Please sign in to comment.