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, Oct 22, 11:52 PM
Unknown Object (File)
Sun, Oct 20, 11:21 AM
Unknown Object (File)
Thu, Oct 17, 12:20 PM
Unknown Object (File)
Wed, Oct 16, 5:04 PM
Unknown Object (File)
Sun, Oct 13, 4:52 PM
Unknown Object (File)
Oct 12 2024, 8:09 AM
Unknown Object (File)
Oct 11 2024, 12:12 AM
Unknown Object (File)
Oct 10 2024, 4:04 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 Not Applicable
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