From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4SVm-0001cP-OO for qemu-devel@nongnu.org; Tue, 08 Jul 2014 06:20:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4SVX-0007p9-Dl for qemu-devel@nongnu.org; Tue, 08 Jul 2014 06:20:33 -0400 From: Alexander Graf Date: Tue, 8 Jul 2014 12:20:11 +0200 Message-Id: <1404814818-15101-2-git-send-email-agraf@suse.de> In-Reply-To: <1404814818-15101-1-git-send-email-agraf@suse.de> References: <1404814818-15101-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PULL 1/8] target-ppc: KVMPPC_H_CAS fix cpu-version endianess List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: Laurent Dufour , qemu-ppc@nongnu.org, qemu-devel@nongnu.org From: Laurent Dufour 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 Reviewed-by: Greg Kurz Signed-off-by: Alexander Graf --- 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 a8ba916..a23c0f0 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; } -- 1.8.1.4