diff options
author | Jiang Yi <[email protected]> | 2019-11-27 17:49:10 +0100 |
---|---|---|
committer | Alex Williamson <[email protected]> | 2019-12-02 14:34:41 -0700 |
commit | d567fb8819162099035e546b11a736e29c2af0ea (patch) | |
tree | 7473979e80e7723a93d7be8efa512c90d4c19030 /lib/memory-notifier-error-inject.c | |
parent | 4f5cafb5cb8471e54afdc9054d973535614f7675 (diff) |
vfio/pci: call irq_bypass_unregister_producer() before freeing irq
Since irq_bypass_register_producer() is called after request_irq(), we
should do tear-down in reverse order: irq_bypass_unregister_producer()
then free_irq().
Specifically free_irq() may release resources required by the
irqbypass del_producer() callback. Notably an example provided by
Marc Zyngier on arm64 with GICv4 that he indicates has the potential
to wedge the hardware:
free_irq(irq)
__free_irq(irq)
irq_domain_deactivate_irq(irq)
its_irq_domain_deactivate()
[unmap the VLPI from the ITS]
kvm_arch_irq_bypass_del_producer(cons, prod)
kvm_vgic_v4_unset_forwarding(kvm, irq, ...)
its_unmap_vlpi(irq)
[Unmap the VLPI from the ITS (again), remap the original LPI]
Signed-off-by: Jiang Yi <[email protected]>
Cc: [email protected] # v4.4+
Fixes: 6d7425f109d26 ("vfio: Register/unregister irq_bypass_producer")
Link: https://lore.kernel.org/kvm/[email protected]
Reviewed-by: Marc Zyngier <[email protected]>
Reviewed-by: Eric Auger <[email protected]>
[aw: commit log]
Signed-off-by: Alex Williamson <[email protected]>
Diffstat (limited to 'lib/memory-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions