NetBSD-Bugs archive

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

kern/57357: panic: kernel diagnostic assertion "ISSET(sc->sc_child_flags, VIRTIO_CHILD_DETACHED)" failed: file "/usr/sources/cvs.netbsd.org/src-sfs/sys/dev/pci/virtio_pci.c", line 337



>Number:         57357
>Category:       kern
>Synopsis:       panic: kernel diagnostic assertion "ISSET(sc->sc_child_flags, VIRTIO_CHILD_DETACHED)" failed: file  "/usr/sources/cvs.netbsd.org/src-sfs/sys/dev/pci/virtio_pci.c", line 337
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 16 17:55:00 +0000 2023
>Originator:     Taylor R Campbell
>Release:        current
>Organization:
The NetBSD Foundetachedation
>Environment:
ceterum censeo petroleum esse delendam
>Description:
If no driver attaches as a virtio device's child, attempting to detach the virtio device doesn't work because the child has not set the child's detached flag.
>How-To-Repeat:
1. Run NetBSD with some virtio device that we don't have a driver for, or whose driver is not currently in the kernel (like viocon(4), with qemu -device virtio-serial).
2. drvctl -d virtioN
>Fix:
Two alternative approaches:

1. Change the assertion to allow devices that never finished/failed attach in the first place.
2. Change sc_child_flags to be a simple enumeration of possible states, since most combinations of flags make no sense.

Also, this assertion should not live in virtio_pci.c (and should not need to be copied in any other virtio buses) -- there should be a generic place in virtio.c for assertions like this to live.



Home | Main Index | Thread Index | Old Index