From: Gleb Natapov <gleb@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Avi Kivity <avi@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
kvm-devel <kvm@vger.kernel.org>
Subject: Re: [PATCH] qemu-kvm: Fix segfault on -no-kvm startup
Date: Fri, 25 Sep 2009 20:05:48 +0300 [thread overview]
Message-ID: <20090925170548.GA30416@redhat.com> (raw)
In-Reply-To: <4ABCEA5D.4000209@siemens.com>
On Fri, Sep 25, 2009 at 06:05:49PM +0200, Jan Kiszka wrote:
> The check for in-kernel irqchip must be protected by kvm_enabled, and we
> have a different wrapper for it.
>
Why not move kvm_enabled() into kvm_irqchip_in_kernel()? It will return
false if !kvm_enabled().
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>
> hw/apic.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/hw/apic.c b/hw/apic.c
> index 3a2e128..01ac174 100644
> --- a/hw/apic.c
> +++ b/hw/apic.c
> @@ -509,9 +509,10 @@ void apic_init_reset(CPUState *env)
>
> env->halted = !(s->apicbase & MSR_IA32_APICBASE_BSP);
> #ifdef KVM_CAP_MP_STATE
> - if (kvm_irqchip_in_kernel(kvm_context))
> + if (kvm_enabled() && qemu_kvm_irqchip_in_kernel()) {
> env->mp_state
> = env->halted ? KVM_MP_STATE_UNINITIALIZED : KVM_MP_STATE_RUNNABLE;
> + }
> #endif
> }
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Gleb.
next prev parent reply other threads:[~2009-09-25 17:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-25 16:05 [PATCH] qemu-kvm: Fix segfault on -no-kvm startup Jan Kiszka
2009-09-25 17:05 ` Gleb Natapov [this message]
2009-09-25 19:03 ` Jan Kiszka
2009-09-27 8:33 ` Avi Kivity
2009-09-27 8:33 ` 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=20090925170548.GA30416@redhat.com \
--to=gleb@redhat.com \
--cc=avi@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
/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).