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 19, 5:38 AM
Unknown Object (File)
Wed, Sep 18, 2:27 PM
Unknown Object (File)
Tue, Sep 17, 1:34 PM
Unknown Object (File)
Aug 21 2024, 3:22 PM
Unknown Object (File)
Aug 19 2024, 7:07 AM
Unknown Object (File)
Aug 17 2024, 7:34 PM
Unknown Object (File)
Aug 13 2024, 6:50 PM
Unknown Object (File)
Aug 13 2024, 3:00 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 Not Applicable
Unit
Tests Not Applicable

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.