Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759005AbcJ1HzQ (ORCPT ); Fri, 28 Oct 2016 03:55:16 -0400 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:24906 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755752AbcJ1Hyw (ORCPT ); Fri, 28 Oct 2016 03:54:52 -0400 From: Alexey Makhalov To: , , , , , CC: , , , , Alexey Makhalov Subject: [PATCH v3 2/3] x86/vmware: Add basic paravirt ops support Date: Fri, 28 Oct 2016 00:54:31 -0700 Message-ID: <20161028075432.90579-3-amakhalov@vmware.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161028075432.90579-1-amakhalov@vmware.com> References: <20161028075432.90579-1-amakhalov@vmware.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1257 Lines: 45 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_nop() to avoid vm-exits on IO delays. Signed-off-by: Alexey Makhalov Acked-by: Alok N Kataria --- 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(); } /* -- 2.10.1