<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/kernel/cpu/mce/intel.c, branch linux-6.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-07-17T16:43:44Z</updated>
<entry>
<title>x86/mce: Make sure CMCI banks are cleared during shutdown on Intel</title>
<updated>2025-07-17T16:43:44Z</updated>
<author>
<name>JP Kobryn</name>
</author>
<published>2025-06-27T17:49:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=22f6f2e56437e22c0dc3971ef5b947f950e69db2'/>
<id>urn:sha1:22f6f2e56437e22c0dc3971ef5b947f950e69db2</id>
<content type='text'>
commit 30ad231a5029bfa16e46ce868497b1a5cdd3c24d upstream.

CMCI banks are not cleared during shutdown on Intel CPUs. As a side effect,
when a kexec is performed, CPUs coming back online are unable to
rediscover/claim these occupied banks which breaks MCE reporting.

Clear the CPU ownership during shutdown via cmci_clear() so the banks can
be reclaimed and MCE reporting will become functional once more.

  [ bp: Massage commit message. ]

Reported-by: Aijay Adams &lt;aijay@meta.com&gt;
Signed-off-by: JP Kobryn &lt;inwardvessel@gmail.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Reviewed-by: Tony Luck &lt;tony.luck@intel.com&gt;
Reviewed-by: Qiuxu Zhuo &lt;qiuxu.zhuo@intel.com&gt;
Cc: &lt;stable@kernel.org&gt;
Link: https://lore.kernel.org/20250627174935.95194-1-inwardvessel@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>x86/mce: Make several functions return bool</title>
<updated>2024-12-30T18:05:50Z</updated>
<author>
<name>Qiuxu Zhuo</name>
</author>
<published>2024-12-12T14:00:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c845cb8dbd2e1a804babfd13648026c3a7cfbc0b'/>
<id>urn:sha1:c845cb8dbd2e1a804babfd13648026c3a7cfbc0b</id>
<content type='text'>
Make several functions that return 0 or 1 return a boolean value for
better readability.

No functional changes are intended.

Signed-off-by: Qiuxu Zhuo &lt;qiuxu.zhuo@intel.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Reviewed-by: Tony Luck &lt;tony.luck@intel.com&gt;
Reviewed-by: Nikolay Borisov &lt;nik.borisov@suse.com&gt;
Reviewed-by: Sohil Mehta &lt;sohil.mehta@intel.com&gt;
Reviewed-by: Yazen Ghannam &lt;yazen.ghannam@amd.com&gt;
Link: https://lore.kernel.org/r/20241212140103.66964-2-qiuxu.zhuo@intel.com
</content>
</entry>
<entry>
<title>x86/mce/intel: Use MCG_BANKCNT_MASK instead of 0xff</title>
<updated>2024-10-28T13:27:34Z</updated>
<author>
<name>Qiuxu Zhuo</name>
</author>
<published>2024-10-25T02:45:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=754269ccf03d68da15b9e5cdd26a6464b81cec67'/>
<id>urn:sha1:754269ccf03d68da15b9e5cdd26a6464b81cec67</id>
<content type='text'>
Use the predefined MCG_BANKCNT_MASK macro instead of the hardcoded
0xff to mask the bank number bits.

No functional changes intended.

Signed-off-by: Qiuxu Zhuo &lt;qiuxu.zhuo@intel.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Reviewed-by: Tony Luck &lt;tony.luck@intel.com&gt;
Reviewed-by: Nikolay Borisov &lt;nik.borisov@suse.com&gt;
Reviewed-by: Sohil Mehta &lt;sohil.mehta@intel.com&gt;
Link: https://lore.kernel.org/r/20241025024602.24318-3-qiuxu.zhuo@intel.com
</content>
</entry>
<entry>
<title>x86/mce: Switch to new Intel CPU model defines</title>
<updated>2024-04-29T08:31:23Z</updated>
<author>
<name>Tony Luck</name>
</author>
<published>2024-04-24T18:15:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4a5f2dd162fd68f588784eb9b0a927e3b328736d'/>
<id>urn:sha1:4a5f2dd162fd68f588784eb9b0a927e3b328736d</id>
<content type='text'>
New CPU #defines encode vendor and family as well as model.

  [ bp: Squash *three* mce patches into one, fold in fix:
    https://lore.kernel.org/r/20240429022051.63360-1-tony.luck@intel.com ]

Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Link: https://lore.kernel.org/all/20240424181511.41772-1-tony.luck%40intel.com
</content>
</entry>
<entry>
<title>x86/mce: Handle Intel threshold interrupt storms</title>
<updated>2023-12-15T13:53:42Z</updated>
<author>
<name>Tony Luck</name>
</author>
<published>2023-11-15T19:54:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1f68ce2a027250aeeb1756391110cdc4dc97c797'/>
<id>urn:sha1:1f68ce2a027250aeeb1756391110cdc4dc97c797</id>
<content type='text'>
Add an Intel specific hook into machine_check_poll() to keep track of
per-CPU, per-bank corrected error logs (with a stub for the
CONFIG_MCE_INTEL=n case).

When a storm is observed the rate of interrupts is reduced by setting
a large threshold value for this bank in IA32_MCi_CTL2. This bank is
added to the bitmap of banks for this CPU to poll. The polling rate is
increased to once per second.

When a storm ends reset the threshold in IA32_MCi_CTL2 back to 1, remove
the bank from the bitmap for polling, and change the polling rate back
to the default.

If a CPU with banks in storm mode is taken offline, the new CPU that
inherits ownership of those banks takes over management of storm(s) in
the inherited bank(s).

The cmci_discover() function was already very large. These changes
pushed it well over the top. Refactor with three helper functions to
bring it back under control.

Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Link: https://lore.kernel.org/r/20231115195450.12963-4-tony.luck@intel.com
</content>
</entry>
<entry>
<title>x86/mce: Remove old CMCI storm mitigation code</title>
<updated>2023-12-15T12:44:12Z</updated>
<author>
<name>Tony Luck</name>
</author>
<published>2023-11-15T19:54:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3ed57b41a4125609e9fd03e32228aec61d95fe1f'/>
<id>urn:sha1:3ed57b41a4125609e9fd03e32228aec61d95fe1f</id>
<content type='text'>
When a "storm" of corrected machine check interrupts (CMCI) is detected
this code mitigates by disabling CMCI interrupt signalling from all of
the banks owned by the CPU that saw the storm.

There are problems with this approach:

1) It is very coarse grained. In all likelihood only one of the banks
   was generating the interrupts, but CMCI is disabled for all.  This
   means Linux may delay seeing and processing errors logged from other
   banks.

