Re: [PATCH] qemu-kvm: Fix segfault on -no-kvm startup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Gleb Natapov wrote:
> 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().

Yes, possible. But I'm not sure if it's worth to refactor at this level.

I think the whole irqchip interface has to go through some broader
refactoring when pushing it upstream. The result should either be a
specific, in-kernel-irqchip apic device or generic wrapper services that
cover all cases, is easily compiled away in the absence of KVM and avoid
#ifdefs like below.

Jan

> 
>> Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>
>> ---
>>
>>  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
>>  }
>>  

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux