> -----Original Message-----
> From: Jan Beulich <[email protected]>
> Sent: 28 April 2020 13:22
> To: [email protected]
> Cc: Paul Durrant <[email protected]>; Varad Gautam <[email protected]>; Andrew Cooper
> <[email protected]>; Roger Pau Monné <[email protected]>; Wei Liu 
> <[email protected]>
> Subject: [PATCH] x86/pass-through: avoid double IRQ unbind during domain 
> cleanup
> 
> XEN_DOMCTL_destroydomain creates a continuation if domain_kill -ERESTARTs.
> In that scenario, it is possible to receive multiple _pirq_guest_unbind
> calls for the same pirq from domain_kill, if the pirq has not yet been
> removed from the domain's pirq_tree, as:
>   domain_kill()
>     -> domain_relinquish_resources()
>       -> pci_release_devices()
>         -> pci_clean_dpci_irq()
>           -> pirq_guest_unbind()
>             -> __pirq_guest_unbind()
> 
> Avoid recurring invocations of pirq_guest_unbind() by removing the pIRQ
> from the tree being iterated after the first call there. In case such a
> removed entry still has a softirq outstanding, record it and re-check
> upon re-invocation.
> 
> Reported-by: Varad Gautam <[email protected]>
> Signed-off-by: Jan Beulich <[email protected]>
> Tested-by: Varad Gautam <[email protected]>

Reviewed-by: Paul Durrant <[email protected]>


Reply via email to