diff mbox series

[for-next,6/7] x86/hyperv: provide hyperv_guest variable

Message ID 20191025091618.10153-7-liuwe@microsoft.com (mailing list archive)
State Superseded
Headers show
Series Implement Hyper-V reference TSC based clock source | expand

Commit Message

Wei Liu Oct. 25, 2019, 9:16 a.m. UTC
It will be used to gate Hyper-V related code outside of the guest
directory.

No functional change.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
---
 xen/arch/x86/guest/hyperv/hyperv.c | 3 +++
 xen/include/asm-x86/guest/hyperv.h | 2 ++
 2 files changed, 5 insertions(+)

Comments

Jan Beulich Dec. 10, 2019, 4:39 p.m. UTC | #1
On 25.10.2019 11:16, Wei Liu wrote:
> --- a/xen/arch/x86/guest/hyperv/hyperv.c
> +++ b/xen/arch/x86/guest/hyperv/hyperv.c
> @@ -24,6 +24,7 @@
>  #include <asm/guest/hyperv-tlfs.h>
>  
>  struct ms_hyperv_info ms_hyperv;
> +bool hyperv_guest;

With __read_mostly added here (perhaps also in the earlier
patch for the adjacent one)
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan
diff mbox series

Patch

diff --git a/xen/arch/x86/guest/hyperv/hyperv.c b/xen/arch/x86/guest/hyperv/hyperv.c
index 041166f344..ee649426ce 100644
--- a/xen/arch/x86/guest/hyperv/hyperv.c
+++ b/xen/arch/x86/guest/hyperv/hyperv.c
@@ -24,6 +24,7 @@ 
 #include <asm/guest/hyperv-tlfs.h>
 
 struct ms_hyperv_info ms_hyperv;
+bool hyperv_guest;
 
 bool __init hyperv_probe(void)
 {
@@ -50,6 +51,8 @@  bool __init hyperv_probe(void)
     ms_hyperv.max_vp_index = cpuid_eax(HYPERV_CPUID_IMPLEMENT_LIMITS);
     ms_hyperv.max_lp_index = cpuid_ebx(HYPERV_CPUID_IMPLEMENT_LIMITS);
 
+    hyperv_guest = true;
+
     return true;
 }
 
diff --git a/xen/include/asm-x86/guest/hyperv.h b/xen/include/asm-x86/guest/hyperv.h
index 0f8800040a..86f5c24ec6 100644
--- a/xen/include/asm-x86/guest/hyperv.h
+++ b/xen/include/asm-x86/guest/hyperv.h
@@ -35,6 +35,8 @@  struct ms_hyperv_info {
 };
 extern struct ms_hyperv_info ms_hyperv;
 
+extern bool hyperv_guest;
+
 extern struct hypervisor_ops hyperv_ops;
 
 bool hyperv_probe(void);