From patchwork Wed Jan 21 16:01:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 431537 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8500C140297 for ; Thu, 22 Jan 2015 03:08:20 +1100 (AEDT) Received: from localhost ([::1]:48969 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDxpK-0003vi-K1 for incoming@patchwork.ozlabs.org; Wed, 21 Jan 2015 11:08:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDxjK-0002SW-Bm for qemu-devel@nongnu.org; Wed, 21 Jan 2015 11:02:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YDxjE-0005Xn-D3 for qemu-devel@nongnu.org; Wed, 21 Jan 2015 11:02:06 -0500 Received: from s16892447.onlinehome-server.info ([82.165.15.123]:55934) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDxjE-0005Xf-6V; Wed, 21 Jan 2015 11:02:00 -0500 Received: from 5ec2da75.skybroadband.com ([94.194.218.117] helo=kentang.lan) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1YDxjC-0007vI-PK; Wed, 21 Jan 2015 16:01:59 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, agraf@suse.de Date: Wed, 21 Jan 2015 16:01:12 +0000 Message-Id: <1421856072-25026-8-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1421856072-25026-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1421856072-25026-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 94.194.218.117 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCHv2 7/7] openpic: fix up loadvm under -M mac99 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Issuing loadvm under -M mac99 would fail for two reasons: firstly an incorrect version number for openpic would cause openpic_load() to abort, and secondly a cut/paste error when restoring the IVPR and IDR registers caused subsequent vmstate sections to become misaligned and abort early. Signed-off-by: Mark Cave-Ayland --- hw/intc/openpic.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/intc/openpic.c b/hw/intc/openpic.c index 8699a4a..4194cef 100644 --- a/hw/intc/openpic.c +++ b/hw/intc/openpic.c @@ -1366,7 +1366,7 @@ static int openpic_load(QEMUFile* f, void *opaque, int version_id) OpenPICState *opp = (OpenPICState *)opaque; unsigned int i, nb_cpus; - if (version_id != 1) { + if (version_id != 2) { return -EINVAL; } @@ -1399,12 +1399,10 @@ static int openpic_load(QEMUFile* f, void *opaque, int version_id) uint32_t val; val = qemu_get_be32(f); - write_IRQreg_idr(opp, i, val); - val = qemu_get_be32(f); write_IRQreg_ivpr(opp, i, val); + val = qemu_get_be32(f); + write_IRQreg_idr(opp, i, val); - qemu_get_be32s(f, &opp->src[i].ivpr); - qemu_get_be32s(f, &opp->src[i].idr); qemu_get_be32s(f, &opp->src[i].destmask); qemu_get_sbe32s(f, &opp->src[i].last_cpu); qemu_get_sbe32s(f, &opp->src[i].pending);