From patchwork Mon Feb 27 05:09:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haozhong Zhang X-Patchwork-Id: 9592689 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 79AE2604AB for ; Mon, 27 Feb 2017 05:12:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C1B727FB1 for ; Mon, 27 Feb 2017 05:12:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 60D7028395; Mon, 27 Feb 2017 05:12:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9858628383 for ; Mon, 27 Feb 2017 05:12:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciDZS-0006EK-N3; Mon, 27 Feb 2017 05:10:02 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciDZS-00069V-8J for xen-devel@lists.xen.org; Mon, 27 Feb 2017 05:10:02 +0000 Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id BE/56-03705-9A4B3B85; Mon, 27 Feb 2017 05:10:01 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHLMWRWlGSWpSXmKPExsXS1taRortiy+Y Ig5PrrSyWfFzM4sDocXT3b6YAxijWzLyk/IoE1owNVx+yFPzkrDg7fR5LA+MBji5GTg4hgUqJ PztWM4PYEgK8EkeWzWCFsAMk/k9qYeti5AKq6WWUeNLfywiSYBPQl1jx+CBYkYiAtMS1z5cZQ YqYBS4wSsz+uIcJJCEs4C5x8uo5sAYWAVWJz+07wDbwCthKPN+4kB1ig7zEhaunWEBsTgE7iV tnWoFqOIC22Uqs/i4ygZF3ASPDKkaN4tSistQiXSMTvaSizPSMktzEzBxdQwNjvdzU4uLE9NS cxKRiveT83E2MwHCoZ2Bg3MH46rjfIUZJDiYlUd5FxhsjhPiS8lMqMxKLM+KLSnNSiw8xynBw KEnw9m/eHCEkWJSanlqRlpkDDEyYtAQHj5II7/5NQGne4oLE3OLMdIjUKUZFKXHeapA+AZBER mkeXBssGi4xykoJ8zIyMDAI8RSkFuVmlqDKv2IU52BUEuatAJnCk5lXAjf9FdBiJqDFs0Fu5i 0uSURISTUwlipG/3xQohVe9fNa9fK7V19GXjg0S/Lx/eTg2GLmHS13vAKWfre+diE5dKdkQno gj1fg/fOJ+m/Eq1/lBHJmGJa8jYv5sMLHbu0X7leMv3jFXn4PmnWLTcTP87TOFKfECZPunk87 G1Alv/+E5eSsO7n+TDULKyaU9eu8/+L1bZLEzIcLWJg/KLEUZyQaajEXFScCACeh2R+BAgAA X-Env-Sender: haozhong.zhang@intel.com X-Msg-Ref: server-4.tower-31.messagelabs.com!1488172192!29448017!5 X-Originating-IP: [134.134.136.100] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 24865 invoked from network); 27 Feb 2017 05:10:00 -0000 Received: from mga07.intel.com (HELO mga07.intel.com) (134.134.136.100) by server-4.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 27 Feb 2017 05:10:00 -0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP; 26 Feb 2017 21:10:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.35,212,1484035200"; d="scan'208"; a="1115945487" Received: from hz-desktop.sh.intel.com (HELO localhost) ([10.239.159.133]) by fmsmga001.fm.intel.com with ESMTP; 26 Feb 2017 21:09:58 -0800 From: Haozhong Zhang To: xen-devel@lists.xen.org Date: Mon, 27 Feb 2017 13:09:10 +0800 Message-Id: <20170227050912.28824-6-haozhong.zhang@intel.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20170227050912.28824-1-haozhong.zhang@intel.com> References: <20170227050912.28824-1-haozhong.zhang@intel.com> Cc: Haozhong Zhang , Boris Ostrovsky , Christoph Egger , Jan Beulich , Andrew Cooper Subject: [Xen-devel] [PATCH v2 5/7] x86/mce: clear MSR_IA32_MCG_STATUS by writing 0 X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP On Intel CPU, an attemp to write to MSR_IA32_MCG_STATUS with any non-zero value would result in #GP. This commit writes 0 on AMD CPU as well instead of just clearing MCIP bit, because all non-reserved bits of MSR_IA32_MCG_STATUS have been handled at this point. Signed-off-by: Haozhong Zhang Reviewed-by: Jan Beulich Reviewed-by: Boris Ostrovsky --- Cc: Christoph Egger Cc: Jan Beulich Cc: Andrew Cooper Cc: Boris Ostrovsky --- xen/arch/x86/cpu/mcheck/mce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c index 53ca29c..5a7e2ba 100644 --- a/xen/arch/x86/cpu/mcheck/mce.c +++ b/xen/arch/x86/cpu/mcheck/mce.c @@ -539,7 +539,7 @@ void mcheck_cmn_handler(const struct cpu_user_regs *regs) gstatus = mca_rdmsr(MSR_IA32_MCG_STATUS); if ((gstatus & MCG_STATUS_MCIP) != 0) { mce_printk(MCE_CRITICAL, "MCE: Clear MCIP@ last step"); - mca_wrmsr(MSR_IA32_MCG_STATUS, gstatus & ~MCG_STATUS_MCIP); + mca_wrmsr(MSR_IA32_MCG_STATUS, 0); } mce_barrier_exit(&mce_trap_bar);