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)
Mon, Dec 9, 12:45 AM
Unknown Object (File)
Nov 27 2024, 8:54 AM
Unknown Object (File)
Nov 24 2024, 10:56 AM
Unknown Object (File)
Nov 15 2024, 11:32 PM
Unknown Object (File)
Oct 21 2024, 5:41 PM
Unknown Object (File)
Oct 21 2024, 5:41 PM
Unknown Object (File)
Oct 21 2024, 5:41 PM
Unknown Object (File)
Oct 21 2024, 5:17 PM
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.