[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 29/47] ivshmem: Disable irqfd on device reset
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 29/47] ivshmem: Disable irqfd on device reset |
Date: |
Mon, 5 Feb 2018 20:28:43 +0100 |
From: Ladi Prosek <address@hidden>
The effects of ivshmem_enable_irqfd() was not undone on device reset.
This manifested as:
ivshmem_add_kvm_msi_virq: Assertion `!s->msi_vectors[vector].pdev' failed.
when irqfd was enabled before reset and then enabled again after reset, making
ivshmem_enable_irqfd() run for the second time.
To reproduce, run:
ivshmem-server
and QEMU with:
-device ivshmem-doorbell,chardev=iv
-chardev socket,path=/tmp/ivshmem_socket,id=iv
then install the Windows driver, at the time of writing available at:
https://github.com/virtio-win/kvm-guest-drivers-windows/tree/master/ivshmem
and crash-reboot the guest by inducing a BSOD.
Signed-off-by: Ladi Prosek <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/misc/ivshmem.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index fe1d8d1..16f0370 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -757,10 +757,14 @@ static void ivshmem_msix_vector_use(IVShmemState *s)
}
}
+static void ivshmem_disable_irqfd(IVShmemState *s);
+
static void ivshmem_reset(DeviceState *d)
{
IVShmemState *s = IVSHMEM_COMMON(d);
+ ivshmem_disable_irqfd(s);
+
s->intrstatus = 0;
s->intrmask = 0;
if (ivshmem_has_feature(s, IVSHMEM_MSI)) {
--
1.8.3.1
- [Qemu-devel] [PULL 16/47] Drop remaining bits of ia64 host support, (continued)
- [Qemu-devel] [PULL 16/47] Drop remaining bits of ia64 host support, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 19/47] build-sys: add --enable-sanitizers, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 21/47] vhost: add traces for memory listeners, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 20/47] ucontext: annotate coroutine stack for ASAN, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 17/47] sockets: fix parsing of ipv4/ipv6 opts in parse_socket_addr, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 23/47] vfio: listener unregister before unset container, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 22/47] arm: postpone device listener unregister, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 25/47] chardev/char-socket: add POLLHUP handler, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 24/47] memory: do explicit cleanup when remove listeners, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 28/47] ivshmem: Improve MSI irqfd error handling, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 29/47] ivshmem: Disable irqfd on device reset,
Paolo Bonzini <=
- [Qemu-devel] [PULL 27/47] ivshmem: Always remove irqfd notifiers, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 32/47] cpus: dummy: unregister thread with RCU, exit loop on unplug, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 30/47] cpus: hax: register/unregister thread with RCU, exit loop on unplug, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 31/47] cpus: kvm: unregister thread with RCU, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 26/47] ivshmem: Don't update non-existent MSI routes, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 35/47] cpus: join thread when removing a vCPU, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 34/47] cpus: hvf: unregister thread with RCU, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 33/47] cpus: tcg: unregister thread with RCU, fix exiting of loop on unplug, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 36/47] memfd: add error argument, instead of perror(), Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 38/47] memfd: add hugetlbsize argument, Paolo Bonzini, 2018/02/05