From patchwork Tue Dec 8 16:54:55 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 40647 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 0FA50B6F19 for ; Wed, 9 Dec 2009 03:57:35 +1100 (EST) Received: from localhost ([127.0.0.1]:59087 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NI3NU-0000Vm-3v for incoming@patchwork.ozlabs.org; Tue, 08 Dec 2009 11:57:32 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NI3LA-0007Ev-8L for qemu-devel@nongnu.org; Tue, 08 Dec 2009 11:55:08 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NI3L5-0007Ae-8O for qemu-devel@nongnu.org; Tue, 08 Dec 2009 11:55:07 -0500 Received: from [199.232.76.173] (port=50063 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NI3L5-0007AN-2E for qemu-devel@nongnu.org; Tue, 08 Dec 2009 11:55:03 -0500 Received: from thoth.sbs.de ([192.35.17.2]:16768) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NI3L4-0006ev-97 for qemu-devel@nongnu.org; Tue, 08 Dec 2009 11:55:02 -0500 Received: from mail3.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id nB8GstIn031011; Tue, 8 Dec 2009 17:54:55 +0100 Received: from [139.25.109.167] (mchn012c.mchp.siemens.de [139.25.109.167] (may be forged)) by mail3.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id nB8GstJH031315; Tue, 8 Dec 2009 17:54:55 +0100 Message-ID: <4B1E84DF.9020401@siemens.com> Date: Tue, 08 Dec 2009 17:54:55 +0100 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Anthony Liguori X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 Cc: Marcelo Tosatti , qemu-devel , Avi Kivity Subject: [Qemu-devel] [FOR 0.12][PATCH] kvm: x86: Save/restore exception_index 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 As KVM now makes use of exception_index to keep pending exceptions, we have to save&restore this field as well. NOTE: We have to nail the arch-independent exception_index down to a certain bit width for proper vmstate processing, namely to 32 bit. Signed-off-by: Jan Kiszka --- cpu-defs.h | 2 +- target-i386/machine.c | 1 + 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/cpu-defs.h b/cpu-defs.h index 95068b5..51dc436 100644 --- a/cpu-defs.h +++ b/cpu-defs.h @@ -179,7 +179,7 @@ typedef struct CPUWatchpoint { \ /* Core interrupt code */ \ jmp_buf jmp_env; \ - int exception_index; \ + int32_t exception_index; \ \ CPUState *next_cpu; /* next CPU sharing TB cache */ \ int cpu_index; /* CPU index (informative) */ \ diff --git a/target-i386/machine.c b/target-i386/machine.c index cdc8898..ab4633e 100644 --- a/target-i386/machine.c +++ b/target-i386/machine.c @@ -453,6 +453,7 @@ static const VMStateDescription vmstate_cpu = { VMSTATE_UINT8_V(nmi_pending, CPUState, 11), VMSTATE_UINT8_V(has_error_code, CPUState, 11), VMSTATE_UINT32_V(sipi_vector, CPUState, 11), + VMSTATE_INT32_V(exception_index, CPUState, 11), /* MCE */ VMSTATE_UINT64_V(mcg_cap, CPUState, 10), VMSTATE_UINT64_V(mcg_status, CPUState, 10),