Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751446AbbEFKOe (ORCPT ); Wed, 6 May 2015 06:14:34 -0400 Received: from terminus.zytor.com ([198.137.202.10]:40589 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750813AbbEFKOb (ORCPT ); Wed, 6 May 2015 06:14:31 -0400 Date: Wed, 6 May 2015 03:13:57 -0700 From: tip-bot for Aravind Gopalakrishnan Message-ID: Cc: jacob.w.shin@gmail.com, Aravind.Gopalakrishnan@amd.com, pbonzini@redhat.com, hpa@zytor.com, bp@alien8.de, mingo@kernel.org, bp@suse.de, tglx@linutronix.de, linux-kernel@vger.kernel.org Reply-To: tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org, bp@suse.de, hpa@zytor.com, bp@alien8.de, pbonzini@redhat.com, jacob.w.shin@gmail.com, Aravind.Gopalakrishnan@amd.com In-Reply-To: <1430148351-9013-1-git-send-email-Aravind.Gopalakrishnan@amd.com> References: <1430148351-9013-1-git-send-email-Aravind.Gopalakrishnan@amd.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/cpu] x86/cpu/amd: Set X86_FEATURE_EXTD_APICID for future processors Git-Commit-ID: b9d16a2a21aa9c264a29dd84d6f7b03581517a03 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2693 Lines: 63 Commit-ID: b9d16a2a21aa9c264a29dd84d6f7b03581517a03 Gitweb: http://git.kernel.org/tip/b9d16a2a21aa9c264a29dd84d6f7b03581517a03 Author: Aravind Gopalakrishnan AuthorDate: Mon, 27 Apr 2015 10:25:51 -0500 Committer: Ingo Molnar CommitDate: Wed, 6 May 2015 11:16:53 +0200 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 Signed-off-by: Borislav Petkov Cc: Borislav Petkov Cc: H. Peter Anvin Cc: Jacob Shin Cc: Paolo Bonzini Cc: Thomas Gleixner 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 --- arch/x86/kernel/cpu/amd.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index e4cf633..94e7051 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) set_cpu_cap(c, X86_FEATURE_K6_MTRR); #endif #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_PCI) - /* check CPU config space for extended APIC ID */ - if (cpu_has_apic && c->x86 >= 0xf) { + /* + * ApicID can always be treated as an 8-bit value for AMD APIC versions + * >= 0x10, but even old K8s came out of reset with version 0x10. So, we + * can safely set X86_FEATURE_EXTD_APICID unconditionally for families + * after 16h. + */ + if (cpu_has_apic && c->x86 > 0x16) { + set_cpu_cap(c, X86_FEATURE_EXTD_APICID); + } else if (cpu_has_apic && c->x86 >= 0xf) { + /* check CPU config space for extended APIC ID */ unsigned int val; val = read_pci_config(0, 24, 0, 0x68); if ((val & ((1 << 17) | (1 << 18))) == ((1 << 17) | (1 << 18))) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/