diff options
author | Laurent Dufour <ldufour@linux.vnet.ibm.com> | 2014-06-27 15:47:37 +0200 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2014-07-08 12:10:36 +0200 |
commit | 4bce526ec4b88362a684fd858e0e14c83ddf0db4 (patch) | |
tree | 6b78fa03af2c375b955f795cf043463cdc858e32 | |
parent | 128f0e66149afb2dfc325dfd183aac345f417763 (diff) |
target-ppc: KVMPPC_H_CAS fix cpu-version endianess
During KVMPPC_H_CAS processing, the cpu-version updated value is stored
without taking care of the current endianess. As a consequence, the guest
may not switch to the right CPU model, leading to unexpected results.
If needed, the value is now converted.
Fixes: 6d9412ea8132 ("target-ppc: Implement "compat" CPU option")
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Reviewed-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
-rw-r--r-- | hw/ppc/spapr.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index a8ba916970..a23c0f080e 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -160,8 +160,7 @@ static int spapr_fixup_cpu_smt_dt(void *fdt, int offset, PowerPCCPU *cpu, int index = ppc_get_vcpu_dt_id(cpu); if (cpu->cpu_version) { - ret = fdt_setprop(fdt, offset, "cpu-version", - &cpu->cpu_version, sizeof(cpu->cpu_version)); + ret = fdt_setprop_cell(fdt, offset, "cpu-version", cpu->cpu_version); if (ret < 0) { return ret; } |