Re: [PATCH 2/3] kvm: svm: reset cr0 properly on vcpu reset

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

 



Eduardo Habkost wrote:
> On Wed, Mar 17, 2010 at 10:48:23PM +0100, Alexander Graf wrote:
>   
>> On 17.03.2010, at 22:42, Eduardo Habkost wrote:
>>
>>     
>>> On Wed, Mar 17, 2010 at 07:17:32PM +0100, Alexander Graf wrote:
>>>       
>>>> Eduardo Habkost wrote:
>>>>         
>>>>> svm_vcpu_reset() was not properly resetting the contents of the guest-visible
>>>>> cr0 register, causing the following issue:
>>>>> https://bugzilla.redhat.com/show_bug.cgi?id=525699
>>>>>
>>>>> Without resetting cr0 properly, the vcpu was running the SIPI bootstrap routine
>>>>> with paging enabled, making the vcpu get a pagefault exception while trying to
>>>>> run it.
>>>>>
>>>>> Instead of setting vmcb->save.cr0 directly, the new code just resets
>>>>> kvm->arch.cr0 and calls kvm_set_cr0(). The bits that were set/cleared on
>>>>> vmcb->save.cr0 (PG, WP, !CD, !NW) will be set properly by svm_set_cr0().
>>>>>
>>>>> kvm_set_cr0() is used instead of calling svm_set_cr0() directly to make sure
>>>>> kvm_mmu_reset_context() is called to reset the mmu to nonpaging mode.
>>>>>
>>>>> Signed-off-by: Eduardo Habkost <ehabkost@xxxxxxxxxx>
>>>>>
>>>>>           
>>>> Should this go into -stable?
>>>>         
>>> I think so. The patch is from October, was -stable branched before that?
>>>       
>> If I read the diff log correctly 2.6.32 kvm development was branched
>> off end of July 2009. The important question is if this patch fixes a
>> regression introduced by some speedup magic.
>>     
>
> I have just checked git history, and it looks like this is not a
> regression. Before this patch, vcpu->cr0 (the guest-visible cr0 value)
> was never reset on vcpu reset, but only vcpu->svm->vmcb->save.cr0 (the
> actual cr0 value used by the CPU).
>   

Good to know. Thanks for looking into this!


Alex
--
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