Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756601AbcJaBXH (ORCPT ); Sun, 30 Oct 2016 21:23:07 -0400 Received: from terminus.zytor.com ([198.137.202.10]:46194 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933373AbcJaBSC (ORCPT ); Sun, 30 Oct 2016 21:18:02 -0400 Date: Sun, 30 Oct 2016 18:17:52 -0700 From: tip-bot for Alexey Makhalov Message-ID: Cc: amakhalov@vmware.com, linux-kernel@vger.kernel.org, mingo@kernel.org, akataria@vmware.com, hpa@zytor.com, tglx@linutronix.de Reply-To: tglx@linutronix.de, akataria@vmware.com, hpa@zytor.com, mingo@kernel.org, linux-kernel@vger.kernel.org, amakhalov@vmware.com In-Reply-To: <20161028075432.90579-3-amakhalov@vmware.com> References: <20161028075432.90579-3-amakhalov@vmware.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/platform] x86/vmware: Add basic paravirt ops support Git-Commit-ID: 91d1e54ebd1615d216b7f57324a5e69166a344e0 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: 1903 Lines: 61 Commit-ID: 91d1e54ebd1615d216b7f57324a5e69166a344e0 Gitweb: http://git.kernel.org/tip/91d1e54ebd1615d216b7f57324a5e69166a344e0 Author: Alexey Makhalov AuthorDate: Fri, 28 Oct 2016 00:54:31 -0700 Committer: Thomas Gleixner CommitDate: Sun, 30 Oct 2016 08:57:07 +0100 x86/vmware: Add basic paravirt ops support Add basic paravirt support: 1. Set pv_info.name to "VMware hypervisor" to have proper boot log message Booting paravirtualized kernel on VMware hypervisor instead of "... on bare hardware" 2. Set pv_cpu_ops.io_delay() to empty function - paravirt_noop() to avoid vm-exits on IO delays because io delays they are not required. Signed-off-by: Alexey Makhalov Acked-by: Alok N Kataria Cc: linux-doc@vger.kernel.org Cc: pv-drivers@vmware.com Cc: corbet@lwn.net Cc: virtualization@lists.linux-foundation.org Link: http://lkml.kernel.org/r/20161028075432.90579-3-amakhalov@vmware.com Signed-off-by: Thomas Gleixner --- arch/x86/kernel/cpu/vmware.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c index 480790f..098a524 100644 --- a/arch/x86/kernel/cpu/vmware.c +++ b/arch/x86/kernel/cpu/vmware.c @@ -61,6 +61,16 @@ static unsigned long vmware_get_tsc_khz(void) return vmware_tsc_khz; } +#ifdef CONFIG_PARAVIRT +static void __init vmware_paravirt_ops_setup(void) +{ + pv_info.name = "VMware hypervisor"; + pv_cpu_ops.io_delay = paravirt_nop; +} +#else +#define vmware_paravirt_ops_setup() do {} while (0) +#endif + static void __init vmware_platform_setup(void) { uint32_t eax, ebx, ecx, edx; @@ -94,6 +104,8 @@ static void __init vmware_platform_setup(void) } else { pr_warn("Failed to get TSC freq from the hypervisor\n"); } + + vmware_paravirt_ops_setup(); } /*