Bug #2626

qemu-kvm KVM internal error. Suberror: 1 emulation failure

Added by Matt Connolly over 5 years ago. Updated almost 5 years ago.

Status:ResolvedStart date:2012-04-16
Priority:HighDue date:
Assignee:Jon Tibble% Done:

0%

Category:OI-Userland
Target version:oi_151_stable
Difficulty:Medium Tags:kvm

Description

In oi151a3, qemu-kvm is getting stuck running virtual machines (windows xp, 7 or linux) with the following output stream:

KVM internal error. Suberror: 1
emulation failure
KVM internal error. Suberror: 1
emulation failure
KVM internal error. Suberror: 1
emulation failure
KVM internal error. Suberror: 1
emulation failure
KVM internal error. Suberror: 1
emulation failure

It happens 98% of the time. Every now and then I can get a machine to boot, but not at all consistently.

I'm using a Xeon E3-1230, running OpenIndiana oi-151a3. This problem never occurred in oi-151a2.

I've changed around configuration options quite a bit on virtual machines (qemu startup parameters) and nothing has made a difference.

I notice also, that even booting a machine configured with only a Linux CD-ROM (like GParted), no hard disks and no network interface will still fail at boot most of the time before even getting to a grub menu. An example of a failed linux installation screenshot is attached.

Windows guests pass their initial boot menu, and then hang right quickly after that.

Screen_Shot_2012-04-16_at_10.48.05_AM.png - this happens after resetting the guest (28.6 KB) Matt Connolly, 2012-04-16 02:15 AM

Screen_Shot_2012-04-16_at_10.36.44_AM.png - this one happens a lot from a cold start of the guest (27.5 KB) Matt Connolly, 2012-04-16 02:15 AM

kvm-log.txt Magnifier (2.61 MB) Jonathan Adams, 2012-05-23 03:56 PM

kvm-prtconf.txt Magnifier (246 KB) Jonathan Adams, 2012-05-23 04:38 PM

kvm-scanpci.txt Magnifier (7.84 KB) Jonathan Adams, 2012-05-23 04:38 PM

History

#1 Updated by Matt Connolly over 5 years ago

Title should be "qemu-kvm KVM internal error. Suberror: 1 emulation failure"... seems I don't have permissions to change it. Sorry.

#2 Updated by Rich Lowe over 5 years ago

  • Project changed from illumos gate to OpenIndiana Distribution

#3 Updated by Rich Lowe over 5 years ago

  • Subject changed from qemu-kvm to qemu-kvm KVM internal error. Suberror: 1 emulation failure
  • Category set to 35

#4 Updated by Rich Lowe over 5 years ago

I have no idea what got changed here between a2 and a3, either regarding illumos, regarding KVM, or regarding qemu.

I've punted it to OI, in the assumption that they do know, and can maybe narrow it down.

The only thing I do know of is that recent kvm/qemu require recent illumos for a couple of reasons, but I'd have expected a3 to make that better rather than worse, so I'm puzzled.

#5 Updated by Matt Connolly over 5 years ago

Doing this:

# pkg uninstall driver/i86pc/kvm system/qemu system/qemu/kvm
# pkg install system/qemu@0.15.0,5.11-0.151.1.2:20120209T223057Z \
system/qemu/kvm@0.0.1.20110813,5.11-0.151.1.2:20120209T223223Z \
driver/i86pc/kvm@0.0.1.20110820,5.11-0.151.1.2:20120209T214555Z

returns all guest VMs to a working state with the rest of the system installed with packages as per oi151a3.

#6 Updated by Ryo Murakawa over 5 years ago

  • Assignee set to Ryo Murakawa
  • Tags changed from needs-triage to kvm

I'll check.

#7 Updated by Helmut Hartl over 5 years ago

I have the same problem on OpenIndiana oi-151a3, when trying Openindiana oi-151 Install ISO as a guest. The guest hangs, i never managed to boot the installation iso up.
The console output mentions the same error:
"qemu-kvm KVM internal error. Suberror: 1 emulation failure" repeating

The in note 5 mentioned workaround works.

#8 Updated by Ryo Murakawa over 5 years ago

  • Assignee changed from Ryo Murakawa to OI Caiman

#9 Updated by Alasdair Lumsden over 5 years ago

  • Assignee changed from OI Caiman to Jon Tibble
  • Priority changed from Normal to High
  • Target version set to oi_151_stable
  • Status changed from New to In Progress

#10 Updated by Tim Stewart over 5 years ago

I'm also experiencing this behavior on oi_151a4.

#11 Updated by Piotr Jasiukajtis over 5 years ago

Tim Stewart wrote:

I'm also experiencing this behavior on oi_151a4.

Could you provide more details like your qemu parameters?
It's working for me on oi_151a4.

# uname -v
oi_151a4

# pkg list | egrep 'kvm|qemu'
driver/i86pc/kvm                                  0.0.1.20120222-0.151.1.4   i--
system/qemu                                       0.15.0-0.151.1.4           i--
system/qemu/kvm                                   0.0.1.20120229-0.151.1.4   i--

# pkg verify -v driver/i86pc/kvm system/qemu system/qemu/kvm
PACKAGE                                                                 STATUS 
pkg://openindiana.org/driver/i86pc/kvm                                      OK
pkg://openindiana.org/system/qemu                                           OK 
pkg://openindiana.org/system/qemu/kvm                                       OK 

And my qemu-kvm parameters look like this:

