From patchwork Fri Feb 24 10:52:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haozhong Zhang X-Patchwork-Id: 9589905 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 052AD60471 for ; Fri, 24 Feb 2017 10:55:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCA342866A for ; Fri, 24 Feb 2017 10:55:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0A2E2894F; Fri, 24 Feb 2017 10:55:50 +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 62D522866A for ; Fri, 24 Feb 2017 10:55:50 +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 1chDVS-0003xy-JZ; Fri, 24 Feb 2017 10:53:46 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1chDVR-0003wi-EI for xen-devel@lists.xen.org; Fri, 24 Feb 2017 10:53:45 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id DF/2C-06007-8B010B85; Fri, 24 Feb 2017 10:53:44 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHLMWRWlGSWpSXmKPExsXS1tYhortDYEO EQdsJHoslHxezODB6HN39mymAMYo1My8pvyKBNWPX3+ksBTO5K14dvMnUwNjM2cXIySEkMI1R 4vthcRBbQoBX4siyGawQtr/Eiq+7WSBqehklHn/mA7HZBPQlVjw+CFYjIiAtce3zZcYuRi4OZ oGFjBI7f7WDJYQFYiUe7L8BZrMIqErMWDyDEcTmFbCV6G5sZ4NYIC9x4eopsAWcAnYSFw+uZo RYZiuxrvsB8wRG3gWMDKsYNYpTi8pSi3SNTPSSijLTM0pyEzNzdA0NjPVyU4uLE9NTcxKTivW S83M3MQLDoZ6BgXEH46vjfocYJTmYlER5/z9cHyHEl5SfUpmRWJwRX1Sak1p8iFGGg0NJgjea f0OEkGBRanpqRVpmDjAwYdISHDxKIrzvQNK8xQWJucWZ6RCpU4yKUuK8giAJAZBERmkeXBssG i4xykoJ8zIyMDAI8RSkFuVmlqDKv2IU52BUEuatBJnCk5lXAjf9FdBiJqDFls5rQRaXJCKkpB oYc7xOXC45uahwrkJstb61dY33Ucm3X54lv8juuadnV7fOxTdTou119Yx91hfn6K+KunXVPZr ZvfHt+jgzYTElv+uFxfH5772jO0X2/LTK2OrIl3gxXppd1vzerD1P5+/ru7hDfKdA+aWp811V zpQLTjhwhvvD8t4NnolTw7azCNeFvQlmXXxSiaU4I9FQi7moOBEALi2I6YECAAA= X-Env-Sender: haozhong.zhang@intel.com X-Msg-Ref: server-10.tower-31.messagelabs.com!1487933615!86569883!5 X-Originating-IP: [134.134.136.20] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzU1MzU4\n X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 5969 invoked from network); 24 Feb 2017 10:53:43 -0000 Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by server-10.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 24 Feb 2017 10:53:43 -0000 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Feb 2017 02:53:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,200,1484035200"; d="scan'208";a="937650307" Received: from hz-desktop.sh.intel.com (HELO localhost) ([10.239.159.133]) by orsmga003.jf.intel.com with ESMTP; 24 Feb 2017 02:53:41 -0800 From: Haozhong Zhang To: xen-devel@lists.xen.org Date: Fri, 24 Feb 2017 18:52:55 +0800 Message-Id: <20170224105256.24668-7-haozhong.zhang@intel.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20170224105256.24668-1-haozhong.zhang@intel.com> References: <20170224105256.24668-1-haozhong.zhang@intel.com> Cc: Haozhong Zhang , Christoph Egger , Jan Beulich , Andrew Cooper Subject: [Xen-devel] [PATCH 6/7] xen/mce: make ASSERT's about mce_dhandler_num in mce_action() Intel only 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 mce_dhandlers[] and its array size mce_dhandler_num are not used and set on non-Intel platforms, so the corresponding ASSERT's in mce_action() should be valid only for Intel. Signed-off-by: Haozhong Zhang --- Cc: Christoph Egger Cc: Jan Beulich Cc: Andrew Cooper --- xen/arch/x86/cpu/mcheck/mce.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c index 5a7e2ba..81d0902 100644 --- a/xen/arch/x86/cpu/mcheck/mce.c +++ b/xen/arch/x86/cpu/mcheck/mce.c @@ -1621,8 +1621,8 @@ static enum mce_result mce_action(const struct cpu_user_regs *regs, handlers = mce_uhandlers; } - /* At least a default handler should be registerd */ - ASSERT(handler_num); + /* At least a default handler should be registered for Intel CPU. */ + ASSERT(handler_num || boot_cpu_data.x86_vendor != X86_VENDOR_INTEL); local_mi = (struct mc_info*)mctelem_dataptr(mctc); x86_mcinfo_lookup(mic, local_mi, MC_TYPE_GLOBAL); @@ -1656,7 +1656,8 @@ static enum mce_result mce_action(const struct cpu_user_regs *regs, break; } } - ASSERT(i != handler_num); + ASSERT(i != handler_num || + boot_cpu_data.x86_vendor != X86_VENDOR_INTEL); } return worst_result;