From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH] qemu-kvm: Fix segfault on -no-kvm startup Date: Fri, 25 Sep 2009 20:05:48 +0300 Message-ID: <20090925170548.GA30416@redhat.com> References: <4ABCEA5D.4000209@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , Marcelo Tosatti , kvm-devel To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:16376 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751166AbZIYRFs (ORCPT ); Fri, 25 Sep 2009 13:05:48 -0400 Content-Disposition: inline In-Reply-To: <4ABCEA5D.4000209@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 > --- > > 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.