Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1334024imc; Mon, 11 Mar 2019 11:21:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQCA1z8fyF01V4PySy9mtWiXi8BeMiDz6gS2LioylGmAORdcjXxIryIzXHCCfapKFRaFaE X-Received: by 2002:a63:2b82:: with SMTP id r124mr30996580pgr.214.1552328510959; Mon, 11 Mar 2019 11:21:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552328510; cv=none; d=google.com; s=arc-20160816; b=uVNqoykOhkET129adsAMY9VR2gPQO/X4fJXmR4xG7pimgAJ6AJi/z4TmiHeP0V+8lm Xf4fdTTuoPEU5cfcTwVUDmHR8/q7km3CtHfaD8ReecLf6dmYiEoGPqyQ7mx3RXYt4NZS qDoMnZF0bAS1jEsRvXWX05ZJOlUdlhwPB8rhW1AikaNSSFXqhcTAXFvFeGAxsvYPKUoz M6jdnZvfNrwVHfZk9W1YZaOBUXGeMXeIv+FkuCW9W27sXobXNJboIDwxTAmFVNhzwD/b pZSNO+prUNBN9Dz5lJc6WRaBWdNFWit9zOLZvp0kocvCFVcE58mJT14mPJuxgmz7pEEE Ic4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=nCyB05BEd3n9iI5SpjYNfRRDJmSVJsrRZdq9jkEBK1M=; b=c2FZDtD2EZx8LByEnxp0pBjZwCQQAzhC2kDg8D7S5ACWV/rRo4MEkCglh5m5xeAptd FnyU/T1cIIEowXWmsQfpe41DW4LqAkixk8EKSKdMzGMQ6J+5Z/bLXe6/P/C9jjBWvrvF HaI9pkG7cviStDbmEH4wO+l+nLUXFO4BTfCretyOXw4AhO3Dz4hxn/xxvKVtNHvtmNbD KVQQLKQYNEA0qajZd+NNdvllRTMaB0vUnYeq7m1gTvZ86j14c3+Sd3XUmBdkO4441YSo BhvmeZz8mYeItctGGNZd7aAnsCYXQC4sFZyHIaDpUgjWo+AYIWMOFVZgjpZFIG64WAEE Lbgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=TzcCpgXg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x35si5525872pgk.107.2019.03.11.11.21.34; Mon, 11 Mar 2019 11:21:50 -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; dkim=pass header.i=@alien8.de header.s=dkim header.b=TzcCpgXg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727674AbfCKSVI (ORCPT + 99 others); Mon, 11 Mar 2019 14:21:08 -0400 Received: from mail.skyhub.de ([5.9.137.197]:60134 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727050AbfCKSVH (ORCPT ); Mon, 11 Mar 2019 14:21:07 -0400 Received: from zn.tnic (unknown [IPv6:2003:ec:2f05:7900:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 789951EC02C1; Mon, 11 Mar 2019 19:21:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1552328465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=nCyB05BEd3n9iI5SpjYNfRRDJmSVJsrRZdq9jkEBK1M=; b=TzcCpgXgp/zAGj0b7kVJYJlLz7fmp7LoYn3UU8h+I2IMubevZ9LRhUD07CcMPN7gibTiPj wCyYQkMfIVxlA+EH81UO/NGSkKgO9WEXUGggLUb9W43QmacnJYjItqkXMfmK+/h05gLtif ZcMB+klccD4VCDG/I9EhB61TfvH/Huw= Date: Mon, 11 Mar 2019 19:21:04 +0100 From: Borislav Petkov To: "Ghannam, Yazen" Cc: "linux-edac@vger.kernel.org" , Borislav Petkov , Tony Luck , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "rafal@milecki.pl" , "clemej@gmail.com" Subject: Re: [PATCH 2/2] x86/MCE/AMD, EDAC/mce_amd: Don't report L1 BTB MCA errors on some Family 17h models Message-ID: <20190311182104.GD7384@zn.tnic> References: <20190307212552.8865-1-Yazen.Ghannam@amd.com> <20190307212552.8865-2-Yazen.Ghannam@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190307212552.8865-2-Yazen.Ghannam@amd.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 07, 2019 at 09:26:04PM +0000, Ghannam, Yazen wrote: > +static bool smca_filter_mce(struct mce *m) > +{ > + enum smca_bank_types bank_type = smca_get_bank_type(m->bank); > + struct cpuinfo_x86 *c = &boot_cpu_data; > + u8 xec = XEC(m->status, xec_mask); > + > + /* > + * Spurious errors of this type may be reported. > + * See Family 17h Models 10h-2Fh Erratum #1114. > + */ > + if (c->x86 == 0x17 && > + (c->x86_model >= 0x10 && c->x86_model <= 0x2F) && > + bank_type == SMCA_IF && xec == 10) > + return true; This is happening too late and we need it much earlier, from Rafal's dmesg: [ 1.070855] mce: [Hardware Error]: Machine check events logged [ 1.070860] mce: [Hardware Error]: CPU 2: Machine Check: 0 Bank 1: d8200000000a0151 [ 1.070863] mce: [Hardware Error]: TSC 73fa0765c MISC d01b0fff00000000 SYND 4a000000 IPID 100b000000000 [ 1.071065] mce: [Hardware Error]: PROCESSOR 2:810f10 TIME 1543481411 SOCKET 0 APIC 2 microcode 810100b that's __print_mce() from the notifier. So we'd need a filter function which is called in do_machine_check() and machine_check_poll() right after we've collected enough info to be able to filter out the MCE based on the signature. In this case the extended error core and SMCA bank type suffices but we should put those functions late enough so that they can be used for other filtering later. Alternatively, if this error type has a special bit in the mask registers so that you can disable it there ala if (c->x86_vendor == X86_VENDOR_AMD) { if (c->x86 == 15 && cfg->banks > 4) { /* * disable GART TBL walk error reporting, which * trips off incorrectly with the IOMMU & 3ware * & Cerberus: */ clear_bit(10, (unsigned long *)&mce_banks[4].ctl); that would be even better but I'd guess it doesn't have a special bit... Thx. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.