Page MenuHomeFreeBSD

bhyve/virtio: return 0xFF when accessing unused PCI space
AbandonedPublic

Authored by corvink on Apr 28 2021, 9:28 AM.
Tags
Referenced Files
Unknown Object (File)
Jan 4 2024, 7:48 AM
Unknown Object (File)
Dec 20 2023, 3:29 AM
Unknown Object (File)
Dec 12 2023, 3:25 PM
Unknown Object (File)
Dec 11 2023, 5:14 AM
Unknown Object (File)
Jul 7 2023, 11:42 PM
Unknown Object (File)
May 13 2023, 3:28 PM
Unknown Object (File)
May 9 2023, 12:04 PM
Unknown Object (File)
Feb 15 2023, 6:50 AM
Subscribers

Details

Reviewers
None
Group Reviewers
bhyve
Summary

VirtIO devices allocate an IO-BAR. The size of this BAR has to be a
power of two. If that's not the case, pci_emul will adjust the
size to a power of two.
VirtIO space has a size of 0x18 bytes. That's no power of two. For
that reason, pci_emul will adjust the size. If a VirtIO device
only uses the default register, it has no cfgread/cfgwrite
handler. Due to the size adjustment, it's possible that bhyve
calls this unimplemented handler. To avoid a segmentation fault,
check if a handler exists. If the handler does not exist, return
0xFF.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped