From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: Jan Kiszka <jan.kiszka@siemens.com>, Avi Kivity <avi@redhat.com>,
qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: [Qemu-devel] [PATCH 1/6] qemu, kvm: Enable NMI support for user space irqchip
Date: Thu, 09 Dec 2010 14:58:52 +0800 [thread overview]
Message-ID: <4D007E2C.4070308@cn.fujitsu.com> (raw)
Make use of the new KVM_NMI IOCTL to send NMIs into the KVM guest if the
user space APIC emulation or some other source raised them.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 7dfc357..c4ebe28 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -1417,6 +1417,14 @@ int kvm_arch_get_registers(CPUState *env)
int kvm_arch_pre_run(CPUState *env, struct kvm_run *run)
{
+#ifdef KVM_CAP_USER_NMI
+ if (env->interrupt_request & CPU_INTERRUPT_NMI) {
+ env->interrupt_request &= ~CPU_INTERRUPT_NMI;
+ DPRINTF("injected NMI\n");
+ kvm_vcpu_ioctl(env, KVM_NMI);
+ }
+#endif
+
/* Try to inject an interrupt if the guest can accept it */
if (run->ready_for_interrupt_injection &&
(env->interrupt_request & CPU_INTERRUPT_HARD) &&
next reply other threads:[~2010-12-09 6:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-09 6:58 Lai Jiangshan [this message]
2010-12-09 7:25 ` [Qemu-devel] Re: [PATCH 1/6] qemu, kvm: Enable NMI support for user space irqchip Jan Kiszka
2010-12-10 3:17 ` Lai Jiangshan
2010-12-10 7:42 ` [Qemu-devel] [PATCH V2] qemu, kvm: Enable user space NMI injection for kvm guest Lai Jiangshan
2010-12-10 8:41 ` [Qemu-devel] " Jan Kiszka
2010-12-13 8:43 ` Lai Jiangshan
2010-12-20 2:41 ` Lai Jiangshan
2010-12-20 10:35 ` Marcelo Tosatti
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=4D007E2C.4070308@cn.fujitsu.com \
--to=laijs@cn.fujitsu.com \
--cc=avi@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=kvm@vger.kernel.org \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).