Hi,

I successfully loaded the modules at initramfs by creating an own module-setup.sh in /usr/lib/dracut/modules.d/00gvt
#!/bin/sh

installkernel() {
        instmods kvmgt
        instmods vfio-iommu-type1
        instmods vfio-mdev
}

Now an mdev-supported-types appears in /sys/bus/pci/devices/0000:00:02.0. However, I cannot echo the uuid to "create" in the i915-GVTg_V5_4 folder due to a disk full error.

Permissions are:
lenovo-yoga /sys/bus/pci/devices/0000:00:02.0/mdev_supported_types/i915-GVTg_V5_4 # ls -la
insgesamt 0
drwxr-xr-x 3 root root    0  3. Sep 12:02 .
drwxr-xr-x 4 root root    0  3. Sep 11:58 ..
-r--r--r-- 1 root root 4096  3. Sep 12:02 available_instances
--w------- 1 root root 4096  3. Sep 12:02 create
-r--r--r-- 1 root root 4096  3. Sep 12:02 description
-r--r--r-- 1 root root 4096  3. Sep 12:02 device_api
drwxr-xr-x 2 root root    0  3. Sep 12:02 devices

I can chmod +755 to create, then I can successfully echo the UUID and the folder is created at ../0000:00:02.0. However, it only remains there until the next reboot what causes the UUID folder to disappear again.

Finally, does someone know how to add the device in virt-manager xml config? I tried some parsing utilities and by adding the pci device in gui and added the <uuid> </uuid> flag but it causes my notebook monitor to turn off when I start the machine.

Thanks for help, I believe I am very close.

Greetings
Richard

2017-09-02 10:01 GMT+02:00 Richard Lagler <rilagler@gmail.com>:

Hi,


I tried three different ways to load the kvmgt at early boot:

  • include in grub.cfg
  • added in /etc/modprobe.d/
  • built an custom initramfs with dracut

My grub.cfg:

menuentry 'Gentoo GNU/Linux' --class kvmgt --class gentoo --class gnu-linux --class gnu --class os $menuent$
        load_video
        if [ "x$grub_platform" = xefi ]; then
                set gfxpayload=keep
        fi
    insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt11'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt11 --hint-efi=hd0,gpt11 --hint-baremet$
        else
          search --no-floppy --fs-uuid --set=root 9c5834cd-72ff-49f5-8ddb-f584a6881a7c
        fi
    echo    'Linux 4.12.5-gentoo wird geladen …'
        linux   /vmlinuz-4.12.5-gentoo root=UUID=c32b2c9c-3348-481b-974b-c7aba5c6c35e ro i915.enable_gvt=1 $
        echo    'Initiale Ramdisk wird geladen …'
        initrd  /initramfs-4.12.5-gentoo.img
}

My /etc/modprobe.d/gvt.conf (I tried also to include all dependencies for kvmgt)

lenovo-yoga ~ # cat /etc/modprobe.d/gvt.conf
options irqbypass
options kvm.ko ignore_msrs=1
options mdev
options vfio
options vfio_iommu_type1
options vfio_mdev
options kvmgt

#options kvm
#options vfio
#options mdev
#options kvmgt

options i915 enable_gvt=1

#softdep i915 pre: kvmgt

 

Last but not least my /etc/dracut.conf.d/gvt.conf

lenovo-yoga ~ # cat /etc/dracut.conf.d/gvt.conf
add_drivers+="kvm kvmgt vfio-iommu-type1 vfio-mdev" --force-add
add_dracutmodules+="kvm kvmgt vfio-iommu-type1 vfio-mdev" --force-add
#add_dracutmodules+="kvmgt"

