Page MenuHomeFreeBSD

bhyve: usb: add a finer-grained mutex for the event thread
AcceptedPublic

Authored by kevans on Fri, Sep 18, 1:58 AM.
Tags
None
Referenced Files
F175520200: D59779.diff
Sun, Oct 11, 10:18 AM
Unknown Object (File)
Sat, Oct 10, 6:24 AM
Unknown Object (File)
Sat, Oct 10, 5:41 AM
Unknown Object (File)
Sat, Oct 10, 5:41 AM
Unknown Object (File)
Sat, Oct 10, 3:21 AM
Unknown Object (File)
Fri, Oct 9, 9:54 PM
Unknown Object (File)
Fri, Oct 9, 8:53 PM
Unknown Object (File)
Fri, Oct 9, 5:22 PM

Details

Reviewers
markj
bnovkov
aokblast
Group Reviewers
bhyve
Summary

Nothing today will serialize er_enq_idx / er_events_cnt updates against
the ERDP handler recalculations. This isn't strictly a problem until
we add support for a USB passthru device (which adds another thread for
handling libusb events), but pushing it in advance makes the meatier
bits of passthru more reviewable.

Sponsored by: The FreeBSD Foundation (aokblast)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 77045
Build 73928: arc lint + arc unit

Event Timeline

Seems ok, but pci_xhci_reset() resets the event fields as well. Is there a reason not to use this mutex to synchronize with those events too?

usr.sbin/bhyve/pci_xhci.c
2182

The high bits case above does touch those fields though.

kevans marked an inline comment as done.

Extend locking to ERSTBA handling and pci_xhci_reset()

This revision is now accepted and ready to land.Fri, Sep 18, 8:39 PM
bnovkov added a subscriber: bnovkov.
bnovkov added inline comments.
usr.sbin/bhyve/pci_xhci.c
268–276

Small nit.