specific device not available in client (passthrough) with high cpu load on host, none in client

Bug #1071011 reported by Gerben on 2012-10-24
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
qemu-kvm (Ubuntu)

Bug Description

I've got a specific device which is not always handed down to the kvm client showing a high cpu load on the kvm host. No cpu load shown in the client (win7).

A few (two) times I saw this device working properly with no high cpu usage on the kvm host, but this was broken after a reboot of the KVM host in at least one time. Reboots of the client showed the device continue to work correctly multiple times before I rebooted the host.

06:00.1 Audio device [0403]: Advanced Micro Devices [AMD] nee ATI Cedar HDMI Audio [Radeon HD 5400/6300 Series] [1002:aa68]

If the device works correctly, a device is shown by the device manager within windows 7. If not no device is shown, while the host KVM process consumes all cpu cycles assigned to it (2 cpu's in this case) and the client shows not cpu power used.

My guess this is specific to this device (a sound device on the graphics card, HD5440). The graphics device and an USB device in passthough both work without problems.

When removing the sound device no high cpu usage is shown on the host.
Adding the sound device again, high cpu usage is shown on the host.

The host is a Quantal server installation.

# lsb_release -rd
Description: Ubuntu 12.10
Release: 12.10
# apt-cache policy qemu-kvm
  Installed: 1.2.0+noroms-0ubuntu2
  Candidate: 1.2.0+noroms-0ubuntu2
  Version table:
 *** 1.2.0+noroms-0ubuntu2 0
        500 http://nl.archive.ubuntu.com/ubuntu/ quantal/main amd64 Packages
        100 /var/lib/dpkg/status

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: qemu-kvm 1.2.0+noroms-0ubuntu2
ProcVersionSignature: Ubuntu 3.5.0-17.28-generic 3.5.5
Uname: Linux 3.5.0-17-generic x86_64
ApportVersion: 2.6.1-0ubuntu3
Architecture: amd64
Date: Wed Oct 24 21:59:10 2012
InstallationMedia: Ubuntu-Server 12.10 "Quantal Quetzal" - Release amd64 (20121017.2)
MachineType: To be filled by O.E.M. To be filled by O.E.M.
 PATH=(custom, no user)
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.5.0-17-generic root=UUID=58e57f77-7117-4eff-8162-47b465a72050 ro
SourcePackage: qemu-kvm
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 03/12/2012
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 1102
dmi.board.asset.tag: To be filled by O.E.M.
dmi.board.name: SABERTOOTH 990FX
dmi.board.vendor: ASUSTeK COMPUTER INC.
dmi.board.version: Rev 1.xx
dmi.chassis.asset.tag: To Be Filled By O.E.M.
dmi.chassis.type: 3
dmi.chassis.vendor: To Be Filled By O.E.M.
dmi.chassis.version: To Be Filled By O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr1102:bd03/12/2012:svnTobefilledbyO.E.M.:pnTobefilledbyO.E.M.:pvrTobefilledbyO.E.M.:rvnASUSTeKCOMPUTERINC.:rnSABERTOOTH990FX:rvrRev1.xx:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:
dmi.product.name: To be filled by O.E.M.
dmi.product.version: To be filled by O.E.M.
dmi.sys.vendor: To be filled by O.E.M.

Gerben (gerbgeus) wrote :
Serge Hallyn (serge-hallyn) wrote :

Thanks for reporting this bug. Would it be possible for you to test this with the upstream qemu?

Did this used to work consistently with older versions of qemu (say in precise)?

Is there any pattern - for instance a full shutdown followed by power-on of the host results in the sound card being usable in the guest, while a reboot results in the sound card not being usable in the guest?

Changed in qemu-kvm (Ubuntu):
importance: Undecided → Medium
status: New → Incomplete
importance: Medium → Low
Gerben (gerbgeus) wrote :

Hi Serge,

I cannot see any pattern on boot or reboot of the host. One cold boot (the first after not using the pci device for a long time) of the host resulted into the device working properly on the client, but then shutting down the client again reverted to problem described. I should have tried a restart of the client first to keep the same kvm process.

After that I've performed several poweroff's, including disconnecting from the mains for over a minute, but never seen the device working properly.

An upstream install of qemu is okay if you have the proper apt commands (and sources.list alterations if needed) available.


Serge Hallyn (serge-hallyn) wrote :

The way to check upstream qemu's git HEAD is:

    sudo apt-get build-dep qemu-kvm
    sudo apt-get install git
    git clone git://git.qemu.org/qemu.git
    cd qemu
    ./configure --target-list=x86_64-softmmu

then run it as

    cd x86_64-softmmu
    ./qemu-system-x86_64 --enable-kvm (existing-arguments)

or if you are using libvirt, you should be able to

    cd x86_64-softmmu
    sudo mv /usr/bin/kvm /usr/bin/kvm.orig
    sudo ln -s $(pwd)/qemu-system-x86_64 /usr/bin/kvm

then test, then

    sudo rm /usr/bin/kvm
    sudo mv /usr/bin/kvm.orig /usr/bin/kvm

Gerben (gerbgeus) wrote :

I'm getting a failure message when starting using virsh start (/usr/bin/kvm is altered to point to upstream as described)
# virsh start Win7one
error: Failed to start domain Win7one
error: internal error Child process (LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin /usr/bin/kvm -help) status unexpected: exit status 1

I had problems on the network tap device when startting via
./qemu-system-x86_64 --enable-kvm -name Win7one -S -M pc-0.12 -enable-kvm -m 2048 -smp 2...

# ./testqemuup
char device redirected to /dev/pts/3
qemu-system-x86_64: -netdev tap,fd=36,id=hostnet0,vhost=on,vhostfd=37: TUNGETIFF ioctl() failed: Bad file descriptor
TUNSETOFFLOAD ioctl() failed: Bad file descriptor
qemu-system-x86_64: -netdev tap,fd=36,id=hostnet0,vhost=on,vhostfd=37: vhost-net requested but could not be initialized
qemu-system-x86_64: -netdev tap,fd=36,id=hostnet0,vhost=on,vhostfd=37: Device 'tap' could not be initialized

Did remove the tap device definition and it's usage as a pci device. After that I got a core dump message, but probably coresize is set to zero.
See the attached file for details of qemu-system-x86_64

ldd on the file looks okay.

Gerben (gerbgeus) wrote :

Probably apparmor is blocking the executable.

in /var/log/apport.log I can see the line:
ERROR: apport (pid 4224) Fri Oct 26 22:29:35 2012: executable does not belong to a package, ignoring

When copying qemu-system-x86_64 into /usr/bin
and executing within that directory ( ./qemu-system-x86_64 --enable-kvm -nam...)
still a coredump message is shown,
apport.log ends in wrote report /var/crash/_usr_bin_qemu-system-x86_64.0.crash

Serge Hallyn (serge-hallyn) wrote :

I hadn't noticed this before:

[ 761.143056] ------------[ cut here ]------------
[ 761.143064] WARNING: at /build/buildd/linux-3.5.0/kernel/irq/manage.c:436 __enable_irq+0x3b/0xd0()
[ 761.143066] Hardware name: To be filled by O.E.M.
[ 761.143067] Unbalanced enable for IRQ 41
[ 761.143068] Modules linked in: pci_stub vhost_net macvtap macvlan ip6table_filter ip6_tables ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack ipt_REJECT xt_CHECKSUM iptable_mangle xt_tcpudp iptable_filter ip_tables x_tables bridge stp llc snd_hda_codec_hdmi eeepc_wmi asus_wmi sparse_keymap mxm_wmi kvm_amd kvm ghash_clmulni_intel aesni_intel cryptd aes_x86_64 sp5100_tco microcode snd_hda_codec_realtek edac_core psmouse edac_mce_amd fam15h_power serio_raw k10temp i2c_piix4 snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_timer snd radeon soundcore joydev snd_page_alloc ttm drm_kms_helper drm i2c_algo_bit mac_hid wmi lp parport hid_generic usbhid hid firewire_ohci firewire_core crc_itu_t r8169
[ 761.143103] Pid: 4015, comm: kvm Not tainted 3.5.0-17-generic #28-Ubuntu
[ 761.143104] Call Trace:
[ 761.143109] [<ffffffff81051c4f>] warn_slowpath_common+0x7f/0xc0
[ 761.143112] [<ffffffff81051d46>] warn_slowpath_fmt+0x46/0x50
[ 761.143115] [<ffffffff8103fa39>] ? default_spin_lock_flags+0x9/0x10
[ 761.143117] [<ffffffff810e050b>] __enable_irq+0x3b/0xd0
[ 761.143119] [<ffffffff810e05e2>] enable_irq+0x42/0x80
[ 761.143133] [<ffffffffa0324d3b>] kvm_vm_ioctl_assigned_device+0xa1b/0xb70 [kvm]
[ 761.143135] [<ffffffff81065f37>] ? __set_task_blocked+0x37/0x80
[ 761.143144] [<ffffffffa033298b>] ? x86_emulate_instruction+0x13b/0x570 [kvm]
[ 761.143147] [<ffffffff81068512>] ? __set_current_blocked+0x52/0x70
[ 761.143154] [<ffffffffa031ff6c>] kvm_vm_ioctl+0x4ec/0x520 [kvm]
[ 761.143160] [<ffffffffa031e568>] ? kvm_vcpu_ioctl+0x118/0x610 [kvm]
[ 761.143164] [<ffffffff8135b90a>] ? pci_read_config+0x24a/0x270
[ 761.143167] [<ffffffff811f436c>] ? read+0x7c/0x1f0
[ 761.143169] [<ffffffff81193909>] do_vfs_ioctl+0x99/0x590
[ 761.143172] [<ffffffff81193e99>] sys_ioctl+0x99/0xa0
[ 761.143175] [<ffffffff81689d29>] system_call_fastpath+0x16/0x1b
[ 761.143176] ---[ end trace 6bd5dd1c5df4018d ]---
[ 802.129162] br0: port 14(vnet12) entered disabled state

Will mark this as affecting the kernel.

Serge Hallyn (serge-hallyn) wrote :

Thanks, Gerben. If it were possible for you to run it by hand that would be easier. But to do it through libvirt without a package becomes more complicated. To undo your changes (in particular copying the qemu-system-x86_64 into /usr/bin), please do

sudo apt-get install --reinstall qemu-kvm

Changed in qemu-kvm (Ubuntu):
status: Incomplete → New
Brad Figg (brad-figg) on 2012-10-26
Changed in linux (Ubuntu):
status: New → Confirmed

Gerben, as per http://www.asus.com/Motherboards/SABERTOOTH_990FX/#support_Download_8 an update is available for your BIOS (1604). If you update to this, does it change anything?

If not, could you please both specify what happened, and provide the output of the following terminal command:
sudo dmidecode -s bios-version && sudo dmidecode -s bios-release-date

Thank you for your understanding.

tags: added: bios-outdated-1604 needs-upstream-testing regression-potential
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers