Skip to content

Commit

Permalink
x86/cpu: Fix PPIN initialization
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Tony Luck authored and Ingo Molnar committed Nov 25, 2024
1 parent be42022 commit d9bb405
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kernel/cpu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d9bb405

Please sign in to comment.