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, Oct 21, 5:41 PM
Unknown Object (File)
Mon, Oct 21, 5:41 PM
Unknown Object (File)
Mon, Oct 21, 5:41 PM
Unknown Object (File)
Mon, Oct 21, 5:17 PM
Unknown Object (File)
Oct 2 2024, 9:33 PM
Unknown Object (File)
Sep 30 2024, 11:30 PM
Unknown Object (File)
Sep 27 2024, 5:24 PM
Unknown Object (File)
Sep 19 2024, 5:38 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.