Source-Changes archive

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

CVS commit: [netbsd-10] src/sys/dev



Module Name:    src
Committed By:   martin
Date:           Sat Jun  3 14:40:25 UTC 2023

Modified Files:
        src/sys/dev/pci [netbsd-10]: virtio.c virtio_pci.c virtiovar.h
        src/sys/dev/virtio [netbsd-10]: virtio_mmio.c

Log Message:
Pull up following revision(s) (requested by yamaguchi in ticket #186):

        sys/dev/pci/virtio_pci.c: revision 1.41
        sys/dev/pci/virtio_pci.c: revision 1.42
        sys/dev/virtio/virtio_mmio.c: revision 1.10
        sys/dev/pci/virtiovar.h: revision 1.29
        sys/dev/pci/virtio.c: revision 1.75
        sys/dev/pci/virtio.c: revision 1.76
        sys/dev/pci/virtio.c: revision 1.77
        sys/dev/pci/virtio.c: revision 1.78

virtio@pci: Fix assertion on detach.

If the child never attached in the first place, it's OK for it to not
have detached.

XXX This should not be a set of flags; this should be a state
enumeration, because some flags make no sense, like FINISHED|FAILED.

XXX This should not be asserted separately in each bus; there should
be a single place in virtio.c to assert this, uniformly in all buses.

PR kern/57357

Use enumeration for state of a child driver instead of flags
and check its detaching by using sc->sc_child in virtio_softc
pointed out by riastradh, thanks.
fixes PR/57357

Fix not to allocate unnecessary descriptor
fixes PR/57358

virtio(4): change variable name, nfc

virtio(4): change members of struct vring_desc_extra before free a slot

This prevents the following race condition.
1. Thread-A: calls virtio_dequeue_commit() and
             puts a slot into free descriptor chain in vq_free_slot()
2. Thread-B: calls virtio_enqueue_prep() and get the slot stored by Thread-A
3. Thread-B: calls virtio_enqueue_reserve() and
             changes desc_base and desc_free_idx for the slot
4. Thread-A: changes the same members updated by Thread-B
reported by hannken, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.63.2.4 -r1.63.2.5 src/sys/dev/pci/virtio.c
cvs rdiff -u -r1.38.4.1 -r1.38.4.2 src/sys/dev/pci/virtio_pci.c
cvs rdiff -u -r1.24.4.1 -r1.24.4.2 src/sys/dev/pci/virtiovar.h
cvs rdiff -u -r1.7.4.1 -r1.7.4.2 src/sys/dev/virtio/virtio_mmio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index