Page MenuHomeFreeBSD

bhyve: Drop volatile qualifiers from virtio rings
ClosedPublic

Authored by markj on Nov 6 2022, 7:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Sep 17, 7:21 AM
Unknown Object (File)
Sun, Sep 13, 10:47 AM
Unknown Object (File)
Sat, Sep 12, 7:33 PM
Unknown Object (File)
Sat, Sep 12, 9:13 AM
Unknown Object (File)
Wed, Sep 2, 9:23 AM
Unknown Object (File)
Wed, Sep 2, 8:45 AM
Unknown Object (File)
Wed, Sep 2, 1:04 AM
Unknown Object (File)
Aug 17 2026, 11:27 AM
Subscribers

Details

Summary

The qualifiers are there presumably because these rings are mapped into
the guest, but they do not appear to be required for correctness, and
bhyve generally doesn't qualify accesses to guest memory this way.
Moreover, the qualifiers are discarded by snapshot code, causing clang
to emit warnings. Just stop using volatile here.

Diff Detail

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

Event Timeline

markj requested review of this revision.Nov 6 2022, 7:36 PM
This revision is now accepted and ready to land.Nov 7 2022, 8:14 AM

I can see a reason for having volatile pointers for things shared with the guest, though I think instead the right approach is to use memory barriers in the device models when working with data structures shared with a guest.