From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juan Quintela Subject: Re: [PATCH] kvm: x86: Save/restore error_code Date: Thu, 09 Dec 2010 12:28:24 +0100 Message-ID: References: <20101209112200.5462.76552.stgit@dhcp-91-7.nay.redhat.com.englab.nay.redhat.com> Reply-To: quintela@redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, gleb@redhat.com, mst@redhat.com To: Jason Wang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:60679 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753870Ab0LIL2d (ORCPT ); Thu, 9 Dec 2010 06:28:33 -0500 In-Reply-To: <20101209112200.5462.76552.stgit@dhcp-91-7.nay.redhat.com.englab.nay.redhat.com> (Jason Wang's message of "Thu, 09 Dec 2010 19:22:01 +0800") Sender: kvm-owner@vger.kernel.org List-ID: Jason Wang wrote: > The saving and restoring of error_code seems lost and convert the > error_code to uint32_t. > > Signed-off-by: Jason Wang > --- > target-i386/cpu.h | 4 ++-- > target-i386/machine.c | 2 ++ > 2 files changed, 4 insertions(+), 2 deletions(-) It should be a new subsection. The test is if has_error_code != 0 according to gleb. Later, Juan. > 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! */ > }, From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=54401 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQehO-0001qe-Rn for qemu-devel@nongnu.org; Thu, 09 Dec 2010 06:30:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQefp-00046W-Oz for qemu-devel@nongnu.org; Thu, 09 Dec 2010 06:28:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:19974) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQefp-00046F-Dc for qemu-devel@nongnu.org; Thu, 09 Dec 2010 06:28:33 -0500 From: Juan Quintela In-Reply-To: <20101209112200.5462.76552.stgit@dhcp-91-7.nay.redhat.com.englab.nay.redhat.com> (Jason Wang's message of "Thu, 09 Dec 2010 19:22:01 +0800") References: <20101209112200.5462.76552.stgit@dhcp-91-7.nay.redhat.com.englab.nay.redhat.com> Date: Thu, 09 Dec 2010 12:28:24 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [PATCH] kvm: x86: Save/restore error_code Reply-To: quintela@redhat.com List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang Cc: gleb@redhat.com, qemu-devel@nongnu.org, kvm@vger.kernel.org, mst@redhat.com Jason Wang wrote: > The saving and restoring of error_code seems lost and convert the > error_code to uint32_t. > > Signed-off-by: Jason Wang > --- > target-i386/cpu.h | 4 ++-- > target-i386/machine.c | 2 ++ > 2 files changed, 4 insertions(+), 2 deletions(-) It should be a new subsection. The test is if has_error_code != 0 according to gleb. Later, Juan. > 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! */ > },