Page MenuHomeFreeBSD

bhyve: add more slop to 64 bit BARs
ClosedPublic

Authored by corvink on Nov 25 2021, 12:15 PM.
Tags
Referenced Files
Unknown Object (File)
Thu, Dec 12, 2:59 PM
Unknown Object (File)
Nov 24 2024, 1:12 AM
Unknown Object (File)
Nov 21 2024, 9:04 AM
Unknown Object (File)
Nov 20 2024, 6:17 AM
Unknown Object (File)
Nov 20 2024, 5:46 AM
Unknown Object (File)
Nov 17 2024, 10:03 AM
Unknown Object (File)
Nov 8 2024, 6:15 AM
Unknown Object (File)
Nov 7 2024, 6:02 PM

Details

Summary

Bhyve allocates small 64 bit BARs below 4 GB and generates ACPI tables
based on this allocation. If the guest decides to relocate those BARs
above 4 GB, it could lead to mismatching ACPI tables. Especially
when using OVMF with enabled bus enumeration it could cause
issues. OVMF relocates all 64 bit BARs above 4 GB. The guest OS
may be unable to recover from this situation and disables some PCI
devices because their BARs are located outside of the MMIO space
reported by ACPI. Avoid this situation by giving the guest more
space for relocating BARs.

Let's be paranoid. The available space for BARs below 4 GB is 512 MB
large. Use a slop of 512 MB. It'll allow the guest to relocate all
BARs below 4 GB to an address above 4 GB. We could run into issues
when we exceeding the memlimit above 4 GB. However, this space has
a size of 32 GB. Even when using many PCI device with large BARs
like framebuffer or when using multiple PCI busses, it's very
unlikely that we run out of space due to the large slop.
Additionally, this situation will occur on startup and not at runtime
which is much better.

Note: You may wanna take a look at https://github.com/Beckhoff/freebsd-src/commits/phab/corvink/64bit_slop

Diff Detail

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