All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Jiaqing Du <jiaqing@gmail.com>
Cc: kvm@vger.kernel.org
Subject: Re: NMI Injection to Guest
Date: Sun, 26 Jul 2009 08:47:05 +0300	[thread overview]
Message-ID: <20090726054705.GI7928@redhat.com> (raw)
In-Reply-To: <6d8082040907251346h79430f03nb31e762da29c665d@mail.gmail.com>

On Sat, Jul 25, 2009 at 10:46:39PM +0200, Jiaqing Du wrote:
> Hi list,
> 
> I'm trying to extend OProfile to support guest profiling. One step of
> my work is to push an NMI to the guest(s) when a performance counter
> overflows. Please correct me if the following is not correct:
> 
> counter overflow --> NMI to host --> VM exit --> "int $2" to handle
> NMI on host --> ...   --> VM entry --> NMI to guest
> 
Correct except the last step (--> NMI to guest). Host nmi is not
propagated to guests.

> On the path between VM-exit and VM-entry, I want to push an NMI to the
> guest. I tried to put the following code on the path, but never
> succeeded. Various wired things happened, such as KVM hangs, guest
> kernel oops, and host hangs. I tried both code with Linux 2.6.30 and
> version 88.
> 
> if (vmx_nmi_allowed())  { vmx_inject_nmi(); }
> 
> Any suggestions? Where is the right place to push an NMI and what are
> the necessary checks?
Call kvm_inject_nmi(vcpu). And don't forget to vcpu_load(vcpu) before
doing it. See kvm_vcpu_ioctl_nmi().

--
			Gleb.

  reply	other threads:[~2009-07-26  5:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-25 20:46 NMI Injection to Guest Jiaqing Du
2009-07-26  5:47 ` Gleb Natapov [this message]
2009-07-26 19:25   ` Jiaqing Du
2009-07-26 19:41     ` Nipun sehrawat
2009-07-27  5:19       ` Gleb Natapov
2009-07-27  5:17     ` Gleb Natapov
2009-07-30 13:24       ` Jiaqing Du
2009-08-01 15:36         ` Jiaqing Du
2009-08-02  9:15           ` Gleb Natapov

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=20090726054705.GI7928@redhat.com \
    --to=gleb@redhat.com \
    --cc=jiaqing@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.