[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] ioreq process conflict when EVTCHNOP_bind_interdomain hypercall and vcpu pio occur concurrently



> -----Original Message-----
> From: xen-devel-bounces@xxxxxxxxxxxxx [mailto:xen-devel-
> bounces@xxxxxxxxxxxxx] On Behalf Of Liuyongan
> Sent: 14 November 2014 10:57
> To: xen-devel@xxxxxxxxxxxxx
> Cc: Qianhuibin; zhangyuexi; Shanhaitao (Tony); Fanhenglong; Huangzhichao;
> JBeulich@xxxxxxxx
> Subject: Re: [Xen-devel] ioreq process conflict when
> EVTCHNOP_bind_interdomain hypercall and vcpu pio occur concurrently
> 
> If Qemu calls xc_evtchn_bind_interdomain to allocate an free port for each
> vcpu,
> it will receive empty io-request triggered by xen. I say it empty as the 
> ioreq in
> shared page is not filled. So qemu can simply skip the first ioreq of each 
> vcpu
> by
> a pervcpu flag.
> 
> You should not skip the first one by check ioreq->state , as the shared page
> may
> be modified by real vm trigged io req, so ioreq->state becomes REQUEST
> READY.
> 
> Any bugs here?
> 

Not as far as  I know. The emulator should ignore the ioreq is the state is not 
'request ready' and that's fine because Xen will always raise the event after 
setting the state and will only set the state to ready after setting up the 
rest of the structure.

  Paul

> Liuyongan
> 2014-11-14
> 
> 
> > -----Original Message-----
> > From: Liuyongan
> > Sent: Tuesday, November 11, 2014 8:45 PM
> > To: 'xen-devel@xxxxxxxxxxxxx'
> > Cc: 'JBeulich@xxxxxxxx'; Shanhaitao (Tony); Huangzhichao; zhangyuexi;
> > Fanhenglong; Qianhuibin
> > Subject: ioreq process conflict when EVTCHNOP_bind_interdomain
> hypercall
> > and vcpu pio occur concurrently
> >
> > I wonder if it is necessary for xen to trigger the event channel pending
> when
> > the port related a vcpu port io.
> >
> > Suppose a scenario as follows:
> >
> > 1)  Qemu make a hypercall using codes:
> >      for (i = 0; i < smp_cpus; i++) {
> >         rc = xc_evtchn_bind_interdomain(state->xce_handle, xen_domid,
> >
> > xen_vcpu_eport(state->shared_page, i));
> >         if (rc == -1) {
> >             fprintf(stderr, "bind interdomain ioctl(shared_page) error 
> > %d\n",
> > errno);
> >             return -1;
> >         }
> >         state->ioreq_local_port[i] = rc;
> >         ...
> >      }
> >
> > 2)  Xen do_event_channel_op allocate a free port and call
> evtchn_set_pending
> > to trigger a evtchn event.
> >
> > 3)  Qemu enters main_loop and begin the evtchn event (pio event).
> >
> > 4)  The vcpus of a vm begin to trigger real pio exit,  and this ioreq_t will
> > conflict with the one triggered in step 2.
> >
> > This will certainly cause failures of real port io.
> >
> > Does anyone here have any suggestions?
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.