[vfio-users] "Invalid PCI ROM header signature: expecting 0xaa55, got 0xffff" when attempting to dump PCI ROM
Alex Williamson
alex.williamson at redhat.com
Mon Mar 11 02:09:13 UTC 2019
On Sun, 10 Mar 2019 18:06:37 -0400
Nicolas Roy-Renaud <nicolas.roy-renaud.1 at ens.etsmtl.ca> wrote:
> I've seen a lot of people before reccomand VFIO newcomers to flash their
> GPU if they couldn't get their passthrough working right before, and
> since I know how potentially risky and avoidable this sort of procedure
> is (since QEMU lets you just pass your own ROM to the VM to be used
> instead), and while attempting to go through the steps myself
> <http://vfio.blogspot.com/2014/08/does-my-graphics-card-rom-support-efi.html>
> (even though I've had a working VFIO setup for years), got something
> unexpected.
>
> Attempting to dump the ROM from my guest card _/freshly /_/_after a
> reboot_/ results in the following error message :
>
> cat: '/sys/bus/pci/devices/0000:07:00.0/rom': Input/output error
>
> Accompanied by the following like in dmesg :
>
> [ 1734.316429] vfio-pci 0000:07:00.0: Invalid PCI ROM header signature: expecting 0xaa55, got 0xffff
If lspci for the device reports:
Control: I/O- Mem- BusMaster- ...
(specifically Mem-), this could be the reason it's failing. The PCI
ROM BAR is a memory region and memory decode needs to be enabled on the
device in order to get access to it. Also if you have the device
already bound to vfio-pci, the device might be in a D3 low power state,
which could make that memory region unavailable. You can use the
'enable' file in sysfs to fix both of these, so your sequence would
look like this:
echo 1 > /sys/bus/pci/devices/0000:07:00.0/enable
echo 1 > /sys/bus/pci/devices/0000:07:00.0/rom
cat /sys/bus/pci/devices/0000:07:00.0/rom > gpu.rom
echo 0 > /sys/bus/pci/devices/0000:07:00.0/rom
echo 0 > /sys/bus/pci/devices/0000:07:00.0/enable
Thanks,
Alex
More information about the vfio-users
mailing list