qemu-kvm -enable-kvm -nographic -smp 1 -m 512 -vnc 0.0.0.0:${INST} -no-hpet \
    -net nic,vlan=0,name=net0,macaddr=${MAC},model=virtio \
    -net vnic,vlan=0,name=${VM},ifname=${VNIC},macaddr=${MAC} \
    -drive file=/dev/zvol/rdsk/data/${VM},index=0,media=disk,if=virtio \
     -daemonize

#12 Updated by Jonathan Adams over 5 years ago

MAC=$(dladm show-vnic -po macaddress kvmvnic0)
/usr/bin/qemu-kvm \
-boot order=c,menu=off \
-enable-kvm \
-vnc 0.0.0.0:1 \
-smp 4 \
-m 4096 \
-no-hpet \
-localtime \
-drive file=/dev/zvol/rdsk/rpool1/kvm/win2k8/disk0,if=ide,index=0 \
-net nic,vlan=0,name=net0,model=e1000,macaddr=$MAC \
-net vnic,vlan=0,name=net0,ifname=kvmvnic0,macaddr=$MAC \
-vga std \
-usb -usbdevice tablet

root@salmon190-90:~# more /etc/release
OpenIndiana Development oi_151.1.2 X86 (powered by illumos)
Copyright 2011 Oracle and/or its affiliates. All rights reserved.
Use is subject to license terms.
Assembled 09 February 2012

I am going to upgrade to u4 in a short while and see if it is fixed
(need to shutdown windows, which wants to patch itself, and reboot
into u3 before upgrade)

Jon

#13 Updated by Jonathan Adams over 5 years ago

no, updated to u4 and still have the same error, at the same point, as soon as Windows tries to go graphical.

rebooted back to u2 and everything is running fine.

#14 Updated by Jonathan Adams over 5 years ago

root@salmon190-90:~# psrinfo -v
Status of virtual processor 0 as of: 05/23/2012 17:19:59
on-line since 05/23/2012 16:55:50.
The i386 processor operates at 2400 MHz,
and has an i387 compatible floating point processor.
Status of virtual processor 1 as of: 05/23/2012 17:19:59
on-line since 05/23/2012 16:55:53.
The i386 processor operates at 2400 MHz,
and has an i387 compatible floating point processor.
Status of virtual processor 2 as of: 05/23/2012 17:19:59
on-line since 05/23/2012 16:55:53.
The i386 processor operates at 2400 MHz,
and has an i387 compatible floating point processor.
Status of virtual processor 3 as of: 05/23/2012 17:19:59
on-line since 05/23/2012 16:55:53.
The i386 processor operates at 2400 MHz,
and has an i387 compatible floating point processor.
root@salmon190-90:~# isainfo -v
64-bit amd64 applications
vmx sse4.2 sse4.1 ssse3 popcnt tscp cx16 sse3 sse2 sse fxsr mmx cmov
amd_sysc cx8 tsc fpu
32-bit i386 applications
vmx sse4.2 sse4.1 ssse3 popcnt tscp ahf cx16 sse3 sse2 sse fxsr mmx
cmov sep cx8 tsc fpu
root@salmon190-90:~# more /etc/release
OpenIndiana Development oi_151.1.2 X86 (powered by illumos)
Copyright 2011 Oracle and/or its affiliates. All rights reserved.
Use is subject to license terms.
Assembled 09 February 2012

"prtconf -PvD" and "scanpci" output attached.

#15 Updated by Matt Connolly over 5 years ago

I'm still seeing exactly the same garbage boot as in the second screenshot above in oi_151a5.

#16 Updated by Piotr Jasiukajtis over 5 years ago

Matt Connolly wrote:

I'm still seeing exactly the same garbage boot as in the second screenshot above in oi_151a5.

Screen_Shot_2012-04-16_at_10.36.44_AM.png

I saw it with the latest Ubuntu iso image, however I'm not sure if this is an OpenIndiana regression or Qemu.

#17 Updated by Jonathan Adams over 5 years ago

I just thought ... the version of kvm I'm using seems to have a maximum amount of memory of 4Gb ... I have 8Gb in memory and 4 cores ...

If I try to run with any more, or any other kvm sessions I get:
"Failed to allocate memory: Resource temporarily unavailable"

I can run more kvm sessions if I remove -enable-kvm.

do you think this might be related?

#18 Updated by Jonathan Adams over 5 years ago

No, in the newer version I can still only access 4Gb of memory, but it fails to boot Windows Server even with reduced memory. (Ubuntu server is fine)

#19 Updated by Jonathan Adams over 5 years ago

"Failed to allocate memory: Resource temporarily unavailable" is a swap related issue ... I hadn't realised that KVM allocates the same amount of swap as physical memory automatically and only had 4Gb swap mapped.

"qemu_ram_alloc: Could not lock 2147483648 memory, errno = 11" is the message you get when there is not enough physical ram available.

having sorted this, it still doesn't fix the latest version.

#20 Updated by Jonathan Adams about 5 years ago

kvm is running windows server on a6:

root@salmon190-90:~# pkg list | egrep i "kvm|qemu"
driver/i86pc/kvm 0.0.1.20120809-0.151.1.6 i-

system/qemu/kvm 0.0.1.20120807-0.151.1.6 i--

I did an update after a disk (full) failure, and forgot to check on the version numbering until just now.

#21 Updated by Jon Tibble almost 5 years ago

  • Status changed from In Progress to Resolved

Also available in: Atom