From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50435) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0WVO-0003ge-Sv for qemu-devel@nongnu.org; Fri, 27 Jun 2014 09:48:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0WVE-0005l9-DB for qemu-devel@nongnu.org; Fri, 27 Jun 2014 09:47:54 -0400 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:50252) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0WVE-0005kV-3c for qemu-devel@nongnu.org; Fri, 27 Jun 2014 09:47:44 -0400 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 27 Jun 2014 14:47:41 +0100 From: Laurent Dufour Date: Fri, 27 Jun 2014 15:47:37 +0200 Message-ID: <20140627134737.26170.27909.stgit@nimbus> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] target-ppc: KVMPPC_H_CAS fix cpu-version endianess List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, Alexander Graf 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 --- hw/ppc/spapr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 82f183f173ee..85e9f4a74933 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -228,8 +228,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; }