All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] include/linux/hypervisor.h: Add test for running on Hyper-V
@ 2018-11-01 17:32 Michael Kelley
  0 siblings, 0 replies; only message in thread
From: Michael Kelley @ 2018-11-01 17:32 UTC (permalink / raw)
  To: virtualization, linux-kernel, tglx, daniel.lezcano, jgross,
	akataria, olaf, apw, vkuznets, jasowang, marcelo.cerri,
	KY Srinivasan
  Cc: Michael Kelley

Add a test for running on Hyper-V on x86/x64.

Signed-off-by: Michael Kelley <mikelley@microsoft.com>
---
 include/linux/hypervisor.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/linux/hypervisor.h b/include/linux/hypervisor.h
index fc08b43..1281f62 100644
--- a/include/linux/hypervisor.h
+++ b/include/linux/hypervisor.h
@@ -9,6 +9,7 @@
 
 #ifdef CONFIG_X86
 
+#include <asm/hypervisor.h>
 #include <asm/jailhouse_para.h>
 #include <asm/x86_init.h>
 
@@ -17,6 +18,11 @@ static inline void hypervisor_pin_vcpu(int cpu)
 	x86_platform.hyper.pin_vcpu(cpu);
 }
 
+static inline bool hypervisor_is_mshyperv(void)
+{
+	return hypervisor_is_type(X86_HYPER_MS_HYPERV);
+}
+
 #else /* !CONFIG_X86 */
 
 #include <linux/of.h>
@@ -30,6 +36,11 @@ static inline bool jailhouse_paravirt(void)
 	return of_find_compatible_node(NULL, NULL, "jailhouse,cell");
 }
 
+static inline bool hypervisor_is_mshyperv(void)
+{
+	return false;
+}
+
 #endif /* !CONFIG_X86 */
 
 #endif /* __LINUX_HYPEVISOR_H */
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-11-01 17:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-01 17:32 [PATCH 1/2] include/linux/hypervisor.h: Add test for running on Hyper-V Michael Kelley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.