#805107 qemu-kvm: internal error (emulation error)

Package:
qemu-system-x86
Source:
qemu
Description:
QEMU full system emulation binaries (x86)
Submitter:
Dmitry Bogatov
Date:
2015-11-17 20:03:03 UTC
Severity:
minor
#805107#5
Date:
2015-11-14 19:28:23 UTC
From:
To:
Dear Maintainer,

I installed Gentoo GNU/Linux with `lilo` bootloaded and kernel, built via
`genkernel` on virtual machine and on attempt to boot I get qemu
internal error, as attached. Script to run qemu is also attached.

Problem is 100% reproducible -- every time I try to boot virtual
machine, I get this error. Unfortunately, virtual machine is
5G size, but, if needed I can serve it via ssh or http.

#805107#10
Date:
2015-11-16 10:26:04 UTC
From:
To:
14.11.2015 22:28, Dmitry Bogatov wrote:

This is a bug in guest.  hers's the disassembly of the code in question:

00000000 <.data>:
   0:	85 ed                	test   %ebp,%ebp
   2:	be 4a 2d a8 f2       	mov    $0xf2a82d4a,%esi
   7:	92                   	xchg   %eax,%edx
   8:	d9 bb 21 7e 85 aa    	fnstcw -0x557a81df(%ebx)
   e:	53                   	push   %ebx
   f:	6b 60 01 6d          	imul   $0x6d,0x1(%eax),%esp
  13:	4d                   	dec    %ebp
  14:	da 9d 39 b2 0e 7e    	ficompl 0x7e0eb239(%ebp)   <=== here
  1a:	52                   	push   %edx
  1b:	3d 0f d0 29 d5       	cmp    $0xd529d00f,%eax
  20:	e6 0c                	out    %al,$0xc
  22:	be f9 76 31 43       	mov    $0x433176f9,%esi
  27:	4f                   	dec    %edi
  28:	86 c2                	xchg   %al,%dl
  2a:	4e                   	dec    %esi
  2b:	be ba c5 34 52       	mov    $0x5234c5ba,%esi
  30:	9b                   	fwait
  31:	c4                   	.byte 0xc4

It is a floating-point/integer comparison instruction.
The instruction sequence smells like your guest code
jumped to some random junk.

How far in the boot process it happens?  Is it in lilo or
in the kernel?  How much memory did you assign to the
guest?

Thanks,

/mjt

#805107#21
Date:
2015-11-17 05:40:19 UTC
From:
To:
* Michael Tokarev <mjt@tls.msk.ru> [2015-11-16 13:26:04+0300]

In kernel. Happens after kernel unpacking. 512mb.

If it is bug in guest, I propose to reword "internal error".

#805107#26
Date:
2015-11-17 06:22:38 UTC
From:
To:
17.11.2015 08:40, Dmitry Bogatov wrote:

Please share this kernel image with me, I'll try to take a (brief)
look.

For many years these errors were because of one or another emulation
problem. With time, most of these emulation problems has been fixed,
and these days, it is much more often a guest bug.  However, the
message is correct, qemu really can't emulate a guest instruction.
Bare metal hw usually will be hard-locked in this case.

Thanks,

/mjt

#805107#31
Date:
2015-11-17 07:03:31 UTC
From:
To:
17.11.2015 09:22, Michael Tokarev wrote:

BTW, can you reproduce this problem by using something like this:

 qemu-system-x86_64 -enable-kvm -m 512 -kernel <your-gentoo-kernel-image>

?  That's the way I'd try it if you give me this kernel image.  If
you can't reproduce the prob this way, ofcourse there's something
else missing :)

Thanks,

/mjt

#805107#36
Date:
2015-11-17 19:56:43 UTC
From:
To:
Sorry, I lost it (rm glob). Sorry for a noise.

"Internal error" suggests that there is bug in kvm. If I knew that
bug is in guest, I would not report bug.