KVM with PCI forwarding really slow after 4.1
Hi,
I use "-device pci-assign,host=00:1a.0" to forward a USB host chip to a Win7 32 bit inside of qemu/kvm. That used to work pretty well, but it broke horribly somewhere after 4.1. With recent kernels the virtual machine boots, but is _very_ slow. It takes hours to boot.
If PCI forwarding is disabled, everything is fine.
qemu throws this warning on startup:
qemu-system-i386: -device pci-assign,host=00:1a.0: PCI region 0 at address 0xf253a000 has size 0x400, which is not a multiple of 4K. You might experience some performance hit due to that.
_But_ it also shows that warning for 4.1 and earlier kernels that work pretty fast.
I tried to bisect the problem, but I ran into some some kernels that don't even boot on my machine (the skipped ones). So it's a bit hard to make progress.
Here is my git bisect log that narrows it down to under 100 commits. Does anyone have a clue what could cause this?
(The log can be replayed with git bisect replay on Linus' tree).
# bad: [8005c49d9aea74d382f474ce11afbbc7d7130bec] Linux 4.4-rc1
# good: [b953c0d234bc72e8489d3bf51a276c5c4ec85345] Linux 4.1
git bisect start 'v4.4-rc1' 'v4.1'
# bad: [dd5cdb48edfd34401799056a9acf61078d773f90] Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
git bisect bad dd5cdb48edfd34401799056a9acf61078d773f90
# bad: [23908db413eccd77084b09c9b0a4451dfb0524c0] Merge tag 'staging-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
git bisect bad 23908db413eccd77084b09c9b0a4451dfb0524c0
# bad: [14738e03312ff1137109d68bcbf103c738af0f4a] Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
git bisect bad 14738e03312ff1137109d68bcbf103c738af0f4a
# good: [5a602e157a9d91d5ce98d07c404097edba8ec9f3] Merge tag 'spi-v4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
git bisect good 5a602e157a9d91d5ce98d07c404097edba8ec9f3
# good: [a4244b0cf58d56c171874e85228ba5deffeb017a] net/ethtool: Add current supported tunable options
git bisect good a4244b0cf58d56c171874e85228ba5deffeb017a
# bad: [98ec21a01896751b673b6c731ca8881daa8b2c6d] Merge branch 'sched-hrtimers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
git bisect bad 98ec21a01896751b673b6c731ca8881daa8b2c6d
# good: [4b1f2af6752a4cc9acc1c22ddf3842478965f113] Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
git bisect good 4b1f2af6752a4cc9acc1c22ddf3842478965f113
# good: [08d183e3c1f650b4db1d07d764502116861542fa] Merge tag 'powerpc-4.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux
git bisect good 08d183e3c1f650b4db1d07d764502116861542fa
# skip: [05fe125fa3237de2ec5bada80031e694de78909c] Merge tag 'kvm-arm-for-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD git bisect skip 05fe125fa3237de2ec5bada80031e694de78909c
# skip: [edc90b7dc4ceef62ef0ad9cc6c3f5dc770e83ad2] KVM: MMU: fix SMAP virtualization
git bisect skip edc90b7dc4ceef62ef0ad9cc6c3f5dc770e83ad2
# skip: [910a6aae4e2e45855efc4a268e43eed2d8445575] KVM: MTRR: exactly define the size of variable MTRRs
git bisect skip 910a6aae4e2e45855efc4a268e43eed2d8445575
# skip: [822bf4833ecc8ea63c69f3ed894c13b4509c9e85] arm64: defconfig: enable memtest
git bisect skip 822bf4833ecc8ea63c69f3ed894c13b4509c9e85
Signature · 1 line
Michael
Paolo Bonzini
maintainerQuoted 7 lines · Michael Büsch
Hi,
I use "-device pci-assign,host=00:1a.0" to forward a USB host chip to a Win7 32 bit inside of qemu/kvm. That used to work pretty well, but it broke horribly somewhere after 4.1. With recent kernels the virtual machine boots, but is _very_ slow. It takes hours to boot. If PCI forwarding is disabled, everything is fine.
This has been reported already, I'm going to look at it this week.
Paolo
Quoted 8 lines · On Tue, 1 Dec 2015 18:47:51 +0100 Paolo Bonzini <[email protected]> wrote:
Quoted 5 lines · Michael Büsch
I use "-device pci-assign,host=00:1a.0" to forward a USB host chip to a Win7 32 bit inside of qemu/kvm. That used to work pretty well, but it broke horribly somewhere after 4.1. With recent kernels the virtual machine boots, but is _very_ slow. It takes hours to boot. If PCI forwarding is disabled, everything is fine.
This has been reported already, I'm going to look at it this week.
Are there any news regarding this issue?
Signature · 1 line
Michael
Paolo Bonzini
maintainerQuoted 8 lines · Michael Büsch
Quoted 8 lines
Quoted 8 lines · Michael Büsch
Quoted 6 lines
Quoted 6 lines
I use "-device pci-assign,host=00:1a.0" to forward a USB host chip to a Win7 32 bit inside of qemu/kvm. That used to work pretty well, but it broke horribly somewhere after 4.1. With recent kernels the virtual machine boots, but is _very_ slow. It takes hours to boot. If PCI forwarding is disabled, everything is fine.
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
This has been reported already, I'm going to look at it this week.
Are there any news regarding this issue?
It's being discussed in Bugzilla
(https://bugzilla.kernel.org/show_bug.cgi?id=107561).
Paolo