[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1541093480-10539-1-git-send-email-mikelley@microsoft.com>
Date: Thu, 1 Nov 2018 17:32:04 +0000
From: Michael Kelley <mikelley@...rosoft.com>
To: "virtualization@...ts.linux-foundation.org"
<virtualization@...ts.linux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"daniel.lezcano@...aro.org" <daniel.lezcano@...aro.org>,
"jgross@...e.com" <jgross@...e.com>,
"akataria@...are.com" <akataria@...are.com>,
"olaf@...fle.de" <olaf@...fle.de>,
"apw@...onical.com" <apw@...onical.com>,
vkuznets <vkuznets@...hat.com>,
"jasowang@...hat.com" <jasowang@...hat.com>,
"marcelo.cerri@...onical.com" <marcelo.cerri@...onical.com>,
KY Srinivasan <kys@...rosoft.com>
CC: Michael Kelley <mikelley@...rosoft.com>
Subject: [PATCH 1/2] include/linux/hypervisor.h: Add test for running on
Hyper-V
Add a test for running on Hyper-V on x86/x64.
Signed-off-by: Michael Kelley <mikelley@...rosoft.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
Powered by blists - more mailing lists