[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 4/5] hw/xen: [FIXME] Avoid deadlock in xen_evtchn_set_gsi()
From: |
David Woodhouse |
Subject: |
[RFC PATCH 4/5] hw/xen: [FIXME] Avoid deadlock in xen_evtchn_set_gsi() |
Date: |
Sat, 14 Jan 2023 00:39:08 +0000 |
From: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
hw/i386/kvm/xen_evtchn.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm/xen_evtchn.c
index 18c88229ab..c4103ee98b 100644
--- a/hw/i386/kvm/xen_evtchn.c
+++ b/hw/i386/kvm/xen_evtchn.c
@@ -1436,6 +1436,14 @@ bool xen_evtchn_set_gsi(int gsi, int level)
return false;
}
+ /*
+ * XXX: We access this without locking. Because we'd deadlock
+ * if it was the callback_gsi. Do something cleverer.
+ */
+ if (gsi && gsi == s->callback_gsi) {
+ return false;
+ }
+
QEMU_LOCK_GUARD(&s->port_lock);
pirq = s->gsi_pirq[gsi];
--
2.35.3