はわわーっ

はわわわわっ

VGAパススルーしたいその2

archlinux入れてそっちでやってみた。

kernel parameterにintel_iommu=onをつけないといけなかった。

# modprobe pci-stub
# echo 8086 0412 > /sys/bus/pci/drivers/pci-stub/new_id
# echo 0000:00:02.0 > /sys/bus/pci/drivers/i915/unbind
# echo 0000:00:02.0 > /sys/bus/pci/drivers/pci-stub/bind

dmesgみるとi915からunbindしたところで

[  801.347584] ------------[ cut here ]------------
[  801.347598] WARNING: CPU: 1 PID: 348 at drivers/gpu/drm/i915/i915_dma.c:1880 i915_driver_unload+0x301/0x310 [i915]()
[  801.347599] Modules linked in: pci_stub cfg80211 rfkill snd_hda_codec_hdmi nls_iso8859_1 nls_cp437 vfat fat snd_hda_codec_realtek snd_hda_codec_generic coretemp hwmon intel_rapl x86_pkg_temp_thermal intel_powerclamp kvm_intel mousedev kvm mxm_wmi crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper evdev cryptd mac_hid microcode psmouse i915 serio_raw pcspkr shpchp tpm_tis tpm battery wmi snd_hda_intel snd_hda_controller drm_kms_helper snd_hda_codec drm snd_hwdep i2c_hid snd_pcm e1000e snd_timer intel_gtt i2c_designware_platform snd i2c_algo_bit video dw_dmac i2c_designware_core gpio_lynxpoint dw_dmac_core mei_me i2c_core soundcore 8250_dw mei ptp pps_core acpi_pad spi_pxa2xx_platform processor button ext4 crc16 mbcache jbd2 sd_mod
[  801.347621]  crc_t10dif crct10dif_common hid_generic usbhid hid uas usb_storage atkbd libps2 ehci_pci ahci ehci_hcd libahci libata xhci_hcd scsi_mod usbcore usb_common i8042 serio sdhci_acpi sdhci led_class mmc_core
[  801.347629] CPU: 1 PID: 348 Comm: bash Not tainted 3.16.4-1-ARCH #1
[  801.347630] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./Z97 Extreme4, BIOS P1.30 05/23/2014
[  801.347631]  0000000000000000 0000000050587c7c ffff8800b91f7d30 ffffffff8152ba1c
[  801.347633]  0000000000000000 ffff8800b91f7d68 ffffffff8106e45d ffff880408b50000
[  801.347634]  ffff880407e1b800 ffff880407e1b860 ffff880408b886f0 fffffffffffffff2
[  801.347635] Call Trace:
[  801.347638]  [<ffffffff8152ba1c>] dump_stack+0x4d/0x6f
[  801.347641]  [<ffffffff8106e45d>] warn_slowpath_common+0x7d/0xa0
[  801.347643]  [<ffffffff8106e58a>] warn_slowpath_null+0x1a/0x20
[  801.347647]  [<ffffffffa04ba291>] i915_driver_unload+0x301/0x310 [i915]
[  801.347651]  [<ffffffffa0363de9>] drm_dev_unregister+0x29/0xb0 [drm]
[  801.347655]  [<ffffffffa03640b3>] drm_put_dev+0x23/0x70 [drm]
[  801.347658]  [<ffffffffa042d585>] i915_pci_remove+0x15/0x20 [i915]
[  801.347660]  [<ffffffff812dfd1b>] pci_device_remove+0x3b/0xc0
[  801.347662]  [<ffffffff813a561f>] __device_release_driver+0x7f/0xf0
[  801.347664]  [<ffffffff813a56b3>] device_release_driver+0x23/0x30
[  801.347666]  [<ffffffff813a43fd>] unbind_store+0xed/0x150
[  801.347668]  [<ffffffff813a3675>] drv_attr_store+0x25/0x40
[  801.347670]  [<ffffffff81238d1a>] sysfs_kf_write+0x3a/0x50
[  801.347671]  [<ffffffff8123828e>] kernfs_fop_write+0xee/0x180
[  801.347673]  [<ffffffff811c2277>] vfs_write+0xb7/0x200
[  801.347675]  [<ffffffff811c2ee9>] SyS_write+0x59/0xd0
[  801.347677]  [<ffffffff811dfd22>] ? __close_fd+0x82/0xa0
[  801.347679]  [<ffffffff815317a9>] system_call_fastpath+0x16/0x1b
[  801.347680] ---[ end trace d6c0d3d18ee9d81a ]---
[  801.347681] ------------[ cut here ]------------
[  801.347685] WARNING: CPU: 1 PID: 348 at drivers/gpu/drm/i915/i915_dma.c:1888 i915_driver_unload+0x2c1/0x310 [i915]()
[  801.347685] Modules linked in: pci_stub cfg80211 rfkill snd_hda_codec_hdmi nls_iso8859_1 nls_cp437 vfat fat snd_hda_codec_realtek snd_hda_codec_generic coretemp hwmon intel_rapl x86_pkg_temp_thermal intel_powerclamp kvm_intel mousedev kvm mxm_wmi crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper evdev cryptd mac_hid microcode psmouse i915 serio_raw pcspkr shpchp tpm_tis tpm battery wmi snd_hda_intel snd_hda_controller drm_kms_helper snd_hda_codec drm snd_hwdep i2c_hid snd_pcm e1000e snd_timer intel_gtt i2c_designware_platform snd i2c_algo_bit video dw_dmac i2c_designware_core gpio_lynxpoint dw_dmac_core mei_me i2c_core soundcore 8250_dw mei ptp pps_core acpi_pad spi_pxa2xx_platform processor button ext4 crc16 mbcache jbd2 sd_mod
[  801.347702]  crc_t10dif crct10dif_common hid_generic usbhid hid uas usb_storage atkbd libps2 ehci_pci ahci ehci_hcd libahci libata xhci_hcd scsi_mod usbcore usb_common i8042 serio sdhci_acpi sdhci led_class mmc_core
[  801.347708] CPU: 1 PID: 348 Comm: bash Tainted: G        W     3.16.4-1-ARCH #1
[  801.347709] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./Z97 Extreme4, BIOS P1.30 05/23/2014
[  801.347709]  0000000000000000 0000000050587c7c ffff8800b91f7d30 ffffffff8152ba1c
[  801.347710]  0000000000000000 ffff8800b91f7d68 ffffffff8106e45d ffff880408b50000
[  801.347712]  ffff880407e1b800 ffff880407e1b860 ffff880408b886f0 fffffffffffffff2
[  801.347713] Call Trace:
[  801.347714]  [<ffffffff8152ba1c>] dump_stack+0x4d/0x6f
[  801.347715]  [<ffffffff8106e45d>] warn_slowpath_common+0x7d/0xa0
[  801.347717]  [<ffffffff8106e58a>] warn_slowpath_null+0x1a/0x20
[  801.347720]  [<ffffffffa04ba251>] i915_driver_unload+0x2c1/0x310 [i915]
[  801.347724]  [<ffffffffa0363de9>] drm_dev_unregister+0x29/0xb0 [drm]
[  801.347726]  [<ffffffffa03640b3>] drm_put_dev+0x23/0x70 [drm]
[  801.347729]  [<ffffffffa042d585>] i915_pci_remove+0x15/0x20 [i915]
[  801.347731]  [<ffffffff812dfd1b>] pci_device_remove+0x3b/0xc0
[  801.347732]  [<ffffffff813a561f>] __device_release_driver+0x7f/0xf0
[  801.347733]  [<ffffffff813a56b3>] device_release_driver+0x23/0x30
[  801.347735]  [<ffffffff813a43fd>] unbind_store+0xed/0x150
[  801.347736]  [<ffffffff813a3675>] drv_attr_store+0x25/0x40
[  801.347738]  [<ffffffff81238d1a>] sysfs_kf_write+0x3a/0x50
[  801.347739]  [<ffffffff8123828e>] kernfs_fop_write+0xee/0x180
[  801.347741]  [<ffffffff811c2277>] vfs_write+0xb7/0x200
[  801.347742]  [<ffffffff811c2ee9>] SyS_write+0x59/0xd0
[  801.347744]  [<ffffffff811dfd22>] ? __close_fd+0x82/0xa0
[  801.347745]  [<ffffffff815317a9>] system_call_fastpath+0x16/0x1b
[  801.347746] ---[ end trace d6c0d3d18ee9d81b ]---

こんなトレース吐いてる。

で、一応pci-stubにbindはできてたからqemu起動してみたんだけどエラーがでてた。

# qemu-system-x86_64 -enable-kvm -vnc :0 -smp 1 -m 1024 -hda debian.img -device pci-assign,host=00:02.0
qemu-system-x86_64: -device pci-assign,host=00:02.0: Failed to assign device "(null)": Operation not permitted
qemu-system-x86_64: -device pci-assign,host=00:02.0: Device initialization failed.
qemu-system-x86_64: -device pci-assign,host=00:02.0: Device 'kvm-pci-assign' could not be initialized

dmesg見ると

[  906.956768] pci-stub 0000:00:02.0: Device is ineligible for IOMMU domain attach due to platform RMRR requirement.  Contact your platform vendor.
[  906.956772] pci-stub 0000:00:02.0: kvm assign device failed ret -1

こんなのがでてた。

メッセージ的には

あたりかな。

RMRRがなんなのかよくわかってないけど、雰囲気的にデバイスがパススルーに対応してないって感じなんだろうか。