[vfio-users] IGD passthrough: No Seabios output; PTE read access not set

Manuel Ullmann ullman.alias at posteo.de
Sat Dec 10 18:05:18 UTC 2016



Am 10.12.2016 um 18:20 schrieb Alex Williamson:
> On Sat, 10 Dec 2016 18:11:41 +0100
> Manuel Ullmann <ullman.alias at posteo.de> wrote:
>
>>> On Sat, 10 Dec 2016 02:07:43 +0100 > Manuel Ullmann <ullman.alias at posteo.de> wrote: > >>  
>> qemu-system-x86_64 -cpu host\ >>                    -usb\
>>>>                    -machine type=pc,accel=kvm\ >>                     
>> -enable-kvm\ >>                    -vga none\ >>                   
>> -nographic\ >>                    -display none\ >>                   
>> -nodefconfig\ >>                    -display none\ >>                   
>> -boot once=d\ >>                    -bios /usr/share/qemu/bios.bin\
>>>>                    -m 2G\ >>                    -drive >>  
>> file=/dev/genhd/ReactOS,cache=none,if=virtio,format=raw,index=0\
>>>>                    -drive >>  
>> file=/mnt/platz/Betriebssystemabbilder/virtio-win-0.1.118.iso,media=cdrom,index=2\
>>>>                    -smb /mnt/platz/QemuShare\ >>                    #  
>> headphone DAC >>                    -usbdevice host:1019:0011\
>>>>                    # mouse >>                    -usbdevice  
>> host:046d:c246\ >>                    -device >>
>> vfio-pci,host=00:02.0,addr=02.0,bus=pci.0,x-vga=on,romfile=/mnt/platz/Bugs/intelBios/intelHaswell.rom\
>>>> The ROM is always suspect, where did you get it?  Why are you  
>> passing > one rather than letting QEMU get it?  The typical case for IGD
>> ROMs > acquired through the rom file in sysfs is that the device ID does
>> not > match and the checksum is off.  Either of these will prevent
>> SeaBIOS > from using it.  QEMU will fix both of these automatically when
>> it loads > the ROM itself.  If passing a romfile, you need to fix those
>> in > advance.  Adding a serial console will generally give you SeaBIOS >
>> logging.  Thanks, > > Alex
>>
>> Ok, thanks for the hint. So, I get until the following section in your
>> patch:
>>
>> +                hw_error("vfio-igd: Guest attempted to program IGD GTT
>> before "
>> +                         "BIOS reserved stolen memory.  Unsupported
>> BIOS?");
>>
>> The vm will not boot anymore, but I guess that is caused by the pass
>> through being tried finally.
>>
>> Best regards,
>> Manuel
>>
>> New log:
>>
>> qemu-system-x86_64: -smb /mnt/platz/QemuShare: The -smb option is
>> deprecated. Please use '-netdev user,smb=...' instead.
>> qemu-system-x86_64: Warning: speed mismatch trying to attach usb device
>> "FOSTEX USB AUDIO HP-A4" (high speed) to bus "usb-bus.0", port "1" (full
>> speed)
>> SeaBIOS (version 1.8.2-20150714_191116-)
>> RamSize: 0x80000000 [cmos]
>> Relocating init from 0x000e1980 to 0x7ffb0620 (size 63776)
>> Found QEMU fw_cfg
>> RamBlock: addr 0x0000000000000000 len 0x0000000080000000 [e820]
>> Moving pm_base to 0x600
>> CPU Mhz=3206
>> === PCI bus & bridge init ===
>> PCI: pci_bios_init_bus_rec bus = 0x0
>> === PCI device probing ===
>> Found 9 PCI devices (max PCI bus is 00)
>> === PCI new allocation pass #1 ===
>> PCI: check devices
>> === PCI new allocation pass #2 ===
>> PCI: IO: c000 - c0cf
>> PCI: 32: 0000000080000000 - 00000000fec00000
>> PCI: map device bdf=00:02.0  bar 4, addr 0000c000, size 00000040 [io]
>> PCI: map device bdf=00:04.0  bar 0, addr 0000c040, size 00000040 [io]
>> PCI: map device bdf=00:01.2  bar 4, addr 0000c080, size 00000020 [io]
>> PCI: map device bdf=00:03.0  bar 0, addr 0000c0a0, size 00000020 [io]
>> PCI: map device bdf=00:01.1  bar 4, addr 0000c0c0, size 00000010 [io]
>> PCI: map device bdf=00:02.0  bar 0, addr fe400000, size 00400000 [mem]
>> PCI: map device bdf=00:03.0  bar 6, addr fe800000, size 00040000 [mem]
>> PCI: map device bdf=00:02.0  bar 6, addr fe840000, size 00020000 [mem]
>> PCI: map device bdf=00:03.0  bar 1, addr fe860000, size 00001000 [mem]
>> PCI: map device bdf=00:04.0  bar 1, addr fe861000, size 00001000 [mem]
>> PCI: map device bdf=00:02.0  bar 2, addr e0000000, size 10000000 [prefmem]
>> PCI: map device bdf=00:03.0  bar 4, addr f0000000, size 00800000 [prefmem]
>> PCI: map device bdf=00:04.0  bar 4, addr f0800000, size 00800000 [prefmem]
>> PCI: init bdf=00:00.0 id=8086:1237
>> PCI: init bdf=00:01.0 id=8086:7000
>> PIIX3/PIIX4 init: elcr=00 0c
>> PCI: init bdf=00:01.1 id=8086:7010
>> PCI: init bdf=00:01.2 id=8086:7020
>> PCI: init bdf=00:01.3 id=8086:7113
>> Using pmtimer, ioport 0x608
>> PCI: init bdf=00:02.0 id=8086:0412
>> PCI: init bdf=00:03.0 id=1af4:1000
>> PCI: init bdf=00:04.0 id=1af4:1001
>> PCI: init bdf=00:1f.0 id=8086:8c4a
>> PCI: Using 00:02.0 for primary VGA
>> Found 1 cpu(s) max supported 1 cpu(s)
>> Copying PIR from 0x7ffbfc80 to 0x000f1220
>> Copying MPTABLE from 0x00006e20/7ffa72c0 to 0x000f1120
>> Copying SMBIOS entry point from 0x00006e20 to 0x000f0f70
>> Scan for VGA option rom
>> Running option rom at c000:0003
>> qemu: hardware error: vfio-igd: Guest attempted to program IGD GTT
>> before BIOS reserved stolen memory.  Unsupported BIOS?
> I think this is suggesting the remaining problem, you need a version of
> SeaBIOS that supports IGD assignment.  That may be fixed by simply
> removing the -bios option from your QEMU invocation such that the
> default BIOS installed with QEMU is used.  Why are you running old rc
> versions of things that have already been released anyway?  The
> x-vga=on option is also unnecessary with IGD assignment.  Thanks,
>
> Alex
Interesting. That worked. :)
Regarding the vBios rom, that was indeed one from sysfs. I find it
confusing though, that removing the -bios option fixed it. I thought
qemu depends on seabios and if I diff the bios.bin files in
/usr/share/seabios and /usr/share/qemu diff finds no binary differences.
So which bios is qemu now using? Is it built-in? An explanation would be
very much appreciated.
Regarding the kernel version, I actually tried to avoid kernel freezes
on hibernation resume, which I reproduced often (at least 50%) in stable
Gentoo kernel 4.4.26. I then searched for possible bug fixes in future
releases and found a commit in 4.9-rc6 dealing with Intel cpu
synchronization issues, where a non-boot cpu could get active, while it
shouldn’t, causing writes to the cpu register, which invalidated the
actually expected ones. Can’t find it anymore though and since that one
was rare, I assume now it is unrelated.
Somewhere between 4.4 and 4.9 has to be an improvement though, because I
now get successful i915 GPU resets instead of kernel freezes rendering
sysrq unusable. I admit, that I should eventually downgrade to 4.8 to
check for temporary regressions in this specific release candidate.
Could be specific to Haswell, because I’ve never seen it on my Skylake
laptop.

Best regards,
Manuel

Final qemu command line

qemu-system-x86_64 -cpu host\
           -usb\
           -machine type=pc,accel=kvm\
           -enable-kvm\
           -vga none\
           -display none\
           -nodefconfig\
           -display none\
           -boot once=d\
           -m 2G\
           -drive
file=/dev/genhd/ReactOS,cache=none,if=virtio,format=raw,index=0\
           -drive
file=/mnt/platz/Betriebssystemabbilder/virtio-win-0.1.118.iso,media=cdrom,index=2\
           -smb /mnt/platz/QemuShare\
           -usbdevice host:1019:0011\
           -usbdevice host:046d:c246\
           -device vfio-pci,host=00:02.0,addr=02.0,bus=pci.0,x-vga=on\
           -chardev stdio,id=seabios\
           -device isa-debugcon,iobase=0x402,chardev=seabios\
           -netdev user,id=vmnic -device virtio-net,netdev=vmnic
&>/var/log/qemuvm.log

Final SeaBios log

qemu-system-x86_64: -smb /mnt/platz/QemuShare: The -smb option is
deprecated. Please use '-netdev user,smb=...' instead.
qemu-system-x86_64: Warning: speed mismatch trying to attach usb device
"FOSTEX USB AUDIO HP-A4" (high speed) to bus "usb-bus.0", port "1" (full
speed)
SeaBIOS (version rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org)
BUILD: gcc: (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4) binutils: version
2.23.52.0.1-55.el7 20130226
No Xen hypervisor found.
RamSize: 0x80000000 [cmos]
Relocating init from 0x000dbf60 to 0x7ffad650 (size 76064)
Found QEMU fw_cfg
QEMU fw_cfg DMA interface supported
RamBlock: addr 0x0000000000000000 len 0x0000000080000000 [e820]
Moving pm_base to 0x600
=== PCI bus & bridge init ===
PCI: pci_bios_init_bus_rec bus = 0x0
=== PCI device probing ===
Found 9 PCI devices (max PCI bus is 00)
=== PCI new allocation pass #1 ===
PCI: check devices
=== PCI new allocation pass #2 ===
PCI: IO: c000 - c0cf
PCI: 32: 0000000080000000 - 00000000fec00000
PCI: map device bdf=00:02.0  bar 4, addr 0000c000, size 00000040 [io]
PCI: map device bdf=00:04.0  bar 0, addr 0000c040, size 00000040 [io]
PCI: map device bdf=00:01.2  bar 4, addr 0000c080, size 00000020 [io]
PCI: map device bdf=00:03.0  bar 0, addr 0000c0a0, size 00000020 [io]
PCI: map device bdf=00:01.1  bar 4, addr 0000c0c0, size 00000010 [io]
PCI: map device bdf=00:02.0  bar 0, addr fe400000, size 00400000 [mem]
PCI: map device bdf=00:03.0  bar 6, addr fe800000, size 00040000 [mem]
PCI: map device bdf=00:02.0  bar 6, addr fe840000, size 00020000 [mem]
PCI: map device bdf=00:03.0  bar 1, addr fe860000, size 00001000 [mem]
PCI: map device bdf=00:04.0  bar 1, addr fe861000, size 00001000 [mem]
PCI: map device bdf=00:02.0  bar 2, addr e0000000, size 10000000 [prefmem]
PCI: map device bdf=00:03.0  bar 4, addr f0000000, size 00800000 [prefmem]
PCI: map device bdf=00:04.0  bar 4, addr f0800000, size 00800000 [prefmem]
PCI: init bdf=00:00.0 id=8086:1237
PCI: init bdf=00:01.0 id=8086:7000
PIIX3/PIIX4 init: elcr=00 0c
PCI: init bdf=00:01.1 id=8086:7010
PCI: init bdf=00:01.2 id=8086:7020
PCI: init bdf=00:01.3 id=8086:7113
Using pmtimer, ioport 0x608
PCI: init bdf=00:02.0 id=8086:0412
Intel IGD OpRegion enabled at 0x7fffe000, size 8KB, dev 00:02.0
Intel IGD BDSM enabled at 0x7fd00000, size 2MB, dev 00:02.0
PCI: init bdf=00:03.0 id=1af4:1000
PCI: init bdf=00:04.0 id=1af4:1001
PCI: init bdf=00:1f.0 id=8086:8c4a
PCI: Using 00:02.0 for primary VGA
Found 1 cpu(s) max supported 1 cpu(s)
Copying PIR from 0x7ffbfcc4 to 0x000f6cc0
Copying MPTABLE from 0x00006dfc/7ffa4260 to 0x000f6bc0
Copying SMBIOS entry point from 0x00006dfc to 0x000f6a00
Scan for VGA option rom
Running option rom at c000:0003
Turning on vga text mode console
SeaBIOS (version rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org)
UHCI init on dev 00:01.2 (io=c080)
Found 1 lpt ports
Found 1 serial ports
Searching bootorder for: /pci at i0cf8/isa at 1/fdc at 03f0/floppy at 0
ATA controller 1 at 1f0/3f4/0 (irq 14 dev 9)
ATA controller 2 at 170/374/0 (irq 15 dev 9)
found virtio-blk at 0:4
pci dev 0:4 using modern (1.0) virtio mode
Searching bootorder for: /pci at i0cf8/*@4
PS2 keyboard initialized
DVD/CD [ata1-0: QEMU DVD-ROM ATAPI-4 DVD/CD]
Searching bootorder for: /pci at i0cf8/*@1,1/drive at 1/disk at 0
USB mouse initialized
Initialized USB HUB (1 ports used)
All threads complete.
Scan for option roms
Running option rom at cf00:0003
pmm call arg1=1
pmm call arg1=0
pmm call arg1=1
pmm call arg1=0
Searching bootorder for: /pci at i0cf8/*@3
Searching bootorder for: /rom at genroms/kvmvapic.bin
Searching bootorder for: HALT
drive 0x000f6910: PCHS=16383/16/63 translation=lba LCHS=1024/255/63
s=105922560
Running option rom at d000:0003
Space available for UMB: d2800-ec800, f6540-f68b0
Returned 106496 bytes of ZoneHigh
e820 map has 9 items:
  0: 0000000000000000 - 000000000009fc00 = 1 RAM
  1: 000000000009fc00 - 00000000000a0000 = 2 RESERVED
  2: 00000000000f0000 - 0000000000100000 = 2 RESERVED
  3: 0000000000100000 - 000000007fd00000 = 1 RAM
  4: 000000007fd00000 - 000000007ff00000 = 2 RESERVED
  5: 000000007ff00000 - 000000007ffda000 = 1 RAM
  6: 000000007ffda000 - 0000000080000000 = 2 RESERVED
  7: 00000000feffc000 - 00000000ff000000 = 2 RESERVED
  8: 00000000fffc0000 - 0000000100000000 = 2 RESERVED
enter handle_19:
  NULL
Booting from DVD/CD...
Boot failed: Could not read from CDROM (code 0004)
enter handle_18:
  NULL
Booting from Floppy...
floppy error: 40 00 00 00 00 01 02
Boot failed: could not read the boot disk

enter handle_18:
  NULL
Booting from Hard Disk...
Booting from 0000:7c00
qemu-system-x86_64: Warning: speed mismatch trying to attach usb device
"FOSTEX USB AUDIO HP-A4" (high speed) to bus "usb-bus.0", port "1" (full
speed)
qemu-system-x86_64: Warning: speed mismatch trying to attach usb device
"FOSTEX USB AUDIO HP-A4" (high speed) to bus "usb-bus.0", port "1" (full
speed)
In resume (status=0)
In 32bit resume
Attempting a hard reboot
SeaBIOS (version rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org)
BUILD: gcc: (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4) binutils: version
2.23.52.0.1-55.el7 20130226
No Xen hypervisor found.
RamSize: 0x80000000 [cmos]
Relocating init from 0x000dbf60 to 0x7ffad650 (size 76064)
Found QEMU fw_cfg
QEMU fw_cfg DMA interface supported
RamBlock: addr 0x0000000000000000 len 0x0000000080000000 [e820]
Moving pm_base to 0x600
=== PCI bus & bridge init ===
PCI: pci_bios_init_bus_rec bus = 0x0
=== PCI device probing ===
Found 9 PCI devices (max PCI bus is 00)
=== PCI new allocation pass #1 ===
PCI: check devices
=== PCI new allocation pass #2 ===
PCI: IO: c000 - c0cf
PCI: 32: 0000000080000000 - 00000000fec00000
PCI: map device bdf=00:02.0  bar 4, addr 0000c000, size 00000040 [io]
PCI: map device bdf=00:04.0  bar 0, addr 0000c040, size 00000040 [io]
PCI: map device bdf=00:01.2  bar 4, addr 0000c080, size 00000020 [io]
PCI: map device bdf=00:03.0  bar 0, addr 0000c0a0, size 00000020 [io]
PCI: map device bdf=00:01.1  bar 4, addr 0000c0c0, size 00000010 [io]
PCI: map device bdf=00:02.0  bar 0, addr fe400000, size 00400000 [mem]
PCI: map device bdf=00:03.0  bar 6, addr fe800000, size 00040000 [mem]
PCI: map device bdf=00:02.0  bar 6, addr fe840000, size 00020000 [mem]
PCI: map device bdf=00:03.0  bar 1, addr fe860000, size 00001000 [mem]
PCI: map device bdf=00:04.0  bar 1, addr fe861000, size 00001000 [mem]
PCI: map device bdf=00:02.0  bar 2, addr e0000000, size 10000000 [prefmem]
PCI: map device bdf=00:03.0  bar 4, addr f0000000, size 00800000 [prefmem]
PCI: map device bdf=00:04.0  bar 4, addr f0800000, size 00800000 [prefmem]
PCI: init bdf=00:00.0 id=8086:1237
PCI: init bdf=00:01.0 id=8086:7000
PIIX3/PIIX4 init: elcr=00 0c
PCI: init bdf=00:01.1 id=8086:7010
PCI: init bdf=00:01.2 id=8086:7020
PCI: init bdf=00:01.3 id=8086:7113
Using pmtimer, ioport 0x608
PCI: init bdf=00:02.0 id=8086:0412
Intel IGD OpRegion enabled at 0x7fffe000, size 8KB, dev 00:02.0
Intel IGD BDSM enabled at 0x7fd00000, size 2MB, dev 00:02.0
PCI: init bdf=00:03.0 id=1af4:1000
PCI: init bdf=00:04.0 id=1af4:1001
PCI: init bdf=00:1f.0 id=8086:8c4a
PCI: Using 00:02.0 for primary VGA
Found 1 cpu(s) max supported 1 cpu(s)
Copying PIR from 0x7ffbfcc4 to 0x000f6cc0
Copying MPTABLE from 0x00006dfc/7ffa4260 to 0x000f6bc0
Copying SMBIOS entry point from 0x00006dfc to 0x000f6a00
Scan for VGA option rom
Running option rom at c000:0003
Turning on vga text mode console
SeaBIOS (version rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org)
UHCI init on dev 00:01.2 (io=c080)
Found 1 lpt ports
Found 1 serial ports
Searching bootorder for: /pci at i0cf8/isa at 1/fdc at 03f0/floppy at 0
ATA controller 1 at 1f0/3f4/0 (irq 14 dev 9)
ATA controller 2 at 170/374/0 (irq 15 dev 9)
found virtio-blk at 0:4
pci dev 0:4 using modern (1.0) virtio mode
Searching bootorder for: /pci at i0cf8/*@4
PS2 keyboard initialized
DVD/CD [ata1-0: QEMU DVD-ROM ATAPI-4 DVD/CD]
Searching bootorder for: /pci at i0cf8/*@1,1/drive at 1/disk at 0
USB mouse initialized
Initialized USB HUB (1 ports used)
All threads complete.
Scan for option roms
Running option rom at cf00:0003
pmm call arg1=1
pmm call arg1=0
pmm call arg1=1
pmm call arg1=0
Searching bootorder for: /pci at i0cf8/*@3
Searching bootorder for: /rom at genroms/kvmvapic.bin
Searching bootorder for: HALT
drive 0x000f6910: PCHS=16383/16/63 translation=lba LCHS=1024/255/63
s=105922560
Running option rom at d000:0003
Space available for UMB: d2800-ec800, f6540-f68b0
Returned 106496 bytes of ZoneHigh
e820 map has 9 items:
  0: 0000000000000000 - 000000000009fc00 = 1 RAM
  1: 000000000009fc00 - 00000000000a0000 = 2 RESERVED
  2: 00000000000f0000 - 0000000000100000 = 2 RESERVED
  3: 0000000000100000 - 000000007fd00000 = 1 RAM
  4: 000000007fd00000 - 000000007ff00000 = 2 RESERVED
  5: 000000007ff00000 - 000000007ffda000 = 1 RAM
  6: 000000007ffda000 - 0000000080000000 = 2 RESERVED
  7: 00000000feffc000 - 00000000ff000000 = 2 RESERVED
  8: 00000000fffc0000 - 0000000100000000 = 2 RESERVED
enter handle_19:
  NULL
Booting from Hard Disk...
Booting from 0000:7c00






More information about the vfio-users mailing list