From patchwork Thu Feb 3 21:54:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 81763 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AEC64B70E9 for ; Fri, 4 Feb 2011 11:23:11 +1100 (EST) Received: from localhost ([127.0.0.1]:47033 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pl7Fo-0007Il-3p for incoming@patchwork.ozlabs.org; Thu, 03 Feb 2011 17:02:16 -0500 Received: from [140.186.70.92] (port=48845 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pl78c-00056E-QD for qemu-devel@nongnu.org; Thu, 03 Feb 2011 16:54:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pl789-0007J4-50 for qemu-devel@nongnu.org; Thu, 03 Feb 2011 16:54:22 -0500 Received: from fmmailgate02.web.de ([217.72.192.227]:58619) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pl788-0007Ic-Ux for qemu-devel@nongnu.org; Thu, 03 Feb 2011 16:54:21 -0500 Received: from smtp05.web.de ( [172.20.4.166]) by fmmailgate02.web.de (Postfix) with ESMTP id 08D2E19625889; Thu, 3 Feb 2011 22:54:20 +0100 (CET) Received: from [92.75.142.139] (helo=localhost.localdomain) by smtp05.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #2) id 1Pl787-0008TA-02; Thu, 03 Feb 2011 22:54:19 +0100 From: Jan Kiszka To: qemu-devel@nongnu.org, Anthony Liguori Date: Thu, 3 Feb 2011 22:54:12 +0100 Message-Id: X-Mailer: git-send-email 1.7.1 In-Reply-To: References: In-Reply-To: References: X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX1/FbKIBngoGMnCxWOjIoQONi+MuCdSEW6EPQFS0 zaTKhCLynKwGewiyl8Ko2JbRLrcbJX0Z7r9RIJlTC186fKTmBX NQu/YODB0= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 217.72.192.227 Cc: kvm@vger.kernel.org, Gleb Natapov , Marcelo Tosatti , Alexander Graf , Blue Swirl , Avi Kivity Subject: [Qemu-devel] [0.14?][PATCH v3 2/4] ioapic: Save/restore irr X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jan Kiszka This is a guest modifiable state that must be saved/restored properly. Signed-off-by: Jan Kiszka --- hw/ioapic.c | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/hw/ioapic.c b/hw/ioapic.c index 8bc31f7..8c46c1d 100644 --- a/hw/ioapic.c +++ b/hw/ioapic.c @@ -231,14 +231,27 @@ static void ioapic_mem_writel(void *opaque, target_phys_addr_t addr, uint32_t va } } +static int ioapic_post_load(void *opaque, int version_id) +{ + IOAPICState *s = opaque; + + if (version_id == 1) { + /* set sane value */ + s->irr = 0; + } + return 0; +} + static const VMStateDescription vmstate_ioapic = { .name = "ioapic", - .version_id = 1, + .version_id = 2, + .post_load = ioapic_post_load, .minimum_version_id = 1, .minimum_version_id_old = 1, .fields = (VMStateField []) { VMSTATE_UINT8(id, IOAPICState), VMSTATE_UINT8(ioregsel, IOAPICState), + VMSTATE_UINT32_V(irr, IOAPICState, 2), VMSTATE_UINT64_ARRAY(ioredtbl, IOAPICState, IOAPIC_NUM_PINS), VMSTATE_END_OF_LIST() }