Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3017763imm; Sun, 1 Jul 2018 10:23:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpegb+a3B7LeqLL2zthUnVDpNZAUvN+KI4c8XBhh6p0eEhZDfbNo8Mq2mNf6eYKETiBhHmq0 X-Received: by 2002:a63:a042:: with SMTP id u2-v6mr18778952pgn.80.1530465800136; Sun, 01 Jul 2018 10:23:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530465800; cv=none; d=google.com; s=arc-20160816; b=URS6gT5Min67GUOrRIRvibFsjlB/g172B3H6XqlPxqZyqw50q+yc30jqoSEu18KM3r R/E7R+uKbvsy2J8ZUlTnHILxrEwpLd4owZDbetQqOyAlXxMYCfkrsxk5qeyn1R4pFipF +TUjEk9vLgYgThhtLVrRAQcyXKEcKoLZ//U0Tb+ZRRnkLPQE4gGoto8WURPRIaUxf7Q/ GMyXMRqddhmfqIS8/oeilytMETLDGVR08/zgWn/P+i2ZUcYIjgAx2HOgqhued94WRrXw lQYUrQIpelKOzSadg18oO6nwXhgHt2bT6x8+EYWUYuS1j/wdVRjI6QjOPGBOKkq4+K2j /HDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=/R2RNVmJYWkvBkBwsAE9+VHjZhWIpF6TANgL8aFm/qY=; b=UlshSj9dheGX/1ab6ytSfwzVyu4MPe7xCcLgsIFm6s5oIkh9XuAENPdpehMPAtBcFd mn8jsCOGREUUM1FRQNpOSIJgSzca5cOhgCo0hK+he82WH6E55TxYslHPPhIdfTj2Ka9S oCk4CKtBgJx8VL6k8NPmnPpiWQZmsglGU+IwUbJlMOOl1v3Oh8fNnRmy+4GDldEgkZ1c 3Aj6gOpmyZ8rrGrTDshMwTTsW/tjGdoDwEKQnO2t5bCWn+Mt/oXh2MU3+YtxVGuMM/PQ 4IW+3uPV9nH0Mjn03j9DGvd1X5baQR58nYLOLX09Kil16ah/cau4LCKMh6k0RHRUvhEO J/gA== 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 n14-v6si1566503pgg.216.2018.07.01.10.23.05; Sun, 01 Jul 2018 10:23:20 -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 S1031553AbeGAQiN (ORCPT + 99 others); Sun, 1 Jul 2018 12:38:13 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36648 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031094AbeGAQiI (ORCPT ); Sun, 1 Jul 2018 12:38:08 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F3F9AA73; Sun, 1 Jul 2018 16:38:07 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tony Luck , Thomas Gleixner , Qiuxu Zhuo , Ashok Raj , Dan Williams , Borislav Petkov Subject: [PATCH 4.17 007/220] x86/mce: Check for alternate indication of machine check recovery on Skylake Date: Sun, 1 Jul 2018 18:20:31 +0200 Message-Id: <20180701160908.617023129@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tony Luck commit 4c5717da1d021cf368eabb3cb1adcaead56c0d1e upstream. Currently we just check the "CAPID0" register to see whether the CPU can recover from machine checks. But there are also some special SKUs which do not have all advanced RAS features, but do enable machine check recovery for use with NVDIMMs. Add a check for any of bits {8:5} in the "CAPID5" register (each reports some NVDIMM mode available, if any of them are set, then the system supports memory machine check recovery). Signed-off-by: Tony Luck Signed-off-by: Thomas Gleixner Cc: Qiuxu Zhuo Cc: Ashok Raj Cc: stable@vger.kernel.org # 4.9 Cc: Dan Williams Cc: Borislav Petkov Link: https://lkml.kernel.org/r/03cbed6e99ddafb51c2eadf9a3b7c8d7a0cc204e.1527283897.git.tony.luck@intel.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/quirks.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) --- a/arch/x86/kernel/quirks.c +++ b/arch/x86/kernel/quirks.c @@ -645,12 +645,19 @@ static void quirk_intel_brickland_xeon_r /* Skylake */ static void quirk_intel_purley_xeon_ras_cap(struct pci_dev *pdev) { - u32 capid0; + u32 capid0, capid5; pci_read_config_dword(pdev, 0x84, &capid0); + pci_read_config_dword(pdev, 0x98, &capid5); - if ((capid0 & 0xc0) == 0xc0) + /* + * CAPID0{7:6} indicate whether this is an advanced RAS SKU + * CAPID5{8:5} indicate that various NVDIMM usage modes are + * enabled, so memory machine check recovery is also enabled. + */ + if ((capid0 & 0xc0) == 0xc0 || (capid5 & 0x1e0)) static_branch_inc(&mcsafe_key); + } DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x0ec3, quirk_intel_brickland_xeon_ras_cap); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2fc0, quirk_intel_brickland_xeon_ras_cap);