[vfio-users] Failed to mmap 0000:01:00.0 BAR 3. Performance may be slow

Konrad Eisele eiselekd at gmail.com
Thu Aug 23 21:35:34 UTC 2018


I gave the Nvidia 710b card a try:
- booted with 2 cards, AMD primary, NVidia secondary
- unbind noveau driver
- use nvflash (see below) to dump nvidia vbios
- rom-parser parser on it:
Valid ROM signature found @600h, PCIR offset 190h
       PCIR: type 0 (x86 PC-AT), vendor: 10de, device: 128b, class: 030000
       PCIR: revision 0, vendor revision: 1
Valid ROM signature found @fc00h, PCIR offset 1ch
       PCIR: type 3 (EFI), vendor: 10de, device: 128b, class: 030000
       PCIR: revision 3, vendor revision: 0
               EFI: Signature Valid, Subsystem: Boot, Machine: X64
       Last image


However when I try to use nvidia_vbios_vfio_patcher.py I get an error:

python nvidia_vbios_vfio_patcher.py -i ../nvidia.rom -o patched
Opening the ROM file...
Scanning for ROM offsets...
Traceback (most recent call last):
 File "nvidia_vbios_vfio_patcher.py", line 194, in <module>
   main()
 File "nvidia_vbios_vfio_patcher.py", line 168, in main
   rom.detect_offsets()
 File "nvidia_vbios_vfio_patcher.py", line 77, in detect_offsets
   raise CheckException("Couldn't find the ROM footer!")
__main__.CheckException: Couldn't find the ROM footer!

It seems that my cards vbios is maybe too old (?).
I looked at the "footer" and saw that the offset between
"564e" and "NPDS" is 124 octels instead of 348 as the
script expects:

00020e00: 564e 3f00 0000 0000 0000 0000 0000 0000  VN?.............
00020e10: 0000 0000 0000 0000 4000 65d0 163b 5159  ........ at .e..;QY
00020e20: 6859 c05d 501e 0800 0000 0000 0000 0000  hY.]P...........
00020e30: 0000 0000 0000 0000 0000 002e 8bc0 8bc0  ................
00020e40: 4e50 4453 de10 b012 0000 1800 0000 0000  NPDS............
00020e50: 3f00 0000 e000 0000 2e8b c02e 8bc0 8bc0  ?...............
00020e60: 4e50 4445 0101 0c00 3f00 0000 0171 c3f9  NPDE....?....q..
00020e70: c3f8 c30b e4c3 3bc0 c3b8 4f01 c3cb 0000  ......;...O.....

When I do this change then nvidia_vbios_patcher.py finishes:

diff --git a/nvidia_vbios_vfio_patcher.py b/nvidia_vbios_vfio_patcher.py
index 0e899fd..cda844a 100755
--- a/nvidia_vbios_vfio_patcher.py
+++ b/nvidia_vbios_vfio_patcher.py
@@ -69,11 +69,13 @@ class VBIOSROM(object):
        # Search for the footer, which are shortly followed by
        # 'NPDS' and 'NPDE' strings. 'NPDS' and 'NPDE' markers are
separated by
        # 28 ASCII characters
-        FOOTER_REGEX = (
-
           b'564e(([a-z]|[0-9]){348})(4e504453)(([a-z]|[0-9]){56})(4e504445)'
+        # 348
+        FOOTER_REGEX = (
+
           b'564e(([a-z]|[0-9]){124})(4e504453)(([a-z]|[0-9]){56})(4e504445)'
        )
        result = re.compile(FOOTER_REGEX).search(self.content)
        if not result or len(result.groups()) != 6:

But actually I have no idea what the patcher actually does.
Is it patching x86 vbios code?




NVIDIA Firmware Update Utility (Version 5.414.0)
Simplified Version For OEM Only
Adapter: GeForce GT 710       (10DE,128B,0000,0000) H:--:NRM
S:00,B:05,D:00,F:00

Identifying EEPROM...
EEPROM ID (7F,9D42) : PMC Pm25LQ020 2.3-3.6V 2048Kx1S, page
Reading adapter firmware image...
IFR Data Size         : 1164 bytes
IFR CRC32             : CF1166A7
IFR Image Size        : 1536 bytes
IFR Image CRC32       : 66302A97
IFR Subsystem ID      : 0000-0000
Image Size            : 167936 bytes
Version               : 80.28.A6.00.11
RC32                : D3697E3F
Image Hash            : 2F6FCEF455A9D2462C3184827417106D
Subsystem ID          : 0000-0000
Hierarchy ID          : Normal Board
Chip SKU              : 203-0
Project               : 2132-0014
CDP                   : N/A
Build Date            : 10/09/15
Modification Date     : 01/06/16
UEFI Support          : Yes
UEFI Version          : 0x10033 (Jul 13 2015 @ 19761311 )
UEFI Variant Id       : 0x0000000000000004 ( GK1xx )
UEFI Signer(s)        : Microsoft Corporation UEFI CA 2011
InfoROM Version       : N/A
InfoROM Backup Exist  : NO
License Placeholder   : Absent
GPU Mode              : N/A
Saving of image completed.


Am Di., 21. Aug. 2018 um 04:19 Uhr schrieb Alex John <alex at stty.io>:

> On Mon, Aug 20, 2018 at 05:41:57PM +0200, Konrad Eisele wrote:
> > How can I dump the rom image?
> > I used
> > $cd /sys/devices/pci0000:00/0000:00:02.0/0000:01:00.0
> > $echo 1>rom
> > $cat rom > /mnt/nvidia_bios.rom
>
> This method did not work for me with a 1080 GTX. I reseated the GPU in
> PCIe lane
> 2 of my botherboard, swapped primary GPU to the iGPU and then dumped the
> rom
> using nvflash.
>
> While the device was still the primary GPU (after reseating and
> rebooting), I
> had to use a patching utility[0] before it could be passed through.
>
> Thanks
> Alex
>
> [0] https://github.com/Matoking/NVIDIA-vBIOS-VFIO-Patcher
>
> _______________________________________________
> vfio-users mailing list
> vfio-users at redhat.com
> https://www.redhat.com/mailman/listinfo/vfio-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/vfio-users/attachments/20180823/96202a0b/attachment.htm>


More information about the vfio-users mailing list