← Back to team overview

kernel-packages team mailing list archive

[Bug 1021271] Re: KVM "enabling virtualization on CPU0 failed"

 

Thanks for the help but alas it does not work this time either.

I have installed and tried both linux-generic-lts-quantal and linux-
generic-lts-raring:

$ sudo wajig install linux-generic-lts-*

Result with quantal:

hong@vhost01:~$ uname -a
Linux vhost01 3.5.0-42-generic #65~precise1-Ubuntu SMP Wed Oct 2 20:57:18 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
hong@vhost01:~$ sudo kvm
failed to initialize KVM: Device or resource busy
Back to tcg accelerator.
Could not initialize SDL(No available video device) - exiting
hong@vhost01:~$ dmesg | grep kvm | tail
[   14.381796] kvm: enabling virtualization on CPU2 failed
[   14.381805] kvm: enabling virtualization on CPU0 failed
[   14.438460] kvm: enabling virtualization on CPU0 failed
[   14.438462] kvm: enabling virtualization on CPU1 failed
[   14.438466] kvm: enabling virtualization on CPU2 failed
[   14.438474] kvm: enabling virtualization on CPU3 failed
[   33.561382] kvm: enabling virtualization on CPU0 failed
[   33.561385] kvm: enabling virtualization on CPU1 failed
[   33.561387] kvm: enabling virtualization on CPU3 failed
[   33.561396] kvm: enabling virtualization on CPU2 failed

Then I boot into each one. Result with raring:

hong@vhost01:~$ uname -a
Linux vhost01 3.8.0-32-generic #47~precise1-Ubuntu SMP Wed Oct 2 16:19:35 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
hong@vhost01:~$ sudo kvm
failed to initialize KVM: Device or resource busy
Back to tcg accelerator.
Could not initialize SDL(No available video device) - exiting
hong@vhost01:~$ dmesg | grep kvm | tail 
[   14.255276] kvm: enabling virtualization on CPU2 failed
[   14.255284] kvm: enabling virtualization on CPU0 failed
[   64.876582] kvm: enabling virtualization on CPU0 failed
[   64.876584] kvm: enabling virtualization on CPU3 failed
[   64.876587] kvm: enabling virtualization on CPU2 failed
[   64.876595] kvm: enabling virtualization on CPU1 failed
[  290.615655] kvm: enabling virtualization on CPU0 failed
[  290.615660] kvm: enabling virtualization on CPU1 failed
[  290.615666] kvm: enabling virtualization on CPU3 failed
[  290.615685] kvm: enabling virtualization on CPU2 failed

While with precies the error is only seen with CPU0, with the new
kernels it is repeated on all CPU's.

With further Googling I stumled upon a post:

https://bbs.archlinux.org/viewtopic.php?id=148163

which suggests a BIOS upgrade might work. But since kvm worked perfectly
under 10.04LTS, it should be software related and a BIOS upgrade would
be a last resort as a workaround rather than a solution.

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1021271

Title:
  KVM "enabling virtualization on CPU0 failed"

Status in “linux” package in Ubuntu:
  Confirmed
Status in “qemu-kvm” package in Ubuntu:
  Invalid

Bug description:
  
  Background:
  Ubuntu 12.04 server, running amd64 version, AMD Athlon 64 X2 5000+ CPU.  KVM worked fine on the same physical hardware when previously Debian Lenny.

  $ lsb_release -rd
  Description:    Ubuntu 12.04 LTS
  Release:        12.04
  $

  $ apt-cache policy kvm
  kvm:
    Installed: 1:84+dfsg-0ubuntu16+1.0+noroms+0ubuntu13
    Candidate: 1:84+dfsg-0ubuntu16+1.0+noroms+0ubuntu13
    Version table:
   *** 1:84+dfsg-0ubuntu16+1.0+noroms+0ubuntu13 0
          500 http://gb.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
          100 /var/lib/dpkg/status
  $

  
  Expected result:

  KVM should start and work without error, using hardware acceleration
  of CPU.

  
  Issue:

  When starting a VM, I get the following message:

  $ kvm -cdrom BT5R2-KDE-32.iso -m 256 -net nic -net user -vnc 127.0.0.1:2
  failed to initialize KVM: Device or resource busy
  Back to tcg accelerator.

  And I them get the following line appear in the dmesg output:

  kvm: enabling virtualization on CPU0 failed

  
  The virtual host will still run, but with very poor performance, because it is not able to use hardware acceleration capabilities of host CPU.

  
  My account is in the KVM group (but I get the same symptoms even running as root):

  Code:
  $ ls -l /dev/kvm
  crw-rw---- 1 root kvm 10, 232 Jun 30 07:42 /dev/kvm
  $ whoami
  jason
  $ grep kvm /etc/group
  kvm:x:105:jason
  $

  
  The KVM kernel modules are loaded:

  $ lsmod | grep kvm
  kvm_amd                55848  0
  kvm                   415459  1 kvm_amd
  $

  
  Here is some background info on the host to hopefully help:

  Code:
  $ uname -a
  Linux cube 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
  $ lscpu
  Architecture:          x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Byte Order:            Little Endian
  CPU(s):                2
  On-line CPU(s) list:   0,1
  Thread(s) per core:    1
  Core(s) per socket:    2
  Socket(s):             1
  NUMA node(s):          1
  Vendor ID:             AuthenticAMD
  CPU family:            16
  Model:                 4
  Stepping:              2
  CPU MHz:               800.000
  BogoMIPS:              4431.12
  Virtualisation:        AMD-V
  L1d cache:             64K
  L1i cache:             64K
  L2 cache:              512K
  NUMA node0 CPU(s):     0,1
  $ cat /proc/cpuinfo
  processor       : 0
  vendor_id       : AuthenticAMD
  cpu family      : 16
  model           : 4
  model name      : AMD Athlon(tm) 5000 Dual-Core Processor
  stepping        : 2
  microcode       : 0x1000086
  cpu MHz         : 800.000
  cache size      : 512 KB
  physical id     : 0
  siblings        : 2
  core id         : 0
  cpu cores       : 2
  apicid          : 0
  initial apicid  : 0
  fpu             : yes
  fpu_exception   : yes
  cpuid level     : 5
  wp              : yes
  flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt npt lbrv svm_lock nrip_save
  bogomips        : 4431.17
  TLB size        : 1024 4K pages
  clflush size    : 64
  cache_alignment : 64
  address sizes   : 48 bits physical, 48 bits virtual
  power management: ts ttp tm stc 100mhzsteps hwpstate

  processor       : 1
  vendor_id       : AuthenticAMD
  cpu family      : 16
  model           : 4
  model name      : AMD Athlon(tm) 5000 Dual-Core Processor
  stepping        : 2
  microcode       : 0x1000086
  cpu MHz         : 800.000
  cache size      : 512 KB
  physical id     : 0
  siblings        : 2
  core id         : 1
  cpu cores       : 2
  apicid          : 1
  initial apicid  : 1
  fpu             : yes
  fpu_exception   : yes
  cpuid level     : 5
  wp              : yes
  flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt npt lbrv svm_lock nrip_save
  bogomips        : 4431.12
  TLB size        : 1024 4K pages
  clflush size    : 64
  cache_alignment : 64
  address sizes   : 48 bits physical, 48 bits virtual
  power management: ts ttp tm stc 100mhzsteps hwpstate

  $

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1021271/+subscriptions