All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Avi Kivity <avi@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 1/6] qemu,kvm:  Enable NMI support for user space irqchip
Date: Thu, 09 Dec 2010 08:25:19 +0100	[thread overview]
Message-ID: <4D00845F.9000503@siemens.com> (raw)
In-Reply-To: <4D007E2C.4070308@cn.fujitsu.com>

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.

> 
> 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) &&

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...

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

WARNING: multiple messages have this Message-ID (diff)
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Lai Jiangshan <laijs@cn.fujitsu.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: Thu, 09 Dec 2010 08:25:19 +0100	[thread overview]
Message-ID: <4D00845F.9000503@siemens.com> (raw)
In-Reply-To: <4D007E2C.4070308@cn.fujitsu.com>

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.

> 
> 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) &&

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...

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

  reply	other threads:[~2010-12-09  7:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-09  6:58 [PATCH 1/6] qemu,kvm: Enable NMI support for user space irqchip Lai Jiangshan
2010-12-09  6:58 ` [Qemu-devel] [PATCH 1/6] qemu, kvm: " Lai Jiangshan
2010-12-09  7:25 ` Jan Kiszka [this message]
2010-12-09  7:25   ` [Qemu-devel] " Jan Kiszka
2010-12-10  3:17   ` [PATCH 1/6] qemu,kvm: " Lai Jiangshan
2010-12-10  3:17     ` [Qemu-devel] Re: [PATCH 1/6] qemu, kvm: " Lai Jiangshan
2010-12-10  7:42   ` [PATCH V2] qemu,kvm: Enable user space NMI injection for kvm guest Lai Jiangshan
2010-12-10  7:42     ` [Qemu-devel] [PATCH V2] qemu, kvm: " Lai Jiangshan
2010-12-10  8:41     ` [PATCH V2] qemu,kvm: " Jan Kiszka
2010-12-10  8:41       ` [Qemu-devel] Re: [PATCH V2] qemu, kvm: " Jan Kiszka
2010-12-13  8:43       ` [PATCH V2] qemu,kvm: " Lai Jiangshan
2010-12-13  8:43         ` [Qemu-devel] Re: [PATCH V2] qemu, kvm: " Lai Jiangshan
2010-12-20  2:41       ` [PATCH V2] qemu,kvm: " Lai Jiangshan
2010-12-20  2:41         ` [Qemu-devel] Re: [PATCH V2] qemu, kvm: " Lai Jiangshan
2010-12-20 10:35     ` [PATCH V2] qemu,kvm: " Marcelo Tosatti
2010-12-20 10:35       ` [Qemu-devel] Re: [PATCH V2] qemu, kvm: " 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=4D00845F.9000503@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=laijs@cn.fujitsu.com \
    --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 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.