Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932153Ab2HVJFF (ORCPT ); Wed, 22 Aug 2012 05:05:05 -0400 Received: from terminus.zytor.com ([198.137.202.10]:40176 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756268Ab2HVJEp (ORCPT ); Wed, 22 Aug 2012 05:04:45 -0400 Date: Wed, 22 Aug 2012 02:04:19 -0700 From: tip-bot for Ido Yariv Message-ID: Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org, shai@scalemp.com, ido@wizery.com, tglx@linutronix.de Reply-To: mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, shai@scalemp.com, tglx@linutronix.de, ido@wizery.com In-Reply-To: <1344445299-22142-1-git-send-email-ido@wizery.com> References: <1344445299-22142-1-git-send-email-ido@wizery.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/platform] x86/vsmp: Use hypervisor layer for initialization Git-Commit-ID: c00679af441c5be76e195deed2c76fef65a5d102 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 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (terminus.zytor.com [127.0.0.1]); Wed, 22 Aug 2012 02:04:30 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4727 Lines: 164 Commit-ID: c00679af441c5be76e195deed2c76fef65a5d102 Gitweb: http://git.kernel.org/tip/c00679af441c5be76e195deed2c76fef65a5d102 Author: Ido Yariv AuthorDate: Wed, 8 Aug 2012 20:01:38 +0300 Committer: Ingo Molnar CommitDate: Wed, 22 Aug 2012 10:48:05 +0200 x86/vsmp: Use hypervisor layer for initialization vSMP detection and initialization could be done by the hypervisor layer, so set it up that way. This cleans up vSMP initialization. Signed-off-by: Ido Yariv Acked-by: Shai Fultheim Link: http://lkml.kernel.org/r/1344445299-22142-1-git-send-email-ido@wizery.com Signed-off-by: Ingo Molnar --- arch/x86/include/asm/hypervisor.h | 1 + arch/x86/include/asm/setup.h | 7 ------- arch/x86/kernel/cpu/hypervisor.c | 1 + arch/x86/kernel/setup.c | 2 -- arch/x86/kernel/vsmp_64.c | 27 +++++++++++++++++---------- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/arch/x86/include/asm/hypervisor.h b/arch/x86/include/asm/hypervisor.h index b518c75..eb617ae 100644 --- a/arch/x86/include/asm/hypervisor.h +++ b/arch/x86/include/asm/hypervisor.h @@ -50,6 +50,7 @@ extern const struct hypervisor_x86 x86_hyper_vmware; extern const struct hypervisor_x86 x86_hyper_ms_hyperv; extern const struct hypervisor_x86 x86_hyper_xen_hvm; extern const struct hypervisor_x86 x86_hyper_kvm; +extern const struct hypervisor_x86 x86_hyper_vsmp; static inline bool hypervisor_x2apic_available(void) { diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h index d0f19f9..a4c5b14 100644 --- a/arch/x86/include/asm/setup.h +++ b/arch/x86/include/asm/setup.h @@ -26,13 +26,6 @@ #include #include -/* Interrupt control for vSMPowered x86_64 systems */ -#ifdef CONFIG_X86_64 -void vsmp_init(void); -#else -static inline void vsmp_init(void) { } -#endif - void setup_bios_corruption_check(void); #ifdef CONFIG_X86_VISWS diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervisor.c index a8f8fa9..bcac2ff6 100644 --- a/arch/x86/kernel/cpu/hypervisor.c +++ b/arch/x86/kernel/cpu/hypervisor.c @@ -40,6 +40,7 @@ static const __initconst struct hypervisor_x86 * const hypervisors[] = #ifdef CONFIG_KVM_GUEST &x86_hyper_kvm, #endif + &x86_hyper_vsmp, }; const struct hypervisor_x86 *x86_hyper; diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index f4b9b80..f9706d1 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -943,8 +943,6 @@ void __init setup_arch(char **cmdline_p) reserve_crashkernel(); - vsmp_init(); - io_delay_init(); /* diff --git a/arch/x86/kernel/vsmp_64.c b/arch/x86/kernel/vsmp_64.c index 992f890..f655f2c 100644 --- a/arch/x86/kernel/vsmp_64.c +++ b/arch/x86/kernel/vsmp_64.c @@ -17,12 +17,14 @@ #include #include #include +#include #include #include #include #include #include +#include #define TOPOLOGY_REGISTER_OFFSET 0x10 @@ -132,17 +134,20 @@ static void __init set_vsmp_pv_ops(void) #ifdef CONFIG_PCI static int is_vsmp = -1; -static void __init detect_vsmp_box(void) +static bool __init detect_vsmp_box(void) { is_vsmp = 0; if (!early_pci_allowed()) - return; + goto out; /* Check if we are running on a ScaleMP vSMPowered box */ if (read_pci_config(0, 0x1f, 0, PCI_VENDOR_ID) == (PCI_VENDOR_ID_SCALEMP | (PCI_DEVICE_ID_SCALEMP_VSMP_CTL << 16))) is_vsmp = 1; + +out: + return is_vsmp == 1; } int is_vsmp_box(void) @@ -156,8 +161,9 @@ int is_vsmp_box(void) } #else -static void __init detect_vsmp_box(void) +static bool __init detect_vsmp_box(void) { + return false; } int is_vsmp_box(void) { @@ -221,16 +227,17 @@ static void vsmp_apic_post_init(void) apic->vector_allocation_domain = fill_vector_allocation_domain; } -void __init vsmp_init(void) +static void __init vsmp_platform_setup(void) { - detect_vsmp_box(); - if (!is_vsmp_box()) - return; - x86_platform.apic_post_init = vsmp_apic_post_init; vsmp_cap_cpus(); - set_vsmp_pv_ops(); - return; } + +const __refconst struct hypervisor_x86 x86_hyper_vsmp = { + .name = "ScaleMP vSMP Foundation", + .detect = detect_vsmp_box, + .init_platform = vsmp_platform_setup, +}; +EXPORT_SYMBOL(x86_hyper_vsmp); -- 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/