From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pekka Enberg Subject: Re: Problem with KVM guest switching to x86 long mode Date: Thu, 08 Apr 2010 21:59:07 +0300 Message-ID: <4BBE277B.1090908@cs.helsinki.fi> References: <4BBE2213.6020802@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: KVM General To: Avi Kivity Return-path: Received: from courier.cs.helsinki.fi ([128.214.9.1]:40789 "EHLO mail.cs.helsinki.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933036Ab0DHS7O (ORCPT ); Thu, 8 Apr 2010 14:59:14 -0400 In-Reply-To: <4BBE2213.6020802@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: > These all look reasonable. Please add a gdtr dump and an idtr dump. Done. >> 2b:* cb lret<-- trapping instruction >> > > Post the two u32s at ss:rsp -> ss:rsp+8. That will tell us where the > guest is trying to return. Actually, from the dump: > > 1a: 6a 10 pushq $0x10 > 1c: 8d 85 00 02 00 00 lea 0x200(%rbp),%eax > 22: 50 push %rax > > it looks like you're returning to segment 0x10, this should be the word > at ss:rsp+4. So if you dump the 2 u32s at > gdtr.base+0x10..gdtr.base+0x18 we'll see if there's anything wrong with > the segment descriptor. Here you go: penberg@tiger:~/vm$ ./kvm bzImage KVM exit reason: 8 ("KVM_EXIT_SHUTDOWN") Registers: rip: 00000000001000ed rsp: 00000000005d54b8 flags: 0000000000010046 rax: 0000000080000001 rbx: 0000000001f2c000 rcx: 00000000c0000080 rdx: 0000000000000000 rsi: 0000000000013670 rdi: 0000000002408000 rbp: 0000000000100000 r8: 0000000000000000 r9: 0000000000000000 r10: 0000000000000000 r11: 0000000000000000 r12: 0000000000000000 r13: 0000000000000000 r14: 0000000000000000 r15: 0000000000000000 cr0: 0000000080000011 cr2: 00000000001000ed cr3: 0000000002402000 cr4: 0000000000000020 cr8: 0000000000000000 Segment registers: register selector base limit type p dpl db s l g avl cs 0010 0000000000000000 ffffffff 0b 1 0 1 1 0 1 0 ss 0018 0000000000000000 ffffffff 03 1 0 1 1 0 1 0 ds 0018 0000000000000000 ffffffff 03 1 0 1 1 0 1 0 es 0018 0000000000000000 ffffffff 03 1 0 1 1 0 1 0 fs 0018 0000000000000000 ffffffff 03 1 0 1 1 0 1 0 gs 0018 0000000000000000 ffffffff 03 1 0 1 1 0 1 0 tr 0020 0000000000001000 00000067 0b 1 0 0 0 0 0 0 ldt 0000 0000000000000000 ffffffff 00 0 0 0 0 0 0 0 gdt 00000000005ca458 00000030 idt 0000000000000000 00000000 [ efer: 0000000000000500 apic base: 0000000000000000 nmi: disabled ] Interrupt bitmap: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 Code: 08 49 75 f3 8d 83 00 60 4d 00 0f 22 d8 b9 80 00 00 c0 0f 32 0f ba e8 08 0f 30 6a 10 8d 85 00 02 00 00 50 b8 01 00 00 80 0f 22 c0 f4 eb fd 9c 6a 00 9d 9c 58 89 c3 35 00 00 20 00 50 9d 9c 58 Stack: 0x005d54b8: 00 02 10 00 10 00 00 00 <-- return value 0x005d54c0: 00 00 00 00 00 00 00 00 0x005d54c8: 00 00 00 00 00 00 00 00 0x005d54d0: 00 00 00 00 00 00 00 00 GDT: 0x005ca458: 30 00 58 a4 5c 00 00 00 0x005ca460: 00 00 00 00 00 00 00 00 0x005ca468: ff ff 00 00 00 9a af 00 <-- gtr.base + 0x10 0x005ca470: ff ff 00 00 00 92 cf 00 0x005ca478: 00 00 00 00 00 89 80 00 0x005ca480: 00 00 00 00 00 00 00 00 Pekka