From patchwork Thu Dec 9 11:22:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 394022 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB9BL0DL012562 for ; Thu, 9 Dec 2010 11:21:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752555Ab0LILU6 (ORCPT ); Thu, 9 Dec 2010 06:20:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:21565 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751377Ab0LILU5 (ORCPT ); Thu, 9 Dec 2010 06:20:57 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oB9BKtms015381 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 9 Dec 2010 06:20:55 -0500 Received: from dhcp-91-7.nay.redhat.com.englab.nay.redhat.com (dhcp-91-7.nay.redhat.com [10.66.91.7]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oB9BKpqm011855; Thu, 9 Dec 2010 06:20:52 -0500 Subject: [PATCH] kvm: x86: Save/restore error_code To: qemu-devel@nongnu.org, quintela@redhat.com From: Jason Wang Cc: kvm@vger.kernel.org, gleb@redhat.com, mst@redhat.com Date: Thu, 09 Dec 2010 19:22:01 +0800 Message-ID: <20101209112200.5462.76552.stgit@dhcp-91-7.nay.redhat.com.englab.nay.redhat.com> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 09 Dec 2010 11:21:01 +0000 (UTC) diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 06e40f3..c990db9 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -688,7 +688,7 @@ typedef struct CPUX86State { uint64_t pat; /* exception/interrupt handling */ - int error_code; + uint32_t error_code; int exception_is_int; target_ulong exception_next_eip; target_ulong dr[8]; /* debug registers */ @@ -933,7 +933,7 @@ uint64_t cpu_get_tsc(CPUX86State *env); #define cpu_list_id x86_cpu_list #define cpudef_setup x86_cpudef_setup -#define CPU_SAVE_VERSION 12 +#define CPU_SAVE_VERSION 13 /* MMU modes definitions */ #define MMU_MODE0_SUFFIX _kernel diff --git a/target-i386/machine.c b/target-i386/machine.c index d78eceb..0e467da 100644 --- a/target-i386/machine.c +++ b/target-i386/machine.c @@ -491,6 +491,8 @@ static const VMStateDescription vmstate_cpu = { VMSTATE_UINT64_V(xcr0, CPUState, 12), VMSTATE_UINT64_V(xstate_bv, CPUState, 12), VMSTATE_YMMH_REGS_VARS(ymmh_regs, CPUState, CPU_NB_REGS, 12), + + VMSTATE_UINT32_V(error_code, CPUState, 13), VMSTATE_END_OF_LIST() /* The above list is not sorted /wrt version numbers, watch out! */ },