Received: by 10.192.165.148 with SMTP id m20csp580734imm; Wed, 25 Apr 2018 04:37:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpl9yIoS67IiDop3TsTrHJ8FnHH0+hlDHn5qAco9XDa83sy3502duesKHY6iQLE3mor4HMg X-Received: by 10.99.65.193 with SMTP id o184mr5055179pga.393.1524656276327; Wed, 25 Apr 2018 04:37:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524656276; cv=none; d=google.com; s=arc-20160816; b=0so5GYlI2uIw5XfsPGkM6q+xd2rostUt76Ev4fdfQr96JnpIt2Eoo0YIUgy0t++ePL 6b9iETUsQ1Hu9n8aS4pOF3hA77dy76OG9inaphUhjqtkGisLjMS7WN5BSBsH+2uHStJH 408kYMGr5C87YoMuspRfB5CldvCx0i+4M6wQmqyrSU0Den3+wkAg80es849XCub1BNml q4ZhB0bPjitKAw8SiuoLx63wOXkU73OcFwAwytJm+RaHTI9U1fGiV1POQzv3TogDyjo8 /yXDrtLifMiRtKBYg7sv/QUDCTrAS47tXI1KbLl9QKV/0DGL8567ldZJA9RYO8vXdCkr /u6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=D6SuJTv+bm1bZOFsjflgliHQDzu177y70KNdYN5nuDI=; b=zVzfNXlD0LaPu61UHL8Yl3OnHdf0ijOB+9seitTbYAQnVmC8mNgInRevtSt9D984Ug 7/GAJdHwWVjUGyndDmoj5Z/Gcy/ec72jyQNqmtB7nVrXU22k5hRSOQENqCmAqf+ZtI0T hvp24trIYgdbJl6USnSOo2TZ35DYYWSnzURPqlBeNcPiVsxqyA5aQuh9Kgp466csUZq/ MExFmLRuw6K3svFCURz7UpEVEtLFAm3LBbmFKl8zk0nuDmddeGqlPYwgJGJEzOXDl0wq 4QZKZ7bTu6gYhmXcFNbo/y7psdjMqURZwYe8cfQi15384wKPiuosZkoD8/0Bb5+F2UWb HONw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 21si4705003pfy.293.2018.04.25.04.37.41; Wed, 25 Apr 2018 04:37:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753219AbeDYLge (ORCPT + 99 others); Wed, 25 Apr 2018 07:36:34 -0400 Received: from ZXSHCAS1.zhaoxin.com ([203.148.12.81]:52233 "EHLO ZXSHCAS1.zhaoxin.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752110AbeDYKd5 (ORCPT ); Wed, 25 Apr 2018 06:33:57 -0400 Received: from zxbjmbx3.zhaoxin.com (10.29.252.165) by ZXSHCAS1.zhaoxin.com (10.28.252.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1261.35; Wed, 25 Apr 2018 18:33:55 +0800 Received: from timguo-System-Product-Name.zhaoxin.com (10.29.8.54) by zxbjmbx3.zhaoxin.com (10.29.252.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1261.35; Wed, 25 Apr 2018 18:33:54 +0800 From: David Wang To: , , , , , , , , CC: , , , , , , David Wang Subject: [PATCH v3 1/2] x86/mce: new Centaur CPU support MCE broadcasting Date: Wed, 25 Apr 2018 18:33:39 +0800 Message-ID: <1524652420-17330-2-git-send-email-davidwang@zhaoxin.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1524652420-17330-1-git-send-email-davidwang@zhaoxin.com> References: <1524652420-17330-1-git-send-email-davidwang@zhaoxin.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.29.8.54] X-ClientProxiedBy: zxbjmbx1.zhaoxin.com (10.29.252.163) To zxbjmbx3.zhaoxin.com (10.29.252.165) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Newer Centaur multi-core CPU also support MCE broadcasting to all cores. But no Centaur special code tell this truth to kernel. Signed-off-by: David Wang --- arch/x86/kernel/cpu/mcheck/mce.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index 42cf288..38ccab8 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -1727,6 +1727,22 @@ static void __mcheck_cpu_init_early(struct cpuinfo_x86 *c) } } +void mce_centaur_feature_init(struct cpuinfo_x86 *c) +{ + struct mca_config *cfg = &mca_cfg; + + /* + * All newer Centaur CPUs support MCE broadcasting. Enable + * synchronization with a one second timeout. + */ + if (cfg->monarch_timeout < 0) { + if ((c->x86 == 6 && c->x86_model == 0xf && + c->x86_stepping >= 0xe) || c->x86 > 6) + cfg->monarch_timeout = USEC_PER_SEC; + } +} + + static void __mcheck_cpu_init_vendor(struct cpuinfo_x86 *c) { switch (c->x86_vendor) { @@ -1739,6 +1755,9 @@ static void __mcheck_cpu_init_vendor(struct cpuinfo_x86 *c) mce_amd_feature_init(c); break; } + case X86_VENDOR_CENTAUR: + mce_centaur_feature_init(c); + break; default: break; -- 1.9.1