Page MenuHomeFreeBSD

bhyve: move 64 bit BAR location to match OVMF assumptions
Needs ReviewPublic

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

Details

Reviewers
None
Group Reviewers
bhyve
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
R10 FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

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?