intel / gvt-linux

Other
509 stars 95 forks source link

XenGT on KabyLake #123

Closed easydozen closed 4 years ago

easydozen commented 4 years ago

Could you please specify overall XenGT status on Kaby Lake?

I didn't manage to make it work in the following environment:

Several error messages appears on host during the domU initialization:

vgpu(1) Invalid FORCE_NONPRIV write 2094 vgpu 1: fail to emulate MMIO write 000024f8 len4 Please note fatal ioreq failure

DomU dmesg contains drm loading error:

[drm:intel_bios_init [i915]] ERROR Unexpected child device config size 38 (expected 33 for VBT version 186)

I have Kaby Lake R to test. Is it worth trying?

easydozen commented 4 years ago

It seems that errors above should be treated as warnings. The only thing that I've missed is the same gvt-ready kernel in DomU.

Moreover, I've got another success story with KabyLake R - i7-8550U, UHD620, fc30 as host and guest. This configuration works fine, except fedora-related known bug (rhbz#1592976)

I'm sorry for the mess.

bvqbao commented 4 years ago

Hello,

I have followed the instructions at https://github.com/intel/gvt-linux/wiki/GVTg_Setup_Guide#332-build-qemu--xen-for-xengt and created a Ubuntu VM but it doesn't seems to have a vGPU as intended:

root@ubuntu-guest:/home/bao# lspci 
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01)
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:02.0 Unassigned class [ff80]: XenSource, Inc. Xen Platform Device (rev 01)
00:03.0 VGA compatible controller: Cirrus Logic GD 5446

And:

lspci -v -s 00:03.0
00:03.0 VGA compatible controller: Cirrus Logic GD 5446 (prog-if 00 [VGA controller])
    Subsystem: Red Hat, Inc. QEMU Virtual Machine
    Physical Slot: 3
    Flags: bus master, fast devsel, latency 0
    Memory at f0000000 (32-bit, prefetchable) [size=32M]
    Memory at f3070000 (32-bit, non-prefetchable) [size=4K]
    Expansion ROM at 000c0000 [disabled] [size=128K]
    Kernel driver in use: cirrus
    Kernel modules: cirrusfb, cirrus

Here is its configuration file:

type='hvm'
vgt=1
vcpus=2
memory=4096
name='Ubuntu'
vif=[ 'type=ioemu,bridge=xenbr0,mac=00:25:10:03:0A:01,model=e1000' ]
device_model_version = 'qemu-xen'
disk=[ 'file:/home/bao/domains/ubuntu.img,hda,w' ]
serial='pty'
usb=1
usbdevice='tablet'
vfb=[ 'type=vnc,vnclisten=127.0.0.1,vncdisplay=1' ]
keymap='en-us'
vgt_low_gm_sz=128
acpi_s4=0
acpi_s3=0

On the host machine (Dom0):

root@ubuntu-host:/home/bao# lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers (rev 08)
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (rev 07)
00:04.0 Signal processing controller: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem (rev 08)
00:14.0 USB controller: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller (rev 21)
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-LP Thermal subsystem (rev 21)
00:15.0 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO I2C Controller #0 (rev 21)
00:15.1 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO I2C Controller #1 (rev 21)
00:16.0 Communication controller: Intel Corporation Sunrise Point-LP CSME HECI #1 (rev 21)
00:17.0 SATA controller: Intel Corporation Sunrise Point-LP SATA Controller [AHCI mode] (rev 21)
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #1 (rev f1)
00:1c.2 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #3 (rev f1)
00:1d.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #9 (rev f1)
00:1f.0 ISA bridge: Intel Corporation Intel(R) 100 Series Chipset Family LPC Controller/eSPI Controller - 9D4E (rev 21)
00:1f.2 Memory controller: Intel Corporation Sunrise Point-LP PMC (rev 21)
00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21)
00:1f.4 SMBus: Intel Corporation Sunrise Point-LP SMBus (rev 21)
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (4) I219-LM (rev 21)
01:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS525A PCI Express Card Reader (rev 01)
02:00.0 Network controller: Intel Corporation Wireless 8265 / 8275 (rev 78)
03:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981

Both host and guest machines use a Linux kernel built from https://github.com/intel/gvt-linux, gvt-stable-4.17 branch.

Any suggestions?

Thanks.

easydozen commented 4 years ago

Check if xengt module has been loaded.
You should be able to use sysfs interface (/sys/kernel/vgt/control/) manually for an existing xen domain. Take a look at xl dmesg.

bvqbao commented 4 years ago

In the .config file I have:

CONFIG_VFIO_MDEV=m
CONFIG_VFIO_MDEV_DEVICE=m
CONFIG_DRM_I915_GVT=y
CONFIG_DRM_I915_GVT_KVMGT=m
CONFIG_DRM_I915_GVT_XENGT=m

If I set CONFIG_DRM_I915_GVT_XENGT=y I have the above situation (xengt module isn't loaded), but with CONFIG_DRM_I915_GVT_XENGT=m I cannot boot into XenGT.

My grub menu configuration is as follows:

menuentry 'Xen GVT-g Upstream' --class xengt --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-b26b4ead-cc78-41fe-8fea-a1794c04b5c5' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_msdos
        insmod ext2
        if [ x$feature_platform_search_hint = xy ]; then
                search --no-floppy --fs-uuid --set=root b26b4ead-cc78-41fe-8fea-a1794c04b5c5
        else
                search --no-floppy --fs-uuid --set=root b26b4ead-cc78-41fe-8fea-a1794c04b5c5
        fi
        multiboot   /boot/xen-gvt.gz dom0_max_vcpus=2 dom0_mem=2048M iommu=1 loglvl=all guest_loglvl=all msi=1 conring_size=4M  console=com1 com1=115200,8n1 sync_console
        module   /boot/vmlinuz-4.17.0+ root=UUID=b26b4ead-cc78-41fe-8fea-a1794c04b5c5 ro ignore_loglevel intel_iommu=on log_buf_len=128M console=hvc0 drm.debug=0 i915.enable_gvt=1
        module  /boot/initrd.img-4.17.0+
}
easydozen commented 4 years ago

I'm using iommu=no-igfx option and the following gvt-related kconfig:

CONFIG_DRM_I915_GVT=y CONFIG_DRM_I915_GVT_KVMGT=m CONFIG_DRM_I915_GVT_XENGT=m

bvqbao commented 4 years ago

Ok. Thanks, the xengt module is now loaded. But still my Ubuntu VM cannot see the vGPU.

Regarding Igvtg-qemu, which version did you use? stable-2.12.0?

In the Config.mk (Igvtg-xen), I have:

QEMU_UPSTREAM_URL ?= file://localhost/home/bao/igvtg-xen/igvtg-qemu
QEMU_UPSTREAM_REVISION ?= df409dcdaadea8a7910dfbef10ec6b00794ee389
easydozen commented 4 years ago

Qemu tag: 2018-q3-stable-2.12.0. I'm pretty sure there is a typo in the guide.

easydozen commented 4 years ago

If anyone is interested in an alternative xengt howto: https://github.com/tabit-pro/tabit-qubes-repo