]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
x86/cpu: Fix PPIN initialization
authorTony Luck <tony.luck@intel.com>
Fri, 22 Nov 2024 23:42:12 +0000 (15:42 -0800)
committerIngo Molnar <mingo@kernel.org>
Mon, 25 Nov 2024 09:11:33 +0000 (10:11 +0100)
On systems that enumerate PPIN (protected processor inventory
number) using CPUID, but where the BIOS locked the MSR to
prevent access /proc/cpuinfo reports "intel_ppin" feature as
present on all logical CPUs except for CPU 0.

This happens because ppin_init() uses x86_match_cpu() to
determine whether PPIN is supported. When called on CPU 0
the test for locked PPIN MSR results in:

clear_cpu_cap(c, info->feature);

This clears the X86 FEATURE bit in boot_cpu_data. When other
CPUs are brought online the x86_match_cpu() fails, and the
PPIN FEATURE bit remains set for those other CPUs.

Fix by using setup_clear_cpu_cap() instead of clear_cpu_cap()
which force clears the FEATURE bit for all CPUS.

Reported-by: Adeel Ashad <adeel.arshad@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20241122234212.27451-1-tony.luck@intel.com
arch/x86/kernel/cpu/common.c

index 06a516f6795b313661959a185811a96e23d64c31..d9d2d1915491169c0687cd5298478cfc2cad0902 100644 (file)
@@ -169,7 +169,7 @@ static void ppin_init(struct cpuinfo_x86 *c)
        }
 
 clear_ppin:
-       clear_cpu_cap(c, info->feature);
+       setup_clear_cpu_cap(info->feature);
 }
 
 static void default_init(struct cpuinfo_x86 *c)