Thread (1 message) 1 message, 1 author, 2016-10-26

[PATCH 2/3] x86/vmware: Add basic paravirt ops support

DORMANTno replies SUPERSEDED: 1 (0M)

From: Alexey Makhalov <hidden>
Date: 2016-10-26 05:26:00
Subsystem: the rest, vmware hypervisor interface, x86 architecture (32-bit and 64-bit) · Maintainers: Linus Torvalds, Ajay Kaher, Alexey Makhalov, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen

Revision v1 of 4 in this series; 1 review trailer.

Revisions (4)
  1. v1 current
  2. v1
  3. v3 [diff vs current]
  4. v3 [diff vs current]

Possibly related (same subject, not in this thread)

Add basic paravirt support:
 1. set pv_info.name to "VMware" to have proper boot log message
	Booting paravirtualized kernel on VMware
    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 <redacted>
Acked-by: Alok N Kataria <redacted>
---
 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..e3fb320 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";
+	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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help