Skip to content

Commit 4d872d5

Browse files
committed
Merge tag 'x86-urgent-2025-03-10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar: - 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 * tag 'x86-urgent-2025-03-10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/microcode/AMD: Fix out-of-bounds on systems with CPU-less NUMA nodes x86/sgx: Warn explicitly if X86_FEATURE_SGX_LC is not enabled
2 parents 80e54e8 + e3e8917 commit 4d872d5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

arch/x86/kernel/cpu/microcode/amd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ static enum ucode_state load_microcode_amd(u8 family, const u8 *data, size_t siz
10741074
if (ret != UCODE_OK)
10751075
return ret;
10761076

1077-
for_each_node(nid) {
1077+
for_each_node_with_cpus(nid) {
10781078
cpu = cpumask_first(cpumask_of_node(nid));
10791079
c = &cpu_data(cpu);
10801080

arch/x86/kernel/cpu/sgx/driver.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,15 @@ int __init sgx_drv_init(void)
150150
u64 xfrm_mask;
151151
int ret;
152152

153-
if (!cpu_feature_enabled(X86_FEATURE_SGX_LC))
153+
if (!cpu_feature_enabled(X86_FEATURE_SGX_LC)) {
154+
pr_info("SGX disabled: SGX launch control CPU feature is not available, /dev/sgx_enclave disabled.\n");
154155
return -ENODEV;
156+
}
155157

156158
cpuid_count(SGX_CPUID, 0, &eax, &ebx, &ecx, &edx);
157159

158160
if (!(eax & 1)) {
159-
pr_err("SGX disabled: SGX1 instruction support not available.\n");
161+
pr_info("SGX disabled: SGX1 instruction support not available, /dev/sgx_enclave disabled.\n");
160162
return -ENODEV;
161163
}
162164

@@ -173,8 +175,10 @@ int __init sgx_drv_init(void)
173175
}
174176

175177
ret = misc_register(&sgx_dev_enclave);
176-
if (ret)
178+
if (ret) {
179+
pr_info("SGX disabled: Unable to register the /dev/sgx_enclave driver (%d).\n", ret);
177180
return ret;
181+
}
178182

179183
return 0;
180184
}

0 commit comments

Comments
 (0)