Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Dec 2013 19:54:54 +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 17/19] xen: xenstore changes to support PVH
Message-ID:  <1387479296-33389-18-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
---
 sys/xen/xenstore/xenstore.c |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/sys/xen/xenstore/xenstore.c b/sys/xen/xenstore/xenstore.c
index bcf6357..2893c84 100644
--- a/sys/xen/xenstore/xenstore.c
+++ b/sys/xen/xenstore/xenstore.c
@@ -229,13 +229,11 @@ struct xs_softc {
 	 */
 	struct sx xenwatch_mutex;
 
-#ifdef XENHVM
 	/**
 	 * The HVM guest pseudo-physical frame number.  This is Xen's mapping
 	 * of the true machine frame number into our "physical address space".
 	 */
 	unsigned long gpfn;
-#endif
 
 	/**
 	 * The event channel for communicating with the
@@ -1141,13 +1139,15 @@ xs_attach(device_t dev)
 	/* Initialize the interface to xenstore. */
 	struct proc *p;
 
-#ifdef XENHVM
-	xs.evtchn = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN);
-	xs.gpfn = hvm_get_parameter(HVM_PARAM_STORE_PFN);
-	xen_store = pmap_mapdev(xs.gpfn * PAGE_SIZE, PAGE_SIZE);
-#else
-	xs.evtchn = xen_start_info->store_evtchn;
-#endif
+	if (xen_hvm_domain()) {
+		xs.evtchn = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN);
+		xs.gpfn = hvm_get_parameter(HVM_PARAM_STORE_PFN);
+		xen_store = pmap_mapdev(xs.gpfn * PAGE_SIZE, PAGE_SIZE);
+	} else if (xen_pv_domain()) {
+		xs.evtchn = HYPERVISOR_start_info->store_evtchn;
+	} else {
+		panic("Unknown domain type, cannot initialize xenstore\n");
+	}
 
 	TAILQ_INIT(&xs.reply_list);
 	TAILQ_INIT(&xs.watch_events);
@@ -1256,9 +1256,8 @@ static devclass_t xenstore_devclass;
  
 #ifdef XENHVM
 DRIVER_MODULE(xenstore, xenpci, xenstore_driver, xenstore_devclass, 0, 0);
-#else
-DRIVER_MODULE(xenstore, nexus, xenstore_driver, xenstore_devclass, 0, 0);
 #endif
+DRIVER_MODULE(xenstore, nexus, xenstore_driver, xenstore_devclass, 0, 0);
 
 /*------------------------------- Sysctl Data --------------------------------*/
 /* XXX Shouldn't the node be somewhere else? */
-- 
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-18-git-send-email-roger.pau>