diff options
author | Roger Pau Monné <royger@FreeBSD.org> | 2014-06-16 08:47:15 +0000 |
---|---|---|
committer | Roger Pau Monné <royger@FreeBSD.org> | 2014-06-16 08:47:15 +0000 |
commit | 9a522f8203d4c344e92d03eb891ad65a8c60a761 (patch) | |
tree | 4e71a7a3e6341b1c565f7ee79b25bd3d21a47314 | |
parent | bd851e636f0dddeb91aff6f9e09f02ba25c28577 (diff) | |
download | src-9a522f8203d4c344e92d03eb891ad65a8c60a761.tar.gz src-9a522f8203d4c344e92d03eb891ad65a8c60a761.zip |
xen: xenstore changes to support PVH
For PVH guests the xenstore parameters are fetched from the start_info
struct, just like on PV.
Sponsored by: Citrix Systems R&D
Approved by: gibbs
xen/xenstore/xenstore.c:
- Fetch xenstore event channel port from start_info.
Notes
Notes:
svn path=/head/; revision=267532
-rw-r--r-- | sys/xen/xenstore/xenstore.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/xen/xenstore/xenstore.c b/sys/xen/xenstore/xenstore.c index b5cf413d6ca4..f0b661732ddd 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 @@ -1147,13 +1145,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."); + } TAILQ_INIT(&xs.reply_list); TAILQ_INIT(&xs.watch_events); |