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

Re: [Xen-devel] [PATCH v6 2/7] VMX: Properly handle pi when all the assigned devices are removed



>>> On 03.11.16 at 08:45, <feng.wu@xxxxxxxxx> wrote:

> 
>> -----Original Message-----
>> From: Jan Beulich [mailto:JBeulich@xxxxxxxx]
>> Sent: Friday, October 28, 2016 9:19 PM
>> To: Wu, Feng <feng.wu@xxxxxxxxx>
>> Cc: andrew.cooper3@xxxxxxxxxx; dario.faggioli@xxxxxxxxxx;
>> george.dunlap@xxxxxxxxxxxxx; Tian, Kevin <kevin.tian@xxxxxxxxx>; xen-
>> devel@xxxxxxxxxxxxx 
>> 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.wu@xxxxxxxxx> 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!

That's not the question. The code path needs to be safe, just like
all others (which we also expect Dom0 - or any other eligible domain
- to not use with itself as the target domain).

Jan


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

 


Rackspace

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