Skip to contentSkip to conversation

x86 fixes

GIT PULL Merged Ingo Molnar 2 participants 2 messages Mar 10, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest x86/urgent Git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-2025-03-10

# HEAD: e3e89178a9f4a80092578af3ff3c8478f9187d59 x86/microcode/AMD: Fix out-of-bounds on systems with CPU-less NUMA nodes

Two x86 fixes:

- Fix out-of-bounds access on CPU-less AMD NUMA systems by the microcode code.

- Make the kernel SGX CPU init code less passive-aggressive about non-working SGX features, instead of silently keeping the driver disabled, this is something people are running into. This doesn't affect functionality, it's a sysadmin QoL fix.

Thanks,

Ingo

------------------>
Florent Revest (1):
x86/microcode/AMD: Fix out-of-bounds on systems with CPU-less NUMA nodes

Vladis Dronov (1):
x86/sgx: Warn explicitly if X86_FEATURE_SGX_LC is not enabled

 arch/x86/kernel/cpu/microcode/amd.c |  2 +-
 arch/x86/kernel/cpu/sgx/driver.c    | 10 +++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)
arch/x86/kernel/cpu/microcode/amd.c +1 -1
index c69b1bc45483..138689b8e1d8 100644
@@ -1074,7 +1074,7 @@ static enum ucode_state load_microcode_amd(u8 family, const u8 *data, size_t siz
 	if (ret != UCODE_OK)
 		return ret;
 
-	for_each_node(nid) {
+	for_each_node_with_cpus(nid) {
 		cpu = cpumask_first(cpumask_of_node(nid));
 		c = &cpu_data(cpu);
 
arch/x86/kernel/cpu/sgx/driver.c +7 -3
index 22b65a5f5ec6..7f8d1e11dbee 100644
@@ -150,13 +150,15 @@ int __init sgx_drv_init(void)
 	u64 xfrm_mask;
 	int ret;
 
-	if (!cpu_feature_enabled(X86_FEATURE_SGX_LC))
+	if (!cpu_feature_enabled(X86_FEATURE_SGX_LC)) {
+		pr_info("SGX disabled: SGX launch control CPU feature is not available, /dev/sgx_enclave disabled.\n");
 		return -ENODEV;
+	}
 
 	cpuid_count(SGX_CPUID, 0, &eax, &ebx, &ecx, &edx);
 
 	if (!(eax & 1))  {
-		pr_err("SGX disabled: SGX1 instruction support not available.\n");
+		pr_info("SGX disabled: SGX1 instruction support not available, /dev/sgx_enclave disabled.\n");
 		return -ENODEV;
 	}
 
@@ -173,8 +175,10 @@ int __init sgx_drv_init(void)
 	}
 
 	ret = misc_register(&sgx_dev_enclave);
-	if (ret)
+	if (ret) {
+		pr_info("SGX disabled: Unable to register the /dev/sgx_enclave driver (%d).\n", ret);
 		return ret;
+	}
 
 	return 0;
 }
merge bot Merged
#1 lore raw
The pull request you sent on Mon, 10 Mar 2025 20:57:34 +0100:

The pull request you sent on Mon, 10 Mar 2025 20:57:34 +0100:

Quoted 1 line

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-2025-03-10

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/4d872d51bc9d7b899c1f61534e3dbde72613f627

Thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html