[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH for-next RFC 6/8] x86: make probe_xen return boolean value



We need indication whether it has succeeded or not.

Signed-off-by: Wei Liu <liuwe@xxxxxxxxxxxxx>
---
 xen/arch/x86/guest/hypervisor.c | 5 ++++-
 xen/arch/x86/guest/xen/xen.c    | 7 ++++---
 xen/include/asm-x86/guest/xen.h | 4 ++--
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/guest/hypervisor.c b/xen/arch/x86/guest/hypervisor.c
index b0a724bf13..fb572b0402 100644
--- a/xen/arch/x86/guest/hypervisor.c
+++ b/xen/arch/x86/guest/hypervisor.c
@@ -34,7 +34,10 @@ void __init probe_hypervisor(void)
     if ( !(cpuid_ecx(1) & cpufeat_mask(X86_FEATURE_HYPERVISOR)) )
         return;
 
-    probe_xen();
+    if ( probe_xen() )
+        return;
+
+    /* Hyper-V probing to follow. */
 }
 
 static void __init init_memmap(void)
diff --git a/xen/arch/x86/guest/xen/xen.c b/xen/arch/x86/guest/xen/xen.c
index a730e6ad1b..8390b045f0 100644
--- a/xen/arch/x86/guest/xen/xen.c
+++ b/xen/arch/x86/guest/xen/xen.c
@@ -66,20 +66,21 @@ static void __init find_xen_leaves(void)
     }
 }
 
-void __init probe_xen(void)
+bool __init probe_xen(void)
 {
     if ( xen_guest )
-        return;
+        return true;
 
     find_xen_leaves();
 
     if ( !xen_cpuid_base )
-        return;
+        return false;
 
     /* Fill the hypercall page. */
     wrmsrl(cpuid_ebx(xen_cpuid_base + 2), __pa(hypercall_page));
 
     xen_guest = true;
+    return true;
 }
 
 static void map_shared_info(void)
diff --git a/xen/include/asm-x86/guest/xen.h b/xen/include/asm-x86/guest/xen.h
index d031f1f70d..7eda3d4956 100644
--- a/xen/include/asm-x86/guest/xen.h
+++ b/xen/include/asm-x86/guest/xen.h
@@ -32,7 +32,7 @@ extern bool xen_guest;
 extern bool pv_console;
 extern uint32_t xen_cpuid_base;
 
-void probe_xen(void);
+bool probe_xen(void);
 void xen_setup(void);
 void xen_ap_setup(void);
 void xen_resume(void);
@@ -45,7 +45,7 @@ DECLARE_PER_CPU(struct vcpu_info *, vcpu_info);
 #define xen_guest 0
 #define pv_console 0
 
-static inline void probe_xen(void) {}
+static inline bool probe_xen(void) { return false; }
 
 #endif /* CONFIG_XEN_GUEST */
 #endif /* __X86_GUEST_XEN_H__ */
-- 
2.20.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.