From patchwork Tue Mar 15 21:50:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 87093 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 1C861B70DC for ; Wed, 16 Mar 2011 09:02:38 +1100 (EST) Received: from localhost ([127.0.0.1]:49224 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzcK3-0000r8-6j for incoming@patchwork.ozlabs.org; Tue, 15 Mar 2011 18:02:35 -0400 Received: from [140.186.70.92] (port=54798 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzcCF-0006IB-Uj for qemu-devel@nongnu.org; Tue, 15 Mar 2011 17:56:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzcB4-0003OB-TR for qemu-devel@nongnu.org; Tue, 15 Mar 2011 17:54:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzcB4-0003Np-4q for qemu-devel@nongnu.org; Tue, 15 Mar 2011 17:53:18 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2FLrElV016102 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 15 Mar 2011 17:53:15 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p2FLrEiT006172; Tue, 15 Mar 2011 17:53:14 -0400 Received: from amt.cnet (vpn1-5-191.ams2.redhat.com [10.36.5.191]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p2FLrCTX023433; Tue, 15 Mar 2011 17:53:12 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 73EBA68A03D; Tue, 15 Mar 2011 18:51:27 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.4/8.14.4/Submit) id p2FLpMpV002062; Tue, 15 Mar 2011 18:51:22 -0300 From: Marcelo Tosatti To: Anthony Liguori Date: Tue, 15 Mar 2011 18:50:18 -0300 Message-Id: <185592324ff92f3c7c5edb4d9e96d40a137ecdcd.1300225848.git.mtosatti@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Hidetoshi Seto , kvm@vger.kernel.org, Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, Huang Ying , Jin Dongming Subject: [Qemu-devel] [PATCH 04/35] x86: Perform implicit mcg_status reset 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 Reorder mcg_status in CPUState to achieve automatic clearing on reset. Signed-off-by: Jan Kiszka CC: Huang Ying CC: Hidetoshi Seto CC: Jin Dongming Signed-off-by: Marcelo Tosatti --- target-i386/cpu.h | 3 ++- target-i386/helper.c | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 5f1df8b..75156e7 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -687,6 +687,8 @@ typedef struct CPUX86State { uint64_t pat; + uint64_t mcg_status; + /* exception/interrupt handling */ int error_code; int exception_is_int; @@ -741,7 +743,6 @@ typedef struct CPUX86State { struct DeviceState *apic_state; uint64_t mcg_cap; - uint64_t mcg_status; uint64_t mcg_ctl; uint64_t mce_banks[MCE_BANKS_DEF*4]; diff --git a/target-i386/helper.c b/target-i386/helper.c index f0c546d..f41416f 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -101,8 +101,6 @@ void cpu_reset(CPUX86State *env) env->dr[7] = DR7_FIXED_1; cpu_breakpoint_remove_all(env, BP_CPU); cpu_watchpoint_remove_all(env, BP_CPU); - - env->mcg_status = 0; } void cpu_x86_close(CPUX86State *env)