Page MenuHomeFreeBSD

bhyve: move 64 bit BAR location to match OVMF assumptions
ClosedPublic

Authored by c.koehne_beckhoff.com on Jan 5 2021, 11:16 AM.

Details

Summary

OVMF will fail, if large 64 bit BARs are used. GCD-Map doesn't cover 64 bit addresses of BARs.
OVMF assumes that 64 bit addresses of BARS are located on next 32 GB boundary behind Top of High RAM.
See D27230

This patch moves 64 bit BARs on next 32 GB boundary behind Top of High RAM to match OVMF assumptions.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

OVMF puts it at the next 16GB boundary, which might be better.

The alignment depends on gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size which is set in BhyveX64.dsc. On my system with 4 GB of RAM, it's set to 32 GB:
GetFirstNonAddress: Pci64Base=0x800000000 Pci64Size=0x800000000

  • Revert rS367606 "bhyve: avoid allocating BARs above the end of supported physical addresses."

This works for me. I was seeing an assert failure in pci_emul.c, but it disappeared for some reason.
One person on Slack said they'd like the BAR in a fixed (high) location, so I wouldn't be confident committing this without other people (e.g. @jhb and @grehan ) reviewing it too.

The patch no longer applies against 13-CURRENT: I needed to apply several lines manually.

One person on Slack said they'd like the BAR in a fixed (high) location, so I wouldn't be confident committing this without other people (e.g. @jhb and @grehan ) reviewing it too.

What's the current state? Should the BARs be located at a fixed (high) location or not?

LGTM.
Will commit next monday unless someone have more comments until then.
Almost a year since a question was asked and no answer was given, if people prefer a high fixed address they have until monday to raise their hand.

This revision is now accepted and ready to land.Nov 18 2021, 5:50 PM