From 55cd93249b3f1a916246bf62f75d99d5db4544f6 Mon Sep 17 00:00:00 2001 From: Kristof Provost Date: Thu, 20 Feb 2020 17:26:08 +0000 Subject: [PATCH] virtio: Pass the interrupt type in mmio mode When we register an interrupt handler we need to pass the intr_type along in bus_setup_intr(). The interrupt type matters because it is used to decide if we need to enter NET_EPOCH. That meant that vtmmio-based if_vtnet did not, which led to panics with INVARIANTS set. Sponsored by: Axiado --- sys/dev/virtio/mmio/virtio_mmio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/virtio/mmio/virtio_mmio.c b/sys/dev/virtio/mmio/virtio_mmio.c index 95eb8647052..ccafe326868 100644 --- a/sys/dev/virtio/mmio/virtio_mmio.c +++ b/sys/dev/virtio/mmio/virtio_mmio.c @@ -196,7 +196,7 @@ vtmmio_setup_intr(device_t dev, enum intr_type type) return (ENXIO); } - if (bus_setup_intr(dev, sc->res[1], INTR_TYPE_MISC | INTR_MPSAFE, + if (bus_setup_intr(dev, sc->res[1], type | INTR_MPSAFE, NULL, vtmmio_vq_intr, sc, &sc->ih)) { device_printf(dev, "Can't setup the interrupt\n"); return (ENXIO);