On 9/15/25 14:58, Chuck Tuffli wrote:
I'm trying to get PCI passthru of an AMD GPU working, and am seeing what I think is a problem mapping the device's BAR into the guest. The host shows:# pciconf -lbevV pci0:3:0:0 vgapci0@pci0:3:0:0: class=0x030000 rev=0xc0 hdr=0x00 vendor=0x1002 device=0x7590 subvendor=0x148c subdevice=0x2437 vendor = 'Advanced Micro Devices, Inc. [AMD/ATI]' device = 'Navi 44 [Radeon RX 9060 XT]' class = display subclass = VGA bar [10] = type Prefetchable Memory, range 64, base 0x4000000000, size 268435456, enabled bar [18] = type Prefetchable Memory, range 64, base 0x4010000000, size 2097152, enabled bar [20] = type I/O Port, range 32, base 0x6000, size 256, enabled bar [24] = type Memory, range 32, base 0x81100000, size 524288, enabled PCI-e errors = Correctable Error Detected Unsupported Request Detected Non-fatal = Unsupported Request Corrected = Advisory Non-Fatal Error (yes, a 256 MiB BAR). After starting the Linux guest, bhyve spits out the error: bhyve: pci_passthru: map_pptdev_mmio failed. I've traced this a bit and see that vm_map_find returns 3 (KERN_NO_SPACE) with arguments off=0, addr=0x800000000, len=2097152, max_addr=0 In the guest, lspci reports # lspci -s 00:07.0 -v 00:07.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Device 7590 (rev c0) (prog-if 00 [VGA controller]) Subsystem: Tul Corporation / PowerColor Device 2437 Flags: bus master, fast devsel, latency 0 Memory at 800000000 (64-bit, prefetchable) [size=256M] Memory at 810000000 (64-bit, prefetchable) [size=2M] I/O ports at 2000 [size=256] Memory at c1000000 (32-bit, non-prefetchable) [size=512K] Expansion ROM at 000c0000 [virtual] [disabled] [size=128K] Has anyone run into something like this before? Is this a limit I'm bumping into? Suggestions for what to poke next, etc.? TIA!
Hmmm, I think it would be useful if you could dump the effective memory mappings for the guest PAs (the vm_map passed to vm_map_find) to see why it is failing. Note that the request that is failing is for 2M, not 256M, so I'm curious if the address is wrong somehow (why isn't it 0x810000000?) Might be good to confirm which BAR it is trying to allocate GPA space for. -- John Baldwin