2) Although CMCI stands for Corrected Machine Check Interrupt, it is
   also used to signal when an uncorrected error is logged. This is
   a problem because these errors should be handled in a timely manner.

Delete all this code in preparation for a finer grained solution.

Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Reviewed-by: Yazen Ghannam &lt;yazen.ghannam@amd.com&gt;
Tested-by: Yazen Ghannam &lt;yazen.ghannam@amd.com&gt;
Link: https://lore.kernel.org/r/20231115195450.12963-2-tony.luck@intel.com
</content>
</entry>
<entry>
<title>x86/mce: Cleanup mce_usable_address()</title>
<updated>2023-10-16T13:37:01Z</updated>
<author>
<name>Yazen Ghannam</name>
</author>
<published>2023-06-13T14:11:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1bae0cfe4a171ccc5f731426296e45beafa096b8'/>
<id>urn:sha1:1bae0cfe4a171ccc5f731426296e45beafa096b8</id>
<content type='text'>
Move Intel-specific checks into a helper function.

Explicitly use "bool" for return type.

No functional change intended.

Signed-off-by: Yazen Ghannam &lt;yazen.ghannam@amd.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Link: https://lore.kernel.org/r/20230613141142.36801-4-yazen.ghannam@amd.com
</content>
</entry>
<entry>
<title>x86/mce: Prevent duplicate error records</title>
<updated>2023-07-21T16:55:46Z</updated>
<author>
<name>Borislav Petkov (AMD)</name>
</author>
<published>2023-07-19T12:19:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c3629dd7e67d6ec5705d33b0de0d142c972fe573'/>
<id>urn:sha1:c3629dd7e67d6ec5705d33b0de0d142c972fe573</id>
<content type='text'>
A legitimate use case of the MCA infrastructure is to have the firmware
log all uncorrectable errors and also, have the OS see all correctable
errors.

The uncorrectable, UCNA errors are usually configured to be reported
through an SMI. CMCI, which is the correctable error reporting
interrupt, uses SMI too and having both enabled, leads to unnecessary
overhead.

So what ends up happening is, people disable CMCI in the wild and leave
on only the UCNA SMI.

When CMCI is disabled, the MCA infrastructure resorts to polling the MCA
banks. If a MCA MSR is shared between the logical threads, one error
ends up getting logged multiple times as the polling runs on every
logical thread.

Therefore, introduce locking on the Intel side of the polling routine to
prevent such duplicate error records from appearing.

Based on a patch by Aristeu Rozanski &lt;aris@ruivo.org&gt;.

Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Tested-by: Tony Luck &lt;tony.luck@intel.com&gt;
Acked-by: Aristeu Rozanski &lt;aris@ruivo.org&gt;
Link: https://lore.kernel.org/r/20230515143225.GC4090740@cathedrallabs.org
</content>
</entry>
<entry>
<title>x86/cpu: Merge Intel and AMD ppin_init() functions</title>
<updated>2022-02-01T11:56:23Z</updated>
<author>
<name>Tony Luck</name>
</author>
<published>2022-01-31T23:01:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0dcab41d3487acadf64d0667398e032341bd9918'/>
<id>urn:sha1:0dcab41d3487acadf64d0667398e032341bd9918</id>
<content type='text'>
The code to decide whether a system supports the PPIN (Protected
Processor Inventory Number) MSR was cloned from the Intel
implementation. Apart from the X86_FEATURE bit and the MSR numbers it is
identical.

Merge the two functions into common x86 code, but use x86_match_cpu()
instead of the switch (c-&gt;x86_model) that was used by the old Intel
code.

No functional change.

Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Link: https://lore.kernel.org/r/20220131230111.2004669-2-tony.luck@intel.com
</content>
</entry>
<entry>
<title>x86/cpu: Add Xeon Icelake-D to list of CPUs that support PPIN</title>
<updated>2022-01-25T17:40:30Z</updated>
<author>
<name>Tony Luck</name>
</author>
<published>2022-01-21T17:47:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e464121f2d40eabc7d11823fb26db807ce945df4'/>
<id>urn:sha1:e464121f2d40eabc7d11823fb26db807ce945df4</id>
<content type='text'>
Missed adding the Icelake-D CPU to the list. It uses the same MSRs
to control and read the inventory number as all the other models.

Fixes: dc6b025de95b ("x86/mce: Add Xeon Icelake to list of CPUs that support PPIN")
Reported-by: Ailin Xu &lt;ailin.xu@intel.com&gt;
Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20220121174743.1875294-2-tony.luck@intel.com
</content>
</entry>
</feed>
