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: Sat, 24 May 2014 06:15:53 +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]:33877 "EHLO mail.kernel.org"
rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
id S1750736AbaEXGP5 (ORCPT );
Sat, 24 May 2014 02:15:57 -0400
Received: from mail.kernel.org (localhost [127.0.0.1])
by mail.kernel.org (Postfix) with ESMTP id 41383200D6
for ; Sat, 24 May 2014 06:15:56 +0000 (UTC)
Received: from bugzilla1.web.kernel.org (bugzilla1.web.kernel.org [172.20.200.51])
by mail.kernel.org (Postfix) with ESMTP id D8F38203A9
for ; Sat, 24 May 2014 06:15:53 +0000 (UTC)
In-Reply-To:
Sender: kvm-owner@vger.kernel.org
List-ID:
https://bugzilla.kernel.org/show_bug.cgi?id=65561
--- Comment #25 from Jidong Xiao ---
(In reply to Jatin Kumar from comment #24)
> > linux:~/code/cvedr # ./accessmsr
> > Segmentation fault
> You got a seg fault because it is privileged instruction and I run it in
> kernel mode not user mode. But you are likely to be running your program in
> user mode. Try something like out instruction.
>
> > Even though my c program in the guest os got a segmentation fault, from the
> > host os level, I don't see the printk statement is triggered, so this is not
> > about privileged instructions or unprivileged instructions. I think there
> > must be some other conditions to trigger these printk statements.
> After getting the VM_EXIT it must be first checking if it requires to
> emulate or should generate a fault. In this case it would have generated the
> fault without emulating it.
>
> Again, you can try it with 'out' instruction.
Alright, Jatin, I wrote a kernel module, like this:
linux:~/code/module # cat testout.c
#include
#include
int init_module(void)
{
printk(KERN_ALERT "Hello world 1.\n");
asm __volatile__("outb %al, %dx \n");
return 0;
}
void cleanup_module(void)
{
printk(KERN_ALERT "Goodbye world 1.\n");
}
I compiled this module and installed with `insmod testout.ko`, and nothing
happens. Noted that the emulator code includes the following lines:
case 0xee: /* out al,dx */
case 0xef: /* out (e/r)ax,dx */
printk(KERN_ERR "DEBUG: Passed %s %d
\n",__FUNCTION__,__LINE__);
port = c->regs[VCPU_REGS_RDX];
io_dir_in = 0;
I added that printk statement, and still, when I was loading the kernel module
in the guest OS, this printk statement was not invoked.
--
You are receiving this mail because:
You are watching the assignee of the bug.