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

[Xen-devel] [PATCH for-next RFC 4/8] x86: factor out xen variants for hypervisor setup code



We will add Hyper-V specific implementations in the future.

No functional change.

Signed-off-by: Wei Liu <liuwe@xxxxxxxxxxxxx>
---
 xen/arch/x86/guest/xen/xen.c | 32 ++++++++++++++++++++++++++------
 1 file changed, 26 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/guest/xen/xen.c b/xen/arch/x86/guest/xen/xen.c
index 78fc603996..f93c8fbd1c 100644
--- a/xen/arch/x86/guest/xen/xen.c
+++ b/xen/arch/x86/guest/xen/xen.c
@@ -67,7 +67,7 @@ static void __init find_xen_leaves(void)
     }
 }
 
-void __init probe_hypervisor(void)
+static void __init probe_xen(void)
 {
     if ( xen_guest )
         return;
@@ -87,6 +87,11 @@ void __init probe_hypervisor(void)
     xen_guest = true;
 }
 
+void __init probe_hypervisor(void)
+{
+    probe_xen();
+}
+
 static void map_shared_info(void)
 {
     mfn_t mfn;
@@ -249,10 +254,8 @@ static void init_evtchn(void)
     }
 }
 
-void __init hypervisor_setup(void)
+static void __init xen_setup(void)
 {
-    init_memmap();
-
     map_shared_info();
 
     set_vcpu_id();
@@ -277,13 +280,25 @@ void __init hypervisor_setup(void)
     init_evtchn();
 }
 
-void hypervisor_ap_setup(void)
+void __init hypervisor_setup(void)
+{
+    init_memmap();
+
+    xen_setup();
+}
+
+static void xen_ap_setup(void)
 {
     set_vcpu_id();
     map_vcpuinfo();
     init_evtchn();
 }
 
+void hypervisor_ap_setup(void)
+{
+    xen_ap_setup();
+}
+
 int hypervisor_alloc_unused_page(mfn_t *mfn)
 {
     unsigned long m;
@@ -307,7 +322,7 @@ static void ap_resume(void *unused)
     init_evtchn();
 }
 
-void hypervisor_resume(void)
+static void xen_resume(void)
 {
     /* Reset shared info page. */
     map_shared_info();
@@ -330,6 +345,11 @@ void hypervisor_resume(void)
         pv_console_init();
 }
 
+void hypervisor_resume(void)
+{
+    xen_resume();
+}
+
 /*
  * Local variables:
  * mode: C
-- 
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®.