public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@bugzilla.kernel.org
To: kvm@vger.kernel.org
Subject: [Bug 65561] KVM:Entry failed on Single stepping sti instruction
Date: Thu, 22 May 2014 02:02:26 +0000	[thread overview]
Message-ID: <bug-65561-28872-6WINGuYBg2@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-65561-28872@https.bugzilla.kernel.org/>

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

--- Comment #17 from Jidong Xiao <jidong.xiao@gmail.com> ---
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.

  parent reply	other threads:[~2014-05-22  2:02 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-23 17:27 [Bug 65561] New: KVM:Entry failed on Single stepping sti instruction bugzilla-daemon
2014-05-20  5:12 ` [Bug 65561] " bugzilla-daemon
2014-05-20  7:10 ` bugzilla-daemon
2014-05-20 11:03 ` bugzilla-daemon
2014-05-20 21:00 ` bugzilla-daemon
2014-05-21  4:43 ` bugzilla-daemon
2014-05-21  4:45 ` bugzilla-daemon
2014-05-21  7:13 ` bugzilla-daemon
2014-05-21 15:13 ` bugzilla-daemon
2014-05-21 15:20 ` bugzilla-daemon
2014-05-21 16:05 ` bugzilla-daemon
2014-05-21 16:30 ` bugzilla-daemon
2014-05-21 16:39 ` bugzilla-daemon
2014-05-21 16:50 ` bugzilla-daemon
2014-05-21 17:14 ` bugzilla-daemon
2014-05-21 20:30 ` bugzilla-daemon
2014-05-21 21:08 ` bugzilla-daemon
2014-05-22  2:02 ` bugzilla-daemon [this message]
2014-05-24  4:59 ` bugzilla-daemon
2014-05-24  5:27 ` bugzilla-daemon
2014-05-24  5:38 ` bugzilla-daemon
2014-05-24  5:43 ` bugzilla-daemon
2014-05-24  5:46 ` bugzilla-daemon
2014-05-24  5:51 ` bugzilla-daemon
2014-05-24  5:56 ` bugzilla-daemon
2014-05-24  6:15 ` bugzilla-daemon
2014-05-24  6:29 ` bugzilla-daemon
2014-05-24  7:24 ` bugzilla-daemon
2014-05-24 12:26 ` bugzilla-daemon
2014-05-24 23:12 ` bugzilla-daemon
2014-05-25  3:03 ` bugzilla-daemon
2014-05-25  6:46 ` bugzilla-daemon
2014-05-25  7:48 ` bugzilla-daemon
2014-05-25  7:58 ` bugzilla-daemon
2014-05-25  8:00 ` bugzilla-daemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-65561-28872-6WINGuYBg2@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@bugzilla.kernel.org \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox