diff options
author | Alexey Makhalov <amakhalov@vmware.com> | 2016-10-28 03:54:31 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-10-30 03:57:07 -0400 |
commit | 91d1e54ebd1615d216b7f57324a5e69166a344e0 (patch) | |
tree | fee6e6432b3ceeda77b4aca46d65b41d85288e95 | |
parent | 687bca8d664ac9b098005b57846773eb62040ae0 (diff) |
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 <amakhalov@vmware.com>
Acked-by: Alok N Kataria <akataria@vmware.com>
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 <tglx@linutronix.de>
-rw-r--r-- | arch/x86/kernel/cpu/vmware.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c index 480790fe2463..098a524a1646 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) | |||
61 | return vmware_tsc_khz; | 61 | return vmware_tsc_khz; |
62 | } | 62 | } |
63 | 63 | ||
64 | #ifdef CONFIG_PARAVIRT | ||
65 | static void __init vmware_paravirt_ops_setup(void) | ||
66 | { | ||
67 | pv_info.name = "VMware hypervisor"; | ||
68 | pv_cpu_ops.io_delay = paravirt_nop; | ||
69 | } | ||
70 | #else | ||
71 | #define vmware_paravirt_ops_setup() do {} while (0) | ||
72 | #endif | ||
73 | |||
64 | static void __init vmware_platform_setup(void) | 74 | static void __init vmware_platform_setup(void) |
65 | { | 75 | { |
66 | uint32_t eax, ebx, ecx, edx; | 76 | uint32_t eax, ebx, ecx, edx; |
@@ -94,6 +104,8 @@ static void __init vmware_platform_setup(void) | |||
94 | } else { | 104 | } else { |
95 | pr_warn("Failed to get TSC freq from the hypervisor\n"); | 105 | pr_warn("Failed to get TSC freq from the hypervisor\n"); |
96 | } | 106 | } |
107 | |||
108 | vmware_paravirt_ops_setup(); | ||
97 | } | 109 | } |
98 | 110 | ||
99 | /* | 111 | /* |