[Bug 65561] KVM:Entry failed on Single stepping sti instruction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.kernel.org/show_bug.cgi?id=65561

--- Comment #17 from Jidong Xiao <jidong.xiao@xxxxxxxxx> ---
Hi,Paolo,

I am not familiar with kvm-unit-tests, and I cannot find any documents describe
it. So I use gdb to debug.

And yes I can reproduce the problem. I just use Jatin's sample code to
construct a c program, like this:

linux:~/code/cvedr # cat ss.c
#include <stdio.h>

main(){
asm __volatile__(
    "pushfl \n\t"
    "orl $0x100, (%%esp) \n\t"
    "popfl \n\t"
    "nop \n\t"
    "nop \n\t"
    "outb %b0, %w1 \n\t"
    "nop \n\t"
    "nop \n\t"
    "pushfl \n\t"
    "xorl $0x100, (%%esp) \n\t"
    "popfl \n\t"
    :: "a"(2), "Nd" (80)
  );
}

And I ran the c program with gdb.
(gdb) disas main
Dump of assembler code for function main:
   0x080483e4 <+0>:     push   %ebp
   0x080483e5 <+1>:     mov    %esp,%ebp
   0x080483e7 <+3>:     mov    $0x2,%eax
   0x080483ec <+8>:     pushf
   0x080483ed <+9>:     orl    $0x100,(%esp)
   0x080483f4 <+16>:    popf
   0x080483f5 <+17>:    nop
   0x080483f6 <+18>:    nop
=> 0x080483f7 <+19>:    out    %al,$0x50
   0x080483f9 <+21>:    nop
   0x080483fa <+22>:    nop
   0x080483fb <+23>:    pushf
   0x080483fc <+24>:    xorl   $0x100,(%esp)
   0x08048403 <+31>:    popf
   0x08048404 <+32>:    pop    %ebp
   0x08048405 <+33>:    ret
End of assembler dump.
(gdb) nexti

Program received signal SIGSEGV, Segmentation fault.
0x080483f7 in main ()
(gdb)

You can see when the program counter points to the out instruction, and I used
nexti command to do single step execution, and it ends up a segmentation fault.
According to the kvm code, it seems that x86_emulate_insn() will be called,
indeed I don't see any code in that function takes care of the out instruction.
But why this only affect single step execution? I actually have some other
program that includes some out instructions, and the program runs okay.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux