linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: "Ghannam, Yazen" <Yazen.Ghannam@amd.com>
Cc: "linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
	Borislav Petkov <bp@suse.de>, Tony Luck <tony.luck@intel.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"rafal@milecki.pl" <rafal@milecki.pl>,
	"clemej@gmail.com" <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
Date: Mon, 11 Mar 2019 19:21:04 +0100	[thread overview]
Message-ID: <20190311182104.GD7384@zn.tnic> (raw)
In-Reply-To: <20190307212552.8865-2-Yazen.Ghannam@amd.com>

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.

  reply	other threads:[~2019-03-11 18:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 21:26 [PATCH 1/2] x86/MCE/AMD: Export smca_get_bank_type() Ghannam, Yazen
2019-03-07 21:26 ` [PATCH 2/2] x86/MCE/AMD, EDAC/mce_amd: Don't report L1 BTB MCA errors on some Family 17h models Ghannam, Yazen
2019-03-11 18:21   ` Borislav Petkov [this message]
2019-03-11 18:52     ` Ghannam, Yazen
2019-03-11 19:01       ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190311182104.GD7384@zn.tnic \
    --to=bp@alien8.de \
    --cc=Yazen.Ghannam@amd.com \
    --cc=bp@suse.de \
    --cc=clemej@gmail.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafal@milecki.pl \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).