Bug 102321 - OpRegion support for skylake.
Summary: OpRegion support for skylake.
Status: RESOLVED MOVED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/iGVT-g (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Terrence Xu
QA Contact: Terrence Xu
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-20 20:19 UTC by José Pekkarinen
Modified: 2019-11-29 16:47 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description José Pekkarinen 2017-08-20 20:19:17 UTC
Hi,

I'm running kernel 4.12.7 with vfio modules for mediated devices and kvmgt, and qemu 2.9. I create a mediated device using the following script lines:

uuid=<write some valid uuid here>
[ ! -d "/sys/class/mdev_bus/0000:00:02.0/$uuid" ] && echo "$uuid" >> /sys/class/mdev_bus/0000:00:02.0/mdev_supported_types/i915-GVTg_V5_4/create

The device turns up in sys correctly:

$ ls /sys/bus/pci/devices/0000\:00\:02.0/<uuid>/
driver  intel_vgpu  iommu_group  mdev_type  power  remove  subsystem  uevent

# dmesg|grep vfio
[ 2746.481909] vfio_mdev <uuid>: MDEV: group_id = 8

Trying to run the virtual machine using:

sudo qemu-system-x86_64 -enable-kvm -cpu host -smp 2,cores=1,threads=2 \
        -m 8G -mem-path /mnt/hugepages -vga none \
        -device vfio-pci,romfile=/sys/devices/pci0000:00/0000:00:02.0/rom,sysfsdev="/sys/class/mdev_bus/0000:00:02.0/$uuid",bus=pci.0,addr=02.0 \
        -netdev user,id=user.0 -device e1000,netdev=user.0 \
        -device ich9-usb-uhci3,id=uhci -device usb-ehci,id=ehci -device nec-usb-xhci,id=xhci \
        -device virtio-serial \
        -chardev socket,path=/tmp/virtio-serial.sock,server,nowait,id=serial-log \
        -device virtserialport,chardev=serial-log,name=ant.port.0 \
        -drive file=win7.img,format=raw,cache=none,aio=native,if=virtio

Brings the following output:

No protocol specified
qemu-system-x86_64: -device vfio-pci,romfile=/sys/devices/pci0000:00/0000:00:02.0/rom,sysfsdev=/sys/class/mdev_bus/0000:00:02.0/<uuid>,bus=pci.0,addr=02.0: IGD device <uuid> does not support OpRegion access,legacy mode disabled

Device is:

# lspci -vvvs 0000:00:02.0
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 520 (rev 07) (prog-if 00 [VGA controller])
        Subsystem: CLEVO/KAPOK Computer HD Graphics 520
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0
        Interrupt: pin A routed to IRQ 131
        Region 0: Memory at de000000 (64-bit, non-prefetchable) [size=16M]
        Region 2: Memory at c0000000 (64-bit, prefetchable) [size=256M]
        Region 4: I/O ports at f000 [size=64]
        [virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
        Capabilities: [40] Vendor Specific Information: Len=0c <?>
        Capabilities: [70] Express (v2) Root Complex Integrated Endpoint, MSI 00
                DevCap: MaxPayload 128 bytes, PhantFunc 0
                        ExtTag- RBE+
                DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
                        RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
                        MaxPayload 128 bytes, MaxReadReq 128 bytes
                DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
                DevCap2: Completion Timeout: Not Supported, TimeoutDis-, LTR-, OBFF Not Supported
                DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled
        Capabilities: [ac] MSI: Enable+ Count=1/1 Maskable- 64bit-
                Address: fee00018  Data: 0000
        Capabilities: [d0] Power Management version 2
                Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [100 v1] Process Address Space ID (PASID)
                PASIDCap: Exec+ Priv-, Max PASID Width: 14
                PASIDCtl: Enable- Exec- Priv-
        Capabilities: [200 v1] Address Translation Service (ATS)
                ATSCap: Invalidate Queue Depth: 00
                ATSCtl: Enable-, Smallest Translation Unit: 00
        Capabilities: [300 v1] Page Request Interface (PRI)
                PRICtl: Enable- Reset-
                PRISta: RF- UPRGI- Stopped-
                Page Request Capacity: 00008000, Page Request Allocation: 00000000
        Kernel driver in use: i915
        Kernel modules: i915

Please, let me know if there is something I can help you with.

Thanks!

José.
Comment 1 José Pekkarinen 2017-12-10 18:13:59 UTC
I've been testing this with a new setup based in kabylake with more recent
kernel. The outcome is that the way the rom is specified is wrong, however,
I don't find a way to extract it without an IO error in both the skylake
or the kabylake machine. This is the output:

# echo 1 > /sys/devices/pci0000:00/0000:00:02.0/rom
# cat /sys/devices/pci0000:00/0000:00:02.0/rom > vbios.dump
cat: '/sys/devices/pci0000:00/0000:00:02.0/rom': Input/output error

This follows the instructions here:

https://01.org/linuxgraphics/documentation/development/how-dump-video-bios

Any help appreciated.

José.
Comment 2 José Pekkarinen 2017-12-10 19:02:39 UTC
Output of lspci on new machine:

00:02.0 VGA compatible controller: Intel Corporation Device 5916 (rev 02) (prog-if 00 [VGA controller])
        Subsystem: Lenovo Device 3989
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0, Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 128
        Region 0: Memory at b1000000 (64-bit, non-prefetchable) [size=16M]
        Region 2: Memory at c0000000 (64-bit, prefetchable) [size=256M]
        Region 4: I/O ports at 5000 [size=64]
        [virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
        Capabilities: [40] Vendor Specific Information: Len=0c <?>
        Capabilities: [70] Express (v2) Root Complex Integrated Endpoint, MSI 00
                DevCap: MaxPayload 128 bytes, PhantFunc 0
                        ExtTag- RBE+
                DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
                        RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
                        MaxPayload 128 bytes, MaxReadReq 128 bytes
                DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
                DevCap2: Completion Timeout: Not Supported, TimeoutDis-, LTR-, OBFF Not Supported
                DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled
        Capabilities: [ac] MSI: Enable+ Count=1/1 Maskable- 64bit-
                Address: fee00018  Data: 0000
        Capabilities: [d0] Power Management version 2
                Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [100 v1] Process Address Space ID (PASID)
                PASIDCap: Exec- Priv-, Max PASID Width: 14
                PASIDCtl: Enable- Exec- Priv-
        Capabilities: [200 v1] Address Translation Service (ATS)
                ATSCap: Invalidate Queue Depth: 00
                ATSCtl: Enable-, Smallest Translation Unit: 00
        Capabilities: [300 v1] Page Request Interface (PRI)
                PRICtl: Enable- Reset-
                PRISta: RF- UPRGI- Stopped+
                Page Request Capacity: 00008000, Page Request Allocation: 00000000
        Kernel driver in use: i915
        Kernel modules: i915

# uname -r
4.14.5

sudo qemu-system-x86_64 -enable-kvm -cpu host -smp 2,cores=1,threads=2 \
        -m 8G -display vnc=0:0 -vga none \
        -device vfio-pci,id=video.1,sysfsdev=/sys/class/mdev_bus/0000:00:02.0/$uuid,bus=pci.0,rombar=0,addr=02.0 \
        -netdev user,id=user.0,smb=/home/pekkari/share -device e1000,netdev=user.0 \
        -device ich9-usb-uhci3,id=uhci -device usb-ehci,id=ehci -device nec-usb-xhci,id=xhci \
        -device virtio-serial -device usb-tablet -device ich9-intel-hda -device hda-duplex \
        -object input-linux,id=kbd,evdev=/dev/input/by-path/platform-i8042-serio-0-event-kbd \
        -chardev socket,path=/tmp/virtio-serial.sock,server,nowait,id=serial-log \
        -device virtserialport,chardev=serial-log,name=ant.port.0 \
        -cdrom /home/pekkari/machines/win7/virtio-win-0.1.141.iso \
        -drive file=win7.img,format=raw,cache=none,aio=native,if=virtio

IGD device $uuid has no ROM, legacy mode disabled
Comment 3 José Pekkarinen 2018-01-30 09:17:26 UTC
I managed to dump a vbios using legacy bios setting, yet the outcome is always OpRegion not supported:

./440fx-w7 vnc
qemu-system-x86_64: -device vfio-pci,id=video.1,sysfsdev=/sys/class/mdev_bus/0000:00:02.0/7f4d1dbb-5471-4aa7-9fd5-704c0f0afc70,bus=pci.0,romfile=vga.rom,addr=02.0: IGD device 7f4d1dbb-5471-4aa7-9fd5-704c0f0afc70 does not support OpRegion access,legacy mode disabled
No protocol specified
xcb_connection_has_error() returned true
audio: Failed to create voice `adc'
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.1.2/work/alsa-lib-1.1.2/src/pcm/pcm.c:8251:(snd_pcm_recover) underrun occurred
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.1.2/work/alsa-lib-1.1.2/src/pcm/pcm.c:8251:(snd_pcm_recover) underrun occurred
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.1.2/work/alsa-lib-1.1.2/src/pcm/pcm.c:8251:(snd_pcm_recover) underrun occurred
Comment 4 Hang Yuan 2018-11-30 05:07:16 UTC
Please refer "https://github.com/intel/gvt-linux/wiki/GVTg_Setup_Guide" for GVT-g setup.
Comment 5 Martin Peres 2019-11-29 16:47:22 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/drm/intel/issues/10.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.