From: Guillaume T. <gui...@ex...> - 2008-01-10 10:17:26
|
Hello, When a vmentry failure occurs, where is it caught? I see that VMX_EXIT_REASONS_FAILED_VMENTRY is defined but I don't see where it is used. Shouldn't there be something in handle_excetion() like: static int handle_exception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) { struct vcpu_vmx *vmx = to_vmx(vcpu); u32 intr_info, error_code, exit_reason; unsigned long cr2, rip; u32 vect_info; enum emulation_result er; vect_info = vmx->idt_vectoring_info; intr_info = vmcs_read32(VM_EXIT_INTR_INFO); exit_reason = vmcs_readl(VM_EXIT_REASON); if (unlikely(exit_reason & VMX_EXIT_REASONS_FAILED_VMENTRY)) /* check why and do something */ ... } I tried but it didn't catch any vmentry failures (and I know that there is at least one during the test). The idea is to find failure due to invalid guest state (like with old gfxboot bug) and emulate the code until the guest recovers a valid state. Regards, Guillaume |
From: Guillaume T. <gui...@ex...> - 2008-01-10 14:23:11
|
On Thu, 10 Jan 2008 11:19:58 +0100 Guillaume Thouvenin <gui...@ex...> wrote: > I tried but it didn't catch any vmentry failures (and I know that > there is at least one during the test). I think that there is a vmentry failure because qemu-system-x86_64 crashes with following error: "exception 13 (33)" I interpreted this as a vmentry failure because 33 is the exit reason for a vmentry failure. The problem is that I don't find how to catch it in kvm. I thought that something like: static int kvm_handle_exit(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu) { u32 exit_reason = vmcs_read32(VM_EXIT_REASON); struct vcpu_vmx *vmx = to_vmx(vcpu); u32 vectoring_info = vmx->idt_vectoring_info; if ( unlikely(exit_reason & VMX_EXIT_REASONS_FAILED_VMENTRY) ) // I should get it here no? ... } but exit_reason is never equal to VMX_EXIT_REASONS_FAILED_VMENTRY. Does it mean that what I interpret as a vmentry failure due to invalid guest state is in fact due to something else. Any hints to catch the vmentry failure due to invalid guest state in kvm? Thanks, Guillaume |
From: Avi K. <av...@qu...> - 2008-01-10 15:32:54
|
Guillaume Thouvenin wrote: > On Thu, 10 Jan 2008 11:19:58 +0100 > Guillaume Thouvenin <gui...@ex...> wrote: > > >> I tried but it didn't catch any vmentry failures (and I know that >> there is at least one during the test). >> > > I think that there is a vmentry failure because qemu-system-x86_64 > crashes with following error: > "exception 13 (33)" > > I interpreted this as a vmentry failure because 33 is the exit reason > for a vmentry failure. The problem is that I don't find how to catch it > in kvm. I thought that something like: > I think 33 is the error code, which means we got a general protection fault while accessing segment 0x33. What guest code is running when this happens? The dump sometimes includes the current code. -- error compiling committee.c: too many arguments to function |
From: Guillaume T. <gui...@ex...> - 2008-01-11 07:43:13
|
On Thu, 10 Jan 2008 17:32:35 +0200 Avi Kivity <av...@qu...> wrote: > I think 33 is the error code, which means we got a general protection > fault while accessing segment 0x33. > > What guest code is running when this happens? The dump sometimes > includes the current code. When it happened I started an openSUSE-10.3 installation. Here is the complete dump: [guill]$ ./qemu-system-x86_64 -hda ~/disk_images/openSUSE-10.3.qcow2 -cdrom ~/iso_images/openSUSE-10.3-GM-x86_64-mini.iso -boot d -m 1024 exception 13 (33) rax 0000000000000671 rbx 0000000000800000 rcx 0000000000000000 rdx 00000000000013ca rsi 0000000000055e1c rdi 0000000000055e1d rsp 00000000fffa0080 rbp 000000000000200b r8 0000000000000000 r9 0000000000000000 r10 0000000000000000 r11 0000000000000000 r12 0000000000000000 r13 0000000000000000 r14 0000000000000000 r15 0000000000000000 rip 000000000000b071 rflags 00033096 cs 4004 (00040040/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) ds 4004 (00040040/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) es 00ff (00000ff0/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) ss ff11 (000ff110/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) fs 3002 (00030020/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) gs 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) tr 0000 (fffbd000/00002088 p 1 dpl 0 db 0 s 0 type b l 0 g 0 avl 0) ldt 0000 (00000000/0000ffff p 1 dpl 0 db 0 s 0 type 2 l 0 g 0 avl 0) gdt 40920/47 idt 0/ffff cr0 60000010 cr2 0 cr3 0 cr4 0 cr8 0 efer 0 code: 17 06 29 4b 01 18 eb 18 a8 25 aa 19 28 4c 01 28 4d 01 01 17 --> 0f 17 0f 01 17 0f 17 12 01 17 2c 25 4b 19 21 00 02 17 1a 94 0a 76 67 61 3d 30 78 25 78 20 Aborted In the console I got: [86955.117391] handle_exception: unexpected, vectoring info 0x80000306 intr info 0x80000b0d [86955.193194] pending exception: not handled yet [86955.219948] pending exception: not handled yet -- Guillaume Thouvenin |
From: Avi K. <av...@qu...> - 2008-01-12 20:19:01
|
Guillaume Thouvenin wrote: > On Thu, 10 Jan 2008 17:32:35 +0200 > Avi Kivity <av...@qu...> wrote: > > >> I think 33 is the error code, which means we got a general protection >> fault while accessing segment 0x33. >> >> What guest code is running when this happens? The dump sometimes >> includes the current code. >> > > When it happened I started an openSUSE-10.3 installation. Here is the complete dump: > > [guill]$ ./qemu-system-x86_64 -hda ~/disk_images/openSUSE-10.3.qcow2 -cdrom ~/iso_images/openSUSE-10.3-GM-x86_64-mini.iso -boot d -m 1024 > exception 13 (33) > rax 0000000000000671 rbx 0000000000800000 rcx 0000000000000000 rdx 00000000000013ca > rsi 0000000000055e1c rdi 0000000000055e1d rsp 00000000fffa0080 rbp 000000000000200b > r8 0000000000000000 r9 0000000000000000 r10 0000000000000000 r11 0000000000000000 > r12 0000000000000000 r13 0000000000000000 r14 0000000000000000 r15 0000000000000000 > rip 000000000000b071 rflags 00033096 > cs 4004 (00040040/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) > ds 4004 (00040040/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) > es 00ff (00000ff0/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) > ss ff11 (000ff110/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) > fs 3002 (00030020/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) > gs 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) > tr 0000 (fffbd000/00002088 p 1 dpl 0 db 0 s 0 type b l 0 g 0 avl 0) > ldt 0000 (00000000/0000ffff p 1 dpl 0 db 0 s 0 type 2 l 0 g 0 avl 0) > gdt 40920/47 > idt 0/ffff > cr0 60000010 cr2 0 cr3 0 cr4 0 cr8 0 efer 0 > code: 17 06 29 4b 01 18 eb 18 a8 25 aa 19 28 4c 01 28 4d 01 01 17 --> 0f 17 0f 01 17 0f 17 12 01 17 2c 25 4b 19 21 00 02 17 1a 94 0a 76 67 61 3d 30 78 25 78 20 > Aborted > > In the console I got: > [86955.117391] handle_exception: unexpected, vectoring info 0x80000306 intr info 0x80000b0d > [86955.193194] pending exception: not handled yet > [86955.219948] pending exception: not handled yet > We probably need to understand the first handle_exception message; things have probably gone very wrong afterwards. -- Any sufficiently difficult bug is indistinguishable from a feature. |
From: Anthony L. <an...@co...> - 2008-01-12 20:34:04
|
Avi Kivity wrote: > Guillaume Thouvenin wrote: > >> On Thu, 10 Jan 2008 17:32:35 +0200 >> Avi Kivity <av...@qu...> wrote: >> >> >> >>> I think 33 is the error code, which means we got a general protection >>> fault while accessing segment 0x33. >>> >>> What guest code is running when this happens? The dump sometimes >>> includes the current code. >>> >>> >> When it happened I started an openSUSE-10.3 installation. Here is the complete dump: >> What version of gfxboot does openSUSE 10.3 use? gfxboot was broken for KVM until very recently. This is probably what you're seeing. Regards, Anthony Liguori >> [guill]$ ./qemu-system-x86_64 -hda ~/disk_images/openSUSE-10.3.qcow2 -cdrom ~/iso_images/openSUSE-10.3-GM-x86_64-mini.iso -boot d -m 1024 >> exception 13 (33) >> rax 0000000000000671 rbx 0000000000800000 rcx 0000000000000000 rdx 00000000000013ca >> rsi 0000000000055e1c rdi 0000000000055e1d rsp 00000000fffa0080 rbp 000000000000200b >> r8 0000000000000000 r9 0000000000000000 r10 0000000000000000 r11 0000000000000000 >> r12 0000000000000000 r13 0000000000000000 r14 0000000000000000 r15 0000000000000000 >> rip 000000000000b071 rflags 00033096 >> cs 4004 (00040040/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) >> ds 4004 (00040040/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) >> es 00ff (00000ff0/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) >> ss ff11 (000ff110/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) >> fs 3002 (00030020/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) >> gs 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) >> tr 0000 (fffbd000/00002088 p 1 dpl 0 db 0 s 0 type b l 0 g 0 avl 0) >> ldt 0000 (00000000/0000ffff p 1 dpl 0 db 0 s 0 type 2 l 0 g 0 avl 0) >> gdt 40920/47 >> idt 0/ffff >> cr0 60000010 cr2 0 cr3 0 cr4 0 cr8 0 efer 0 >> code: 17 06 29 4b 01 18 eb 18 a8 25 aa 19 28 4c 01 28 4d 01 01 17 --> 0f 17 0f 01 17 0f 17 12 01 17 2c 25 4b 19 21 00 02 17 1a 94 0a 76 67 61 3d 30 78 25 78 20 >> Aborted >> >> In the console I got: >> [86955.117391] handle_exception: unexpected, vectoring info 0x80000306 intr info 0x80000b0d >> [86955.193194] pending exception: not handled yet >> [86955.219948] pending exception: not handled yet >> >> > > We probably need to understand the first handle_exception message; > things have probably gone very wrong afterwards. > > |
From: Guillaume T. <gui...@ex...> - 2008-01-14 07:11:40
|
On Sat, 12 Jan 2008 14:34:12 -0600 Anthony Liguori <an...@co...> wrote: > What version of gfxboot does openSUSE 10.3 use? gfxboot was broken for > KVM until very recently. This is probably what you're seeing. I don't know what version it is but do you talk about the bug due to the wrong RPL value in the SS selector that produces a VMentry failure? Because my problem is here. I thought that I could catch the VMentry failure by added a test like "if (unlikely(exit_reason & VMX_EXIT_REASONS_FAILED_VMENTRY))" in kvm_handle_exit(). Thus I tried to start the openSUSE 10.3 with the "old" gfxboot to test the VMentry failure but I cannot catch it and that's why I'm a little lost. I will try to understand the first handle_exception message as suggested by Avi. |