aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>2015-04-27 11:25:51 -0400
committerIngo Molnar <mingo@kernel.org>2015-05-06 05:16:53 -0400
commitb9d16a2a21aa9c264a29dd84d6f7b03581517a03 (patch)
treed19e817b13e27e6aece2af7ce78d259e3273166d
parent1b4574292e9d2d37b3bb437c9e778fd2bba8e170 (diff)
x86/cpu/amd: Set X86_FEATURE_EXTD_APICID for future processors
Decision to use a 4-bit mask or 8-bit mask in default_get_apic_id() is controlled by setting capability bit X86_FEATURE_EXTD_APICID. Currently, we detect extended APIC ID support by accessing Link Transaction Control register D18F0x68 in PCI config space. But, not even that is needed as we can safely postulate that future AMD processors will support 8-bit APIC IDs and we can simply set that feature bit on them, without the PCI access. Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com> Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Borislav Petkov <bp@alien8.de> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Jacob Shin <jacob.w.shin@gmail.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: dave.hansen@linux.intel.com Cc: hecmargi@upv.es Cc: mgorman@suse.de Link: http://lkml.kernel.org/r/1430148351-9013-1-git-send-email-Aravind.Gopalakrishnan@amd.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/kernel/cpu/amd.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index e4cf63301ff4..94e7051fba1a 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -520,8 +520,16 @@ static void early_init_amd(struct cpuinfo_x86 *c)
520 set_cpu_cap(c, X86_FEATURE_K6_MTRR); 520 set_cpu_cap(c, X86_FEATURE_K6_MTRR);
521#endif 521#endif
522#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_PCI) 522#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_PCI)
523 /* check CPU config space for extended APIC ID */ 523 /*
524 if (cpu_has_apic && c->x86 >= 0xf) { 524 * ApicID can always be treated as an 8-bit value for AMD APIC versions
525 * >= 0x10, but even old K8s came out of reset with version 0x10. So, we
526 * can safely set X86_FEATURE_EXTD_APICID unconditionally for families
527 * after 16h.
528 */
529 if (cpu_has_apic && c->x86 > 0x16) {
530 set_cpu_cap(c, X86_FEATURE_EXTD_APICID);
531 } else if (cpu_has_apic && c->x86 >= 0xf) {
532 /* check CPU config space for extended APIC ID */
525 unsigned int val; 533 unsigned int val;
526 val = read_pci_config(0, 24, 0, 0x68); 534 val = read_pci_config(0, 24, 0, 0x68);
527 if ((val & ((1 << 17) | (1 << 18))) == ((1 << 17) | (1 << 18))) 535 if ((val & ((1 << 17) | (1 << 18))) == ((1 << 17) | (1 << 18)))