qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Avi Kivity <avi@redhat.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: [Qemu-devel] Re: [PATCH 1/6] qemu, kvm:  Enable NMI support for user space irqchip
Date: Fri, 10 Dec 2010 11:17:14 +0800	[thread overview]
Message-ID: <4D019BBA.9070806@cn.fujitsu.com> (raw)
In-Reply-To: <4D00845F.9000503@siemens.com>

On 12/09/2010 03:25 PM, Jan Kiszka wrote:
> Am 09.12.2010 07:58, Lai Jiangshan wrote:
>>
>> 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.
> 
> In that light, the subject is not absolutely correct.
> 

[...]

> 
> Actually, we already depend on KVM_CAP_DESTROY_MEMORY_REGION_WORKS which
> was introduced with 2.6.29 as well. I would suggest to simply extend the
> static configure check and avoid new #ifdefs in the code.
> 
> Thanks for pushing this! Was obviously so trivial that it was forgotten...
> 


Thanks. We want to inject nmi to kvm guest via qemu monitor,
that's this path's purpose.

But I can't get you means, what I should do to fix this patch?
Just remove the #ifdefs OR use kvm_check_extension(KVM_CAP_USER_NMI) ?


+    static int can_user_nmi = -1; 
+
+    if (can_user_nmi == -1)
+        can_user_nmi = kvm_check_extension(kvm_state, KVM_CAP_USER_NMI);
+
+    if (can_user_nmi > 0 && env->interrupt_request & CPU_INTERRUPT_NMI) {
+        env->interrupt_request &= ~CPU_INTERRUPT_NMI;
+        DPRINTF("injected NMI\n");
+        kvm_vcpu_ioctl(env, KVM_NMI);
+    }

Thanks,
Lai

  reply	other threads:[~2010-12-10  3:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-09  6:58 [Qemu-devel] [PATCH 1/6] qemu, kvm: Enable NMI support for user space irqchip Lai Jiangshan
2010-12-09  7:25 ` [Qemu-devel] " Jan Kiszka
2010-12-10  3:17   ` Lai Jiangshan [this message]
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=4D019BBA.9070806@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).