From: Ian Campbell Subject: Re: [PATCH] xen: Fix BUFIOREQ evtchn init for a stubdom. Date: Tue, 26 Jun 2012 15:21:39 +0100 Message-ID: <1340720499.3832.132.camel@zakaz.uk.xensource.com> References: <1340707524-27665-1-git-send-email-anthony.perard@citrix.com> <1340708071.3832.68.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Anthony PERARD Cc: Xen Devel , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Tue, 2012-06-26 at 15:13 +0100, Anthony PERARD wrote: > On Tue, Jun 26, 2012 at 11:54 AM, Ian Campbell wrote: > > On Tue, 2012-06-26 at 11:45 +0100, Anthony PERARD wrote: > >> This is a missing part from the previous patch that add the BUFIOREQ_EVTCHN > >> parameter. This patch changes the ownership of the buifioreq event channel to > >> the stubdom (when HVM_PARAM_DM_DOMAIN is set within the stubdom). > >> > >> This fix the initialization of QEMU inside the stubdomain. > >> > >> Signed-off-by: Anthony PERARD > > > > This fixes stub domains for me, thanks. > > > > The user of this field (hvm_buffered_io_send) takes iorp->lock so we > > probably want to put the update inside that too, just like for the > > non-buffered case? > > Will do. > > > It would be nice to extract the alloc&replace functionality into a > > helper. > > I tried but it does not work well. > xen_port is an it (non-buffer case) and params[bufioreq...] is an > uint64_t. Both should be argument of the helper, as a pointer to be > pass to xchg(). > > The prototype of the not working helper: > static int hvm_replace_event_channel(struct vcpu *v, uint64_t > remote_domid, int *port) > > So unless there is another way to create this helper, there won't be any. Although params[...] are generally uint64_t the params[BUFIOREQ_EVTCHN] is really an int (or more properly an evtchn_port_t, although this is only used in include/public). Perhaps a cast is appropriate in this case? Ian.