Page MenuHomeFreeBSD

vt: drop the lock before calling vd_postswitch
AcceptedPublic

Authored by kevans on Jan 10 2025, 4:34 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 2, 9:44 PM
Unknown Object (File)
Tue, Sep 30, 9:17 PM
Unknown Object (File)
Tue, Sep 30, 4:49 PM
Unknown Object (File)
Aug 26 2025, 11:10 AM
Unknown Object (File)
Aug 15 2025, 12:13 AM
Unknown Object (File)
Aug 11 2025, 4:03 PM
Unknown Object (File)
Aug 8 2025, 8:37 AM
Unknown Object (File)
Aug 5 2025, 8:54 PM
Subscribers

Details

Reviewers
emaste
manu
jhb
Summary

Some postswitch methods, e.g., from i915kms, don't currently expect to
be called under a lock and may try to sleep. The expectation seems OK,
we usually do drop the lock prior to calling vd_postswitch, so let's
avoid an unnecessary panic and drop the lock earlier..

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 61638
Build 58522: arc lint + arc unit

Event Timeline

jhb added inline comments.
sys/dev/vt/vt_core.c
625

Notably, we drop the VT lock before postswitch here already. Might be worth calling out that you are fixing a special case to follow the same behavior as the more general case. Probably the special cal to vd_postswitch was added later and that later commit just got the locking wrong.

This revision is now accepted and ready to land.Jan 10 2025, 12:15 PM