mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ahmed Abdelfattah <me@ahmedabdelfattah.dev>
To: Chao Gao <chao.gao@intel.com>
Cc: Tony Luck <tony.luck@intel.com>, Borislav Petkov <bp@alien8.de>,
	 Thomas Gleixner <tglx@kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	 Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,  "H. Peter Anvin" <hpa@zytor.com>,
	linux-edac@vger.kernel.org,  linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] x86/mce/intel: Skip storm tracking on CPUs without CMCI
Date: Fri, 20 Nov 2026 10:46:24 +0000	[thread overview]
Message-ID: <010001a1f8908ab7-fa522391-bf93-4fe3-9ddc-e2f3e8e43ae0-000000@email.amazonses.com> (raw)
In-Reply-To: <av_uoSlMShJiJsff@intel.com>

On Fri, Nov 20, 2026 at 02:54:25PM +0800, Chao Gao wrote:
> My understanding is that QEMU gets host memory errors only through
> SIGBUS, and the host kernel does not send SIGBUS for corrected errors.
> So QEMU never forwards corrected errors to a guest, and a guest sees
> them only when someone injects them by hand.

Yes, that's right. The guest is only where I noticed this, and the
sentence about KVM guests running into it easily is wrong: in a guest
the errors have to be injected. I'll drop it.

> Can you reproduce this on bare metal, or in a guest without manual injection?
> If not, this does not look like a practical issue to me.

No. In a guest it takes injection, and I have no Intel machine without
CMCI to try it on. Going by the SDM, that is everything before Nehalem
(06_1AH).

What I can show is that such a machine needs nothing unusual to get
there. For the first test I had set check_interval to 1 s to save time.
I ran it again with the default 300 s and one corrected error injected
into bank 9 every 2 s. mce_timer_fn() halves the poll interval after
every poll that logged something, so the polls close in on the bank by
themselves:

  uptime    next poll in
  313.8 s   150 s
  477.6 s    75 s
  552.7 s    37.5 s
  592.0 s    18.8 s
  610.8 s     9.4 s
  620.6 s     4.7 s
  625.7 s     2.3 s
  628.7 s   CPU0 BANK9 CMCI storm detected
            unchecked MSR access error: RDMSR from 0x289
            unchecked MSR access error: WRMSR to 0x289

So a bank that keeps logging corrected errors for ten minutes is
enough. I then stopped injecting. The storm ended 30 s later, and
cmci_storm_end() took bank 9 out of mce_poll_banks. An error injected
after that was still in MC9_STATUS after the next poll, which ran with
a mask of 0xfffffffffffffdff. Nothing sets that bit again on a CPU
without CMCI, so the bank that was reporting errors is the one that
stops being polled.

That last part is what d7ac083f095d ("x86/mce: Do not clear bank's poll
bit in mce_poll_banks on AMD SMCA systems") fixed for AMD. Intel CPUs
that poll because they have no CMCI still have it.

With the patch the same run has no storm and no MSR errors, and the
error injected at the end is logged by the next poll.

I think that is still worth fixing, but I agree the changelog oversold
it. Unless you or Tony would rather not have the patch, I'll send a v2
that says which CPUs are affected and how the storm is reached, without
the KVM sentence.

Thanks,
Ahmed

      reply	other threads:[~2026-11-20 10:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 18:34 Ahmed Abdelfattah via B4 Relay
2026-11-20  6:54 ` Chao Gao
2026-11-20 10:46   ` Ahmed Abdelfattah [this message]

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=010001a1f8908ab7-fa522391-bf93-4fe3-9ddc-e2f3e8e43ae0-000000@email.amazonses.com \
    --to=me@ahmedabdelfattah.dev \
    --cc=bp@alien8.de \
    --cc=chao.gao@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@kernel.org \
    --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

all inboxes | Powered by JetHome®