Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Jan 2017 02:08:12 -0800
From:      Peter Grehan <grehan@freebsd.org>
To:        soralx@cydem.org
Cc:        freebsd-virtualization@freebsd.org
Subject:   Re: Issues with GTX960 on CentOS7 using bhyve PCI passthru (FreeBSD 11-RC2)
Message-ID:  <93196ea2-5439-49ff-54fd-7b7273bdec85@freebsd.org>
In-Reply-To: <20170111014544.70670784@mscad14>
References:  <20170110003332.7cf8ba15@mscad14> <0de7e0fe-5680-b1be-bd57-6bf446c2fd38@talk2dom.com> <0c927784-3e3f-7946-fba9-c25001f4156c@talk2dom.com> <20170110180117.7f246b5a@mscad14> <20170111014544.70670784@mscad14>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

>> 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.

> But:
>   # ./nvidia-smi
>   No devices were found
> dmesg:
>   [  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 :)

later,

Peter.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?93196ea2-5439-49ff-54fd-7b7273bdec85>