> -----Original Message-----
> From: Jan Beulich [mailto:jbeul...@suse.com]
> Sent: Friday, October 28, 2016 9:19 PM
> To: Wu, Feng <feng...@intel.com>
> Cc: andrew.coop...@citrix.com; dario.faggi...@citrix.com;
> george.dun...@eu.citrix.com; Tian, Kevin <kevin.t...@intel.com>; xen-
> de...@lists.xen.org
> Subject: Re: [PATCH v6 2/7] VMX: Properly handle pi when all the assigned
> devices are removed
> 
> >>> On 28.10.16 at 04:37, <feng...@intel.com> wrote:
> > @@ -215,11 +220,21 @@ void vmx_pi_hooks_assign(struct domain *d)
> >  /* This function is called when pcidevs_lock is held */
> >  void vmx_pi_hooks_deassign(struct domain *d)
> >  {
> > +    struct vcpu *v;
> > +
> >      if ( !iommu_intpost || !has_hvm_container_domain(d) )
> >          return;
> >
> >      ASSERT(d->arch.hvm_domain.vmx.vcpu_block);
> >
> > +    /*
> > +     * Pausing the domain can make sure the vCPU is not
> > +     * running and hence not calling the hooks simultaneously
> > +     * when deassigning the PI hooks and removing the vCPU
> > +     * from the blocking list.
> > +     */
> > +    domain_pause(d);
> 
> There's one additional caveat here which no-one of us so far thought
> of: Currently there's nothing preventing the domctl-s under which
> this sits from being issued by the control domain for itself. Various
> other domctl-s, however, guard against this case when intending
> to pause the target domain. The same needs to be done for the
> ones leading here.

Thanks for the comments! Could you share in which case can a domain
attach/detach a device for itself? Thanks!

Thanks,
Feng

> 
> Jan


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

Reply via email to