Re: [PATCH 3/9] change order of kvm_init call.

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

 



On Mon, Jul 27, 2009 at 12:49:06PM -0500, Anthony Liguori wrote:
> Glauber Costa wrote:
>> On Sun, Jul 26, 2009 at 08:59:44PM +0200, Jan Kiszka wrote:
>>   
>>> Glauber Costa wrote:
>>>     
>>>> The goal is to get rid of the call to kvm_init. But those things
>>>> are subtle, and often break. So do it in a separate patch, to help
>>>> finding potential issues in future bisections.
>>>>       
>>> Found such an issued: This patch triggers a segfault if no kvm modules
>>> are loaded and you start qemu without -no-kvm. Please have a look.
>>>
>>> Jan
>>>     
>>
>> ok, the culprit seems to be a 
>>
>>     if (kvm_enabled())
>>         return;
>>
>> in the beginning of code_gen_alloc.
>>
>> It is 7f3d0cbe, by Avi, and according to changelog, suggested by anthony.
>> I however, fail to realise the purpose of this optimization. For one thing,
>> it totally dictates that kvm has absolutely to be enabled or disabled prior
>> to this point. No mind changing later. Also, the real deal is to be able
>> to compile out tcg entirely. The strategy of just disabling the code gen
>> alloc is a minor nitpick that just papers over this.
>>   
>
> I agree with you in principle but I think reverting this papers over an  
> issue.
>
> Why are we touching code_gen_ptr when using KVM?  Can someone post the  
> full back trace?
we're not.

The issue happens exactly when the kvm modules are not loaded, then we're failing
to initialize kvm. However, in the patch that raised this issue, I'm moving
KVM initialization to after this code path. And in qemu-kvm.git, kvm is
enabled-by-default. So tcg code would think kvm is enabled and skip initialization,
while kvm code will fail to really initialize itself later.

Result? Mayhem.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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