Not sure if I should load as driver or dracutmodules since I found both ways in the Internet, I tried also only one of them. Without the --force-add option dracut doesn't build an initramfs and the kvmgt cannot be found. With the options it builds an initramfs, but says it doesn't know the --force-add command (isn't it funny?)

I quickly tried to build the initramfs with standard options, so there are some modules which are not found too, I can fix this later if necessary at all.

lenovo-yoga /boot # dracut
dracut: Executing: /usr/bin/dracut
dracut: dracut module 'bootchart' will not be installed, because command '/sbin/bootchartd' could not be found!
dracut: dracut module 'dash' will not be installed, because command '/bin/dash' could not be found!
dracut: dracut module 'systemd-bootchart' will not be installed, because command '/usr/lib/systemd/systemd-bootchart' could not be found!
dracut: zfsexpandknowledge: host device /dev/sda8
dracut: zfsexpandknowledge: host device /dev/sda11
dracut: zfsexpandknowledge: device /dev/sda11 of type ext4
dracut: zfsexpandknowledge: device /dev/sda8 of type ext4
dracut: dracut module 'plymouth' will not be installed, because command 'plymouthd' could not be found!
dracut: dracut module 'plymouth' will not be installed, because command 'plymouth' could not be found!
dracut: dracut module 'plymouth' will not be installed, because command 'plymouth-set-default-theme' could not be found!
dracut: dracut module 'btrfs' will not be installed, because command 'btrfs' could not be found!
dracut: dracut module 'crypt' will not be installed, because command 'cryptsetup' could not be found!
dracut: dracut module 'dm' will not be installed, because command 'dmsetup' could not be found!
dracut: dracut module 'dmraid' will not be installed, because command 'dmraid' could not be found!
dracut: dracut module 'lvm' will not be installed, because command 'lvm' could not be found!
dracut: dracut module 'mdraid' will not be installed, because command 'mdadm' could not be found!
dracut: dracut module 'multipath' will not be installed, because command 'multipath' could not be found!
dracut: dracut module 'fcoe-uefi' will not be installed, because command 'dcbtool' could not be found!
dracut: dracut module 'fcoe-uefi' will not be installed, because command 'fipvlan' could not be found!
dracut: dracut module 'fcoe-uefi' will not be installed, because command 'lldpad' could not be found!
dracut: dracut module 'iscsi' will not be installed, because command 'iscsistart' could not be found!
dracut: dracut module 'iscsi' will not be installed, because command 'iscsi-iname' could not be found!
dracut: dracut module 'biosdevname' will not be installed, because command 'biosdevname' could not be found!
dracut: dracut module 'kvmgt' cannot be found or installed.


My kvmgt is located at:

lenovo-yoga ~ # find / -name *kvmgt*
/sys/module/vfio/holders/kvmgt
/sys/module/kvmgt
/sys/module/mdev/holders/kvmgt
/sys/module/kvm/holders/kvmgt
/lib64/modules/4.12.5-gentoo/kernel/drivers/gpu/drm/i915/gvt/kvmgt.ko
/usr/src/linux-4.12.5-gentoo/include/config/drm/i915/gvt/kvmgt.h
/usr/src/linux-4.12.5-gentoo/.tmp_versions/kvmgt.mod
/usr/src/linux-4.12.5-gentoo/drivers/gpu/drm/i915/gvt/kvmgt.mod.c
/usr/src/linux-4.12.5-gentoo/drivers/gpu/drm/i915/gvt/.kvmgt.mod.o.cmd
/usr/src/linux-4.12.5-gentoo/drivers/gpu/drm/i915/gvt/kvmgt.ko
/usr/src/linux-4.12.5-gentoo/drivers/gpu/drm/i915/gvt/.kvmgt.o.cmd
/usr/src/linux-4.12.5-gentoo/drivers/gpu/drm/i915/gvt/.kvmgt.ko.cmd
/usr/src/linux-4.12.5-gentoo/drivers/gpu/drm/i915/gvt/kvmgt.mod.o
/usr/src/linux-4.12.5-gentoo/drivers/gpu/drm/i915/gvt/kvmgt.o
/usr/src/linux-4.12.5-gentoo/drivers/gpu/drm/i915/gvt/kvmgt.c

I believe dracut should find it in /lib64, but copied it also to /usr/lib/dracut/modules.d/

Any idea what still prevents to load kvmgt at boot?


Kind Regards,

Richard

2017-09-01 20:44 GMT+02:00 Richard Lagler <rilagler@gmail.com>:

Hi,

done! Additional info, I have "External firmware blobs to build into the kernel binary (i915/skl_dmc_ver1_26.bin)" and

"(/lib/firmware) Firmware blobs root directory" in my custom kernel in Gentoo.


Kind Regards,

Richard


On 01.09.2017 20:36, Iarwain Ben-adar wrote:
Hi,
You may want to try modprobe i915 just in case something else is preventing it from becoming loaded automatically. 

-Tom

On Fri, Sep 1, 2017 at 2:32 PM Richard Lagler <rilagler@gmail.com> wrote:
Hi Alex,

Thanks for the hin, I have included it but it still doesn't become
autoloaded in initramfs. This is my /boot/grub/grub.cfg

menuentry 'Gentoo GNU/Linux' --class gentoo --class kvmgt --class
gnu-linux --class gnu --class os $menuentry_id_option
'gnulinux-simple-c32b2c$
         load_video
         if [ "x$grub_platform" = xefi ]; then
                 set gfxpayload=keep
         fi
     insmod gzio
         insmod part_gpt
         insmod ext2
         set root='hd0,gpt11'
         if [ x$feature_platform_search_hint = xy ]; then
           search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt11
--hint-efi=hd0,gpt11 --hint-baremetal=ahci0,gpt11  9c5834cd-72ff-49f5-8$
         else
           search --no-floppy --fs-uuid --set=root
9c5834cd-72ff-49f5-8ddb-f584a6881a7c
         fi
     echo    'Linux 4.12.5-gentoo wird geladen …'
         linux   /vmlinuz-4.12.5-gentoo root=/dev/sda8 ro
i915.enable_gvt=1 kvm.ignore_msrs=1 intel_iommu=igfx_off
init=/usr/lib/systemd/systemd
         initrd  /initramfs-genkernel-x86_64-4.12.5-gentoo
}


No mdev_supported_types and no kvmgt module in lsmod. What could be missing?

Thank you!
Regards
Richard


On 01.09.2017 18:58, Alex Williamson wrote:
> On Fri, 1 Sep 2017 18:45:40 +0200
> Richard Lagler <rilagler@gmail.com> wrote:
>
>> Hello,
>>
>> I struggle to setup the kvmgt correctly, the Github docu says there
>> should be a mdev_supported_types directory, what is missing for my
>> graphic card identifier path.
>>
>> lspci shows 00:02.0 VGA compatible controller: Intel Corporation HD
>> Graphics 520 (rev 07) for my card, but
>>
>> ls -la /sys/bus/pci/devices/0000\:02\:00.0/ doesn't show it. I looked
>> for it in other identifier subfolders too.
>>
>>
>> My notebook is a Lenovo Yoga 900 with an Intel® Core™ i7-6500U CPU @
>> 2.50GHz × 4 and the Intel® HD Graphics 520 (Skylake GT2) graphics card.
>>
>> I have compiled the appropriate kernel flags CONFIG_DRM_I915_GVT,
>> CONFIG_DRM_I915_GVT_KVMGT, CONFIG_DRM_I915_GVT_XENGT, CONFIG_VFIO_MDEV
>> and CONFIG_VFIO_MDEV_DEVICE in kernel 4.12.5 for Gentoo Linux and can
>> modprobe the kvmgt, but it doesn't autoload at boot.
> You need for i915 to be loaded with the enable_gvt option and kvmgt
> needs to be available at the point where i915 is intializing.  Loading
> it at any point later does nothing.  This generally means you need to
> force kvmgt.ko into your initramfs.  You can either use modprobe.d or
> kernel commandline (i915.enable_gvt=1) to add the module option.
> Thanks,
>
> Alex

_______________________________________________
iGVT-g mailing list
iGVT-g@lists.01.org
https://lists.01.org/mailman/listinfo/igvt-g