From patchwork Fri Apr 7 07:52:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haozhong Zhang X-Patchwork-Id: 9668957 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 723E0602A0 for ; Fri, 7 Apr 2017 07:54:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61D96285AD for ; Fri, 7 Apr 2017 07:54:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56BE8285DC; Fri, 7 Apr 2017 07:54: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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 DFD9A285AD for ; Fri, 7 Apr 2017 07:54: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 1cwOhB-000489-WE; Fri, 07 Apr 2017 07:52:37 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwOhA-000483-QS for xen-devel@lists.xen.org; Fri, 07 Apr 2017 07:52:36 +0000 Received: from [85.158.143.35] by server-6.bemta-6.messagelabs.com id 5E/47-03430-44547E85; Fri, 07 Apr 2017 07:52:36 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNLMWRWlGSWpSXmKPExsVywNykQtfZ9Xm Ewdl+E4slHxezODB6HN39mymAMYo1My8pvyKBNePg+weMBbPZKw6eOszSwPiLtYuRi4NF4DST xI+NV5hAHCGBaYwSa/tAMpwcEgK8EkeWzYCy/STu3Z7PDFHUC1R05xQjSIJNQF9ixeODYEUiA tIS1z5fBoszC1RLTFt5jg3EFhZIlui/uIMZxGYRUJX497UTrIZXwFZi/Z+JjBAL5CUuXD3F0s XIwcEpYCfRdiNmAiPvAkaGVYwaxalFZalFuoZmeklFmekZJbmJmTm6hgZmermpxcWJ6ak5iUn Fesn5uZsYgQHBAAQ7GO9vDDjEKMnBpCTKq+DzJEKILyk/pTIjsTgjvqg0J7X4EKMMB4eSBK+4 y/MIIcGi1PTUirTMHGBowqQlOHiURHgPOQOleYsLEnOLM9MhUqcYdTnm3Pv6nkmIJS8/L1VKn DcEZIYASFFGaR7cCFicXGKUlRLmZQQ6SoinILUoN7MEVf4VozgHo5IwryvIFJ7MvBK4Ta+Ajm ACOsLn1lOQI0oSEVJSDYyKHJ3Sgle52hiTfBnmLy9bZXeo0uZx5fUMZ1ZRN6UJztzcJ5dHX7N RuljGOOk+W+HmB2qOcUw6HAkfj8iVy6/yS+Xd2Z56/Vrc3bkb1HqjL+obuMzXMt5u7OPQ3SCQ XnVE5vPvjm+CnHnz/asE3MWPHj68gsn6YLyI4JR9FypM77d8id5yUomlOCPRUIu5qDgRAIcA5 CqOAgAA X-Env-Sender: haozhong.zhang@intel.com X-Msg-Ref: server-14.tower-21.messagelabs.com!1491551553!56046284!1 X-Originating-IP: [192.55.52.120] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 55960 invoked from network); 7 Apr 2017 07:52:35 -0000 Received: from mga04.intel.com (HELO mga04.intel.com) (192.55.52.120) by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 7 Apr 2017 07:52:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491551555; x=1523087555; h=from:to:cc:subject:date:message-id:in-reply-to; bh=bnXuvpDGaVYR3qTYt9ZPOtBmvwdqEVkUfnTMDGQBV+0=; b=KWVrIgGQ2X8OtCHfuqJYgOczl9NF1fvp5ph5llLN54b7V5gPoxiz5pex GXyEIg9rKOTZd4dtnFgxFg8GA/D/Uw==; Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Apr 2017 00:52:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,164,1488873600"; d="scan'208";a="74910253" Received: from hz-desktop.sh.intel.com (HELO localhost) ([10.239.159.153]) by orsmga004.jf.intel.com with ESMTP; 07 Apr 2017 00:52:31 -0700 From: Haozhong Zhang To: xen-devel@lists.xen.org Date: Fri, 7 Apr 2017 15:52:19 +0800 Message-Id: <20170407075220.26914-1-haozhong.zhang@intel.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20170406123343.23423-4-haozhong.zhang@intel.com> Cc: Andrew Cooper , Jan Beulich , Haozhong Zhang Subject: [Xen-devel] [RESEND PATCH v2 3/4] xen/mce: always re-initialize 'severity_cpu' in mcheck_cmn_handler() 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 mcheck_cmn_handler() does not always set 'severity_cpu' to override its value taken from previous rounds of MC handling, which will interfere the current round of MC handling. Always re-initialize it to clear the historical value. Signed-off-by: Haozhong Zhang Reviewed-by: Jan Beulich --- Reason for resend: * Move the re-initialization after its last use, so that we can avoid introducing a new mce barrier. --- xen/arch/x86/cpu/mcheck/mce.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c index a2e9668..0d9d5b0 100644 --- a/xen/arch/x86/cpu/mcheck/mce.c +++ b/xen/arch/x86/cpu/mcheck/mce.c @@ -523,6 +523,7 @@ void mcheck_cmn_handler(const struct cpu_user_regs *regs) mc_panic(ebuf); } atomic_set(&found_error, 0); + atomic_set(&severity_cpu, -1); } mce_barrier_exit(&mce_trap_bar);