Page MenuHomeFreeBSD

Only use byte register access in legacy virtio pci
ClosedPublic

Authored by andrew on Aug 5 2021, 3:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 2, 5:02 AM
Unknown Object (File)
Feb 11 2024, 7:38 PM
Unknown Object (File)
Jan 30 2024, 3:25 PM
Unknown Object (File)
Jan 19 2024, 9:36 AM
Unknown Object (File)
Jan 16 2024, 3:35 AM
Unknown Object (File)
Dec 20 2023, 8:12 AM
Unknown Object (File)
Dec 19 2023, 9:51 PM
Unknown Object (File)
Dec 12 2023, 3:37 AM
Subscribers

Details

Summary

Some simulators don't implement arbitrary sized memory access to the
virtio PCI registers. Follow Linux and use single byte accesses to read
and write to these registers.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

andrew requested review of this revision.Aug 5 2021, 3:42 PM
bryanv added inline comments.
sys/dev/virtio/pci/virtio_pci_legacy.c
514–516

Nit: IMO these for loops end up being a little more complicated to read now that the body is simpler. For this one, perhaps something like:

for (d = dst, i = 0; i < length; i++) {
	d[i] = vtpci_legacy_read_config_1(sc, off + i)
}
This revision is now accepted and ready to land.Aug 6 2021, 5:49 PM
This revision now requires review to proceed.Aug 9 2021, 9:05 AM
This revision was not accepted when it landed; it landed in state Needs Review.Aug 11 2021, 10:22 AM
This revision was automatically updated to reflect the committed changes.