Merge tag 'x86_urgent_for_7.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Dave Hansen:
 "These are fixes for some older AMD device topology and machine check
  issues. But, they are issues that are affecting real users and aren't
  just cleaning up AI drive-by reports.

  These is coming a wee bit later than the usual Sundays because of a
  late breaking issue with one of the patches which is now temporarily
  kicked out"

* tag 'x86_urgent_for_7.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/MCE/AMD: Fix inverted interrupt enablement during storm handling
  x86/amd_node: Fix potential NULL pointer dereference
  x86/amd_node: Avoid divide by zero on virtualized systems
This commit is contained in:
Linus Torvalds
2026-09-08 12:54:56 -07:00
2 changed files with 14 additions and 7 deletions
+13 -6
View File
@@ -38,7 +38,6 @@ static struct pci_dev **amd_roots;
/* Protect the PCI config register pairs used for SMN. */
static DEFINE_MUTEX(smn_mutex);
static bool smn_exclusive;
#define SMN_INDEX_OFFSET 0x60
#define SMN_DATA_OFFSET 0x64
@@ -91,11 +90,16 @@ static int __amd_smn_rw(u8 i_off, u8 d_off, u16 node, u32 address, u32 *value, b
if (node >= amd_num_nodes())
return err;
root = amd_roots[node];
if (!root)
/*
* Uninitialized amd_roots indicates pci_request_config_region_exclusive()
* didn't run or failed and thus the kernel cannot rely on having
* exclusive access to SMN registers so prevent that.
*/
if (!amd_roots)
return err;
if (!smn_exclusive)
root = amd_roots[node];
if (!root)
return err;
guard(mutex)(&smn_mutex);
@@ -287,6 +291,11 @@ static int __init amd_smn_init(void)
return -ENOMEM;
roots_per_node = num_roots / num_nodes;
if (!roots_per_node) {
if (!cpu_feature_enabled(X86_FEATURE_HYPERVISOR))
pr_warn(FW_BUG "Error detecting roots per node.\n");
roots_per_node = 1;
}
count = 0;
node = 0;
@@ -308,8 +317,6 @@ static int __init amd_smn_init(void)
debugfs_create_file("value", 0600, debugfs_dir, NULL, &smn_value_fops);
}
smn_exclusive = true;
return 0;
}
+1 -1
View File
@@ -865,7 +865,7 @@ static void amd_deferred_error_interrupt(void)
void mce_amd_handle_storm(unsigned int bank, bool on)
{
threshold_restart_bank(bank, on);
threshold_restart_bank(bank, !on);
}
static void amd_reset_thr_limit(unsigned int bank)