Page MenuHomeFreeBSD

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

Authored by corvink on Jan 5 2021, 11:16 AM.
Tags
Referenced Files
Unknown Object (File)
Tue, Mar 5, 10:17 AM
Unknown Object (File)
Mon, Mar 4, 5:07 PM
Unknown Object (File)
Mon, Mar 4, 5:07 PM
Unknown Object (File)
Mon, Mar 4, 5:07 PM
Unknown Object (File)
Mon, Mar 4, 5:07 PM
Unknown Object (File)
Mon, Mar 4, 5:07 PM
Unknown Object (File)
Sun, Mar 3, 11:11 PM
Unknown Object (File)
Feb 8 2024, 8:23 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
Lint Skipped
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?

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