diff options
author | Keir Fraser <keir@xensource.com> | 2007-10-30 10:39:52 +0000 |
---|---|---|
committer | Keir Fraser <keir@xensource.com> | 2007-10-30 10:39:52 +0000 |
commit | 06e3f8f27662a8c1af0a4a43558a1dac65c2a97b (patch) | |
tree | 7730be68beaeba6b22e131fc5e3361692542b08a /xen/arch/x86/hvm/vioapic.c | |
parent | dbda63b318ad6a16e20ba8d934645799d3984593 (diff) | |
download | xen-06e3f8f27662a8c1af0a4a43558a1dac65c2a97b.tar.gz xen-06e3f8f27662a8c1af0a4a43558a1dac65c2a97b.tar.bz2 xen-06e3f8f27662a8c1af0a4a43558a1dac65c2a97b.zip |
vt-d: Do dpci eoi outside of irq_lock.
Deadlock may occur if do hvm_dpci_eoi() inside of irq_lock on MP
platform. For example, there are two physical cpus. If interrupt is
injected on cpu0, but vcpu is migrated to cpu1 and it does eoi inside
of irq_lock, then IPI will be issued to cpu0. At the same time, cpu0
may have disabled irq and is acquiring the same irq_lock. In addition,
current code cannot guarantee do hvm_dpci_eoi() inside of irq_lock
when timeout. This patch does hvm_dpci_eoi() outside of irq_lock, and
solves above problems.
Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/arch/x86/hvm/vioapic.c')
-rw-r--r-- | xen/arch/x86/hvm/vioapic.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c index 31db4454ab..670cdf5979 100644 --- a/xen/arch/x86/hvm/vioapic.c +++ b/xen/arch/x86/hvm/vioapic.c @@ -459,7 +459,11 @@ void vioapic_update_EOI(struct domain *d, int vector) ent->fields.remote_irr = 0; if ( vtd_enabled ) + { + spin_unlock(&d->arch.hvm_domain.irq_lock); hvm_dpci_eoi(current->domain, gsi, ent); + spin_lock(&d->arch.hvm_domain.irq_lock); + } if ( (ent->fields.trig_mode == VIOAPIC_LEVEL_TRIG) && !ent->fields.mask && |