Page MenuHomeFreeBSD

recursive mutex in pci_xhci leads to deadlock
Needs ReviewPublic

Authored by mike.gerdts_joyent.com on May 4 2018, 4:17 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 3:48 PM
Unknown Object (File)
Feb 21 2024, 4:46 PM
Unknown Object (File)
Feb 21 2024, 6:26 AM
Unknown Object (File)
Feb 21 2024, 6:13 AM
Unknown Object (File)
Feb 8 2024, 11:18 PM
Unknown Object (File)
Dec 22 2023, 10:31 PM
Unknown Object (File)
Dec 19 2023, 10:11 AM
Unknown Object (File)
Nov 20 2023, 8:39 PM

Details

Reviewers
rgrimes
Group Reviewers
bhyve
Summary

In SmartOS, it was discovered that use of an xhci tablet leads a deadlock
because pci_xhci_handle_transfer() has already taken the lock that its
callee pci_xhci_try_usb_xfer() tries to take.

Test Plan

Verify that a VM configured with fbuf and an xhci tablet no longer lead
to the deadlock.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 16421
Build 16342: arc lint + arc unit

Event Timeline

I checked with Leon and he thought this was fine. Will submit pending the copyright issue.

usr.sbin/bhyve/pci_xhci.c
3

In general the FreeBSD project doesn't like having copyright added unless > 25% of the file has been modified. Is it Ok if I remove this ?

usr.sbin/bhyve/pci_xhci.c
3

Per Joyent management:

It's our policy that any change that isn't de minimus must bear a Joyent copyright.

usr.sbin/bhyve/pci_xhci.c
3

Moving 2 lines of code to inside an if statement is pretty "minimus"?

usr.sbin/bhyve/pci_xhci.c
3

Not including a copyright statement in this change would require an exception to our policy, which may involve an unbounded amount of time and potential legal review. Is it worth holding up this change for that?

It is unlikely that most of the individual changes that Joyent will contribute will change 25% of most files that are touched. This does not negate the fact that we are contributing significant engineering resources into diagnosing, fixing, and testing our fixes. We want to be in sync with FreeBSD, but a contribution policy that runs counter to our own policies will make that very difficult.

Is the policy related to attribution via copyright documented somewhere?

jhb added inline comments.
usr.sbin/bhyve/pci_xhci.c
3

Asserting copyright for this small of a change is highly unusual in the current practice of the project. We don't currently have a formally documented policy. I believe the 25% rule is a kind of common de facto practice in the industry however. Writing up a formal policy will require legal review on our end so it won't happen anytime soon. There are lots of companies (and individual developers) who contribute changes larger than this on a regular basis without asserting copyrights.