Where are vmentry failure caugth?
Hello,
When a vmentry failure occurs, where is it caught? I see thatVMX_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
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Quoted 2 lines · On Thu, 10 Jan 2008 11:19:58 +0100 Guillaume Thouvenin…
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 intkvm_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
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Quoted 8 lines · Guillaume Thouvenin
Quoted 3 lines · On Thu, 10 Jan 2008 11:19:58 +0100 Guillaume Thouvenin…
I tried but it didn't catch any vmentry failures (and I know that
there is at least one during the test).
Quoted 8 lines
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.
Signature · 8 lines
error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
A message that is not in the archive (sent off-list or not yet received): 47863A93.2030707-atKUWr5tajBWk0Htik3J/[email protected]
Quoted 5 lines · On Thu, 10 Jan 2008 17:32:35 +0200 Avi Kivity…
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
Signature · 7 lines
Guillaume Thouvenin ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Quoted 34 lines · Guillaume Thouvenin
Quoted 6 lines · On Thu, 10 Jan 2008 17:32:35 +0200 Avi Kivity…
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 rdx00000000000013ca
rsi0000000000055e1crdi0000000000055e1drsp00000000fffa0080rbp000000000000200b
r8 0000000000000000 r9 0000000000000000 r10 0000000000000000 r11 0000000000000000
r12 0000000000000000 r13 0000000000000000 r14 0000000000000000 r15 0000000000000000
rip000000000000b071rflags 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
Quoted 5 lines
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.
Signature · 8 lines
Any sufficiently difficult bug is indistinguishable from a feature. ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
A message that is not in the archive (sent off-list or not yet received): 47891F36.1080903-atKUWr5tajBWk0Htik3J/[email protected]
Quoted 10 lines · Avi Kivity
Quoted 8 lines · Guillaume Thouvenin
Quoted 3 lines · On Thu, 10 Jan 2008 17:32:35 +0200 Avi Kivity…
I think 33 is the error code, which means we got a general protection fault while accessing segment
0x33.
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
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
Quoted 28 lines
Quoted 21 lines
[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 rdx00000000000013ca
rsi0000000000055e1crdi0000000000055e1drsp00000000fffa0080rbp000000000000200b
r8 0000000000000000 r9 0000000000000000 r10 0000000000000000 r11 0000000000000000
r12 0000000000000000 r13 0000000000000000 r14 0000000000000000 r15 0000000000000000
rip000000000000b071rflags 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 AbortedQuoted 6 lines
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
Quoted 4 lines
We probably need to understand the first
handle_exceptionmessage; things have probably gone very wrong afterwards.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 2 lines · On Sat, 12 Jan 2008 14:34:12 -0600 Anthony Liguori…
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.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace