tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

-current kernel on KVM with virtio disk fails to boot



Hi,

I got the following panic on bootup. It seems recent
IPL_VM => IPL_NONE change in dk_attach causes it.

----

Mutex error: lockdebug_wantlock: acquiring sleep lock from interrupt context

lock address : 0xfffffe800386bce0 type     :     sleep/adaptive
initialized  : 0xffffffff801b3a65
shared holds :                  0 exclusive:                  0
shares wanted:                  0 exclusive:                  0
current cpu  :                  0 last held:                  0
current lwp  : 0xfffffe80035771a0 last held: 000000000000000000
last locked  : 0xffffffff801b3bfc unlocked*: 0xffffffff80489f53
owner field  : 000000000000000000 wait/spin:                0/0

Turnstile chain at 0xffffffff809bca40.
=> No active turnstile for this lock.

panic: LOCKDEBUG: Mutex error: lockdebug_wantlock: acquiring sleep
lock from interrupt context
fatal breakpoint trap in supervisor mode
trap type 1 code 0 rip ffffffff80197c75 cs 8 rflags 246 cr2 0 ilevel 6
rsp fffffe8003997b00
curlwp 0xfffffe80035771a0 pid 0.43 lowest kstack 0xfffffe80039942c0
Stopped in pid 0.43 (system) at netbsd:breakpoint+0x5:  leave
db{0}> bt
breakpoint() at netbsd:breakpoint+0x5
vpanic() at netbsd:vpanic+0x13c
snprintf() at netbsd:snprintf
lockdebug_more() at netbsd:lockdebug_more
mutex_enter() at netbsd:mutex_enter+0x43f
dk_done() at netbsd:dk_done+0x62
lddone() at netbsd:lddone+0xf
ld_virtio_vq_done() at netbsd:ld_virtio_vq_done+0x37
virtio_vq_intr() at netbsd:virtio_vq_intr+0x70
virtio_intr() at netbsd:virtio_intr+0x70
intr_biglock_wrapper() at netbsd:intr_biglock_wrapper+0x19
Xintr_ioapic_level6() at netbsd:Xintr_ioapic_level6+0xf2
--- interrupt ---
bus_space_read_4() at netbsd:bus_space_read_4+0xa
lwp_exit_switchaway() at netbsd:lwp_exit_switchaway+0x79
lwp_exit() at netbsd:lwp_exit+0x317
kthread_exit() at netbsd:kthread_exit+0x4e
config_finalize_register() at netbsd:config_finalize_register

----

We can fix it by running ld_virtio's interrupt
hander in softint; it can be done simply by the
patch.

----

diff --git a/sys/dev/pci/ld_virtio.c b/sys/dev/pci/ld_virtio.c
index f578a73..404edfd 100644
--- a/sys/dev/pci/ld_virtio.c
+++ b/sys/dev/pci/ld_virtio.c
@@ -249,7 +249,7 @@ ld_virtio_attach(device_t parent, device_t self, void *aux)
        vsc->sc_nvqs = 1;
        vsc->sc_config_change = NULL;
        vsc->sc_intrhand = virtio_vq_intr;
-       vsc->sc_flags = 0;
+       vsc->sc_flags = VIRTIO_F_PCI_INTR_SOFTINT;

        features = virtio_negotiate_features(vsc,
                                             (VIRTIO_BLK_F_SIZE_MAX |

----

Should we apply it?

  ozaki-r


Home | Main Index | Thread Index | Old Index