All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: kvm-ia64@vger.kernel.org
Subject: Re: [PATCH] KVM: Qemu: push_nmi should be only used by I386 Arch.
Date: Thu, 27 Nov 2008 11:39:41 +0000	[thread overview]
Message-ID: <492E86FD.1040903@siemens.com> (raw)
In-Reply-To: <706158FABBBA044BAD4FE898A02E4BC219BCA9F5@pdsmsx503.ccr.corp.intel.com>

Zhang, Xiantao wrote:
> From 1b89616f99abc8e0983ef58a1f984f31a52fe828 Mon Sep 17 00:00:00 2001
> From: Xiantao Zhang <xiantao.zhang@intel.com>
> Date: Thu, 27 Nov 2008 17:24:51 +0800
> Subject: [PATCH] KVM: Qemu: push_nmi should be only used by I386 Arch.
> 
> Use TARGET_I386 to exclude other archs.
> Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
> ---
>  qemu/qemu-kvm.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
> index cf0e85d..b6c8288 100644
> --- a/qemu/qemu-kvm.c
> +++ b/qemu/qemu-kvm.c
> @@ -154,10 +154,12 @@ static int try_push_interrupts(void *opaque)
>      return kvm_arch_try_push_interrupts(opaque);
>  }
>  
> +#ifdef TARGET_I386
>  static void push_nmi(void *opaque)
>  {
>      kvm_arch_push_nmi(opaque);
>  }
> +#endif
>  
>  static void post_kvm_run(void *opaque, void *data)
>  {
> @@ -742,7 +744,9 @@ static struct kvm_callbacks qemu_kvm_ops = {
>      .shutdown = kvm_shutdown,
>      .io_window = kvm_io_window,
>      .try_push_interrupts = try_push_interrupts,
> +#ifdef TARGET_I386
>      .push_nmi = push_nmi,
> +#endif
>      .post_kvm_run = post_kvm_run,
>      .pre_kvm_run = pre_kvm_run,
>  #ifdef TARGET_I386

Well, doesn't push_nmi() from libkvm.c call into this hook
unconditionally if KVM_CAP_NMI is set (which is the case for all recent
kernel headers)? That should cause SEGVs, so you need to patch kvm_run()
as well.

Makes me wonder if we shouldn't have better defined KVM_CAP_NMI
conditionally, only for arch that actually have NMIs (/wrt KVM: only x86
ATM). But now it's too late...

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2 ES-OS
Corporate Competence Center Embedded Linux

WARNING: multiple messages have this Message-ID (diff)
From: Jan Kiszka <jan.kiszka@siemens.com>
To: "Zhang, Xiantao" <xiantao.zhang@intel.com>
Cc: Avi Kivity <avi@redhat.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"kvm-ia64@vger.kernel.org" <kvm-ia64@vger.kernel.org>
Subject: Re: [PATCH] KVM: Qemu: push_nmi should be only used by I386 Arch.
Date: Thu, 27 Nov 2008 12:39:41 +0100	[thread overview]
Message-ID: <492E86FD.1040903@siemens.com> (raw)
In-Reply-To: <706158FABBBA044BAD4FE898A02E4BC219BCA9F5@pdsmsx503.ccr.corp.intel.com>

Zhang, Xiantao wrote:
> From 1b89616f99abc8e0983ef58a1f984f31a52fe828 Mon Sep 17 00:00:00 2001
> From: Xiantao Zhang <xiantao.zhang@intel.com>
> Date: Thu, 27 Nov 2008 17:24:51 +0800
> Subject: [PATCH] KVM: Qemu: push_nmi should be only used by I386 Arch.
> 
> Use TARGET_I386 to exclude other archs.
> Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
> ---
>  qemu/qemu-kvm.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
> index cf0e85d..b6c8288 100644
> --- a/qemu/qemu-kvm.c
> +++ b/qemu/qemu-kvm.c
> @@ -154,10 +154,12 @@ static int try_push_interrupts(void *opaque)
>      return kvm_arch_try_push_interrupts(opaque);
>  }
>  
> +#ifdef TARGET_I386
>  static void push_nmi(void *opaque)
>  {
>      kvm_arch_push_nmi(opaque);
>  }
> +#endif
>  
>  static void post_kvm_run(void *opaque, void *data)
>  {
> @@ -742,7 +744,9 @@ static struct kvm_callbacks qemu_kvm_ops = {
>      .shutdown = kvm_shutdown,
>      .io_window = kvm_io_window,
>      .try_push_interrupts = try_push_interrupts,
> +#ifdef TARGET_I386
>      .push_nmi = push_nmi,
> +#endif
>      .post_kvm_run = post_kvm_run,
>      .pre_kvm_run = pre_kvm_run,
>  #ifdef TARGET_I386

Well, doesn't push_nmi() from libkvm.c call into this hook
unconditionally if KVM_CAP_NMI is set (which is the case for all recent
kernel headers)? That should cause SEGVs, so you need to patch kvm_run()
as well.

Makes me wonder if we shouldn't have better defined KVM_CAP_NMI
conditionally, only for arch that actually have NMIs (/wrt KVM: only x86
ATM). But now it's too late...

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2 ES-OS
Corporate Competence Center Embedded Linux

  reply	other threads:[~2008-11-27 11:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-27  9:36 [PATCH] KVM: Qemu: push_nmi should be only used by I386 Arch Zhang, Xiantao
2008-11-27  9:36 ` Zhang, Xiantao
2008-11-27 11:39 ` Jan Kiszka [this message]
2008-11-27 11:39   ` Jan Kiszka
2008-11-28  1:47 ` Zhang, Xiantao
2008-11-28  1:47   ` Zhang, Xiantao
2008-11-28  9:26 ` Jan Kiszka
2008-11-28  9:26   ` Jan Kiszka
2008-12-01 16:38 ` Hollis Blanchard
2008-12-01 16:38   ` Hollis Blanchard
2008-12-01 23:02 ` Jan Kiszka
2008-12-01 23:02   ` Jan Kiszka
2008-12-01 23:18 ` Hollis Blanchard
2008-12-01 23:18   ` Hollis Blanchard
2008-12-02  2:01 ` Zhang, Xiantao
2008-12-02  2:01   ` Zhang, Xiantao
2008-12-02  9:26 ` Avi Kivity
2008-12-02  9:26   ` Avi Kivity

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=492E86FD.1040903@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=kvm-ia64@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.