From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934060AbcAYTnZ (ORCPT ); Mon, 25 Jan 2016 14:43:25 -0500 Received: from mail.skyhub.de ([78.46.96.112]:33190 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933657AbcAYTl4 (ORCPT ); Mon, 25 Jan 2016 14:41:56 -0500 From: Borislav Petkov To: Ingo Molnar Cc: LKML Subject: [PATCH 4/8] x86/mce/AMD: Do not perform shared bank check for future processors Date: Mon, 25 Jan 2016 20:41:49 +0100 Message-Id: <1453750913-4781-5-git-send-email-bp@alien8.de> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1453750913-4781-1-git-send-email-bp@alien8.de> References: <1453750913-4781-1-git-send-email-bp@alien8.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aravind Gopalakrishnan Fam17h and above should not require a check to see if a bank is shared or not. For shared banks, there will always be only one core that has visibility over the MSRs and only that particular core will be allowed to write to the MSRs. Fix the code to return early if we have Scalable MCA support. No change in functionality for earlier processors. Boris: Fold in fix from kbuild test robot for: arch/x86/kernel/cpu/mcheck/mce_amd.c:93:9-10: WARNING: return of 0/1 in function 'is_shared_bank' with return type bool Generated by: scripts/coccinelle/misc/boolreturn.cocci Signed-off-by: Aravind Gopalakrishnan Cc: linux-edac Cc: Tony Luck Cc: x86-ml Link: http://lkml.kernel.org/r/1452901836-27632-3-git-send-email-Aravind.Gopalakrishnan@amd.com Signed-off-by: Fengguang Wu [ Boris: massage text. ] Signed-off-by: Borislav Petkov --- arch/x86/kernel/cpu/mcheck/mce_amd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c index e99b15077e94..3068ce25dfa1 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd.c +++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c @@ -84,6 +84,13 @@ struct thresh_restart { static inline bool is_shared_bank(int bank) { + /* + * Scalable MCA provides for only one core to have access to the MSRs of + * a shared bank. + */ + if (mce_flags.smca) + return false; + /* Bank 4 is for northbridge reporting and is thus shared */ return (bank == 4); } -- 2.3.5