The problem appears to be in the area of assigning memory-mapped
I/O ranges by bhyve for the VGA card to a region outside of the
CPU's addressable space; i.e., bhyve does not check CPUID's
0x80000008 AL value (0x27 for my CPU, which is 39 bits -- while
bhyve assigns 0xd000000000 & above for the large Prefetch Memory
chunks, which requires 40 address bits).

 That's correct - it's a bug in bhyve.

To test this, I tried writing to PCI BARs in FreeBSD guest using
`pciconf -w`. Not much use that was: I could read back the values
written to the registers (e.g., `pciconf -r pci0:0:4:0 0x14:48`),
but `pciconf -lvb` still showed the same huge base addresses --
they did not want to change.

PCI passthru doesn't allow the BAR values to be modified (this could be changed, but it's a lot of work for little gain).

OK, I had enough of that. So I went to dig in the source, and
changed the "#define PCI_EMUL_MEMBASE64" from '0xD000000000UL'
to '0x3400000000UL' in src/usr.sbin/bhyve/pci_emul.c.

 Yep, that's a good way to test.

  # ./nvidia-smi
  No devices were found
  [  173.498953] NVRM: RmInitAdapter failed! (0x53:0x3:1856)
  [  173.499115] NVRM: rm_init_adapter failed for device bearing minor number 0

 Looks like you're getting close :)



freebsd-virtualization@freebsd.org mailing list
To unsubscribe, send any mail to 

Reply via email to