From owner-freebsd-current@FreeBSD.ORG Tue Dec 24 15:51:17 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6467DEE; Tue, 24 Dec 2013 15:51:17 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB2151ADC; Tue, 24 Dec 2013 15:51:17 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B373FB968; Tue, 24 Dec 2013 10:51:16 -0500 (EST) From: John Baldwin To: Roger Pau Monne Subject: Re: [PATCH v7 17/19] xen: xenstore changes to support PVH Date: Tue, 24 Dec 2013 10:43:33 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <1387479296-33389-1-git-send-email-roger.pau@citrix.com> <1387479296-33389-18-git-send-email-roger.pau@citrix.com> In-Reply-To: <1387479296-33389-18-git-send-email-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201312241043.33947.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 24 Dec 2013 10:51:16 -0500 (EST) Cc: xen-devel@lists.xen.org, julien.grall@citrix.com, freebsd-xen@freebsd.org, freebsd-current@freebsd.org, kib@freebsd.org, gibbs@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 15:51:17 -0000 On Thursday, December 19, 2013 1:54:54 pm Roger Pau Monne wrote: > --- > sys/xen/xenstore/xenstore.c | 21 ++++++++++----------- > 1 files changed, 10 insertions(+), 11 deletions(-) This looks fine modulo possibly making it a xenpv child instead of a nexus child. Note that even in the old XEN code in FreeBSD I would argue that attaching directly to nexus is wrong and that even the old XEN code should create some sort of top-level device below nexus0 that is XEN-specific for XEN- specific drivers to attach to. I've no idea what shape the old XEN-specific code is in or if it can be tested, but I'd really like PVH to do the right thing if at all possible. > 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) > > -- John Baldwin