mirror of
https://github.com/torvalds/linux.git
synced 2024-11-17 09:31:50 +00:00
x86/amd: Re-enable CPU topology extensions in case BIOS has disabled it
BIOS will switch off the corresponding feature flag on family 15h models 10h-1fh non-desktop CPUs. The topology extension CPUID leafs are required to detect which cores belong to the same compute unit. (thread siblings mask is set accordingly and also correct information about L1i and L2 cache sharing depends on this). W/o this patch we wouldn't see which cores belong to the same compute unit and also cache sharing information for L1i and L2 would be incorrect on such systems. Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
ea0dcf903e
commit
f7f286a910
@ -580,6 +580,24 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
|
||||
}
|
||||
}
|
||||
|
||||
/* re-enable TopologyExtensions if switched off by BIOS */
|
||||
if ((c->x86 == 0x15) &&
|
||||
(c->x86_model >= 0x10) && (c->x86_model <= 0x1f) &&
|
||||
!cpu_has(c, X86_FEATURE_TOPOEXT)) {
|
||||
u64 val;
|
||||
|
||||
if (!rdmsrl_amd_safe(0xc0011005, &val)) {
|
||||
val |= 1ULL << 54;
|
||||
wrmsrl_amd_safe(0xc0011005, val);
|
||||
rdmsrl(0xc0011005, val);
|
||||
if (val & (1ULL << 54)) {
|
||||
set_cpu_cap(c, X86_FEATURE_TOPOEXT);
|
||||
printk(KERN_INFO FW_INFO "CPU: Re-enabling "
|
||||
"disabled Topology Extensions Support\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cpu_detect_cache_sizes(c);
|
||||
|
||||
/* Multi core CPU? */
|
||||
|
Loading…
Reference in New Issue
Block a user