Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Dec 2013 19:54:48 +0100
From:      Roger Pau Monne <roger.pau@citrix.com>
To:        <freebsd-xen@freebsd.org>, <freebsd-current@freebsd.org>, <xen-devel@lists.xen.org>, <gibbs@freebsd.org>, <jhb@freebsd.org>, <kib@freebsd.org>, <julien.grall@citrix.com>
Cc:        Roger Pau Monne <roger.pau@citrix.com>
Subject:   [PATCH v7 11/19] xen: changes to hvm code in order to support PVH guests
Message-ID:  <1387479296-33389-12-git-send-email-roger.pau@citrix.com>
In-Reply-To: <1387479296-33389-1-git-send-email-roger.pau@citrix.com>
References:  <1387479296-33389-1-git-send-email-roger.pau@citrix.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1387479296-33389-12-git-send-email-roger.pau>