From mboxrd@z Thu Jan 1 00:00:00 1970
From: bugzilla-daemon@bugzilla.kernel.org
Subject: [Bug 65561] KVM:Entry failed on Single stepping sti instruction
Date: Thu, 22 May 2014 02:02:26 +0000
Message-ID:
References:
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
To: kvm@vger.kernel.org
Return-path:
Received: from mail.kernel.org ([198.145.19.201]:40398 "EHLO mail.kernel.org"
rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
id S1751215AbaEVCCa (ORCPT );
Wed, 21 May 2014 22:02:30 -0400
Received: from mail.kernel.org (localhost [127.0.0.1])
by mail.kernel.org (Postfix) with ESMTP id 8FBEB202EC
for ; Thu, 22 May 2014 02:02:29 +0000 (UTC)
Received: from bugzilla1.web.kernel.org (bugzilla1.web.kernel.org [172.20.200.51])
by mail.kernel.org (Postfix) with ESMTP id 3280A20306
for ; Thu, 22 May 2014 02:02:27 +0000 (UTC)
In-Reply-To:
Sender: kvm-owner@vger.kernel.org
List-ID:
https://bugzilla.kernel.org/show_bug.cgi?id=65561
--- Comment #17 from Jidong Xiao ---
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
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.