Bug 254956 - Assertion fails when passing-through PCI device with large memory BAR
Summary: Assertion fails when passing-through PCI device with large memory BAR
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: bhyve (show other bugs)
Version: 13.0-STABLE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-virtualization (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-10 20:31 UTC by Robert Crowston
Modified: 2021-04-12 22:16 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Crowston 2021-04-10 20:31:12 UTC
Passing-through a PCI device with a large BAR (for instance, a GPU) fails when the 0xfff... probe address is assigned to the BAR: bhyve exists with an assertion failed such as

Assertion failed: (error == 0), function modify_bar_registration, file /usr/src/usr.sbin/bhyve/pci_emul.c, line 501.

During boot the system assigns the BAR a temporary address such that addr + size = 0xffffffff. It immediately restores the previous address. This is not a problem for most PCI devices. However, when passing through a GPU, the temporary memory region is large enough to occupy space already taken by the high performance time counter. This causes the assertion to fail at run time.

I propose that when a probing address such as this is assigned to the BAR, we do not attempt to intercept it at all. My proposal is here: https://reviews.freebsd.org/D29698
Comment 1 Robert Crowston 2021-04-12 22:16:25 UTC
Fixed by updating uefi-edk2-bhyve from 0.2_1,1 to g20210214,2