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

[Xen-devel] [PATCH v7 11/19] xen: changes to hvm code in order to support PVH guests



On PVH we don't need to init the shared info page, or disable emulated
devices. Also, make sure PV IPIs are set before starting the APs.
---
 sys/x86/xen/hvm.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/sys/x86/xen/hvm.c b/sys/x86/xen/hvm.c
index 9a0411e..fb1ed79 100644
--- a/sys/x86/xen/hvm.c
+++ b/sys/x86/xen/hvm.c
@@ -523,7 +523,7 @@ xen_setup_cpus(void)
 {
        int i;
 
-       if (!xen_hvm_domain() || !xen_vector_callback_enabled)
+       if (!xen_vector_callback_enabled)
                return;
 
 #ifdef __amd64__
@@ -712,10 +712,13 @@ xen_hvm_init(enum xen_hvm_init_type init_type)
        }
 
        xen_vector_callback_enabled = 0;
-       xen_domain_type = XEN_HVM_DOMAIN;
-       xen_hvm_init_shared_info_page();
        xen_hvm_set_callback(NULL);
-       xen_hvm_disable_emulated_devices();
+
+       if (!xen_pv_domain()) {
+               xen_domain_type = XEN_HVM_DOMAIN;
+               xen_hvm_init_shared_info_page();
+               xen_hvm_disable_emulated_devices();
+       }
 } 
 
 void
@@ -746,6 +749,9 @@ xen_set_vcpu_id(void)
        struct pcpu *pc;
        int i;
 
+       if (!xen_hvm_domain())
+               return;
+
        /* Set vcpu_id to acpi_id */
        CPU_FOREACH(i) {
                pc = pcpu_find(i);
@@ -789,7 +795,8 @@ xen_hvm_cpu_init(void)
 
 SYSINIT(xen_hvm_init, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, xen_hvm_sysinit, 
NULL);
 #ifdef SMP
-SYSINIT(xen_setup_cpus, SI_SUB_SMP, SI_ORDER_FIRST, xen_setup_cpus, NULL);
+/* We need to setup IPIs before APs are started */
+SYSINIT(xen_setup_cpus, SI_SUB_SMP-1, SI_ORDER_FIRST, xen_setup_cpus, NULL);
 #endif
 SYSINIT(xen_hvm_cpu_init, SI_SUB_INTR, SI_ORDER_FIRST, xen_hvm_cpu_init, NULL);
 SYSINIT(xen_set_vcpu_id, SI_SUB_CPU, SI_ORDER_ANY, xen_set_vcpu_id, NULL);
-- 
1.7.7.5 (Apple Git-26)


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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