]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
KVM: SVM: Reset cr0 properly on vcpu reset
authorEduardo Habkost <ehabkost@redhat.com>
Fri, 19 Mar 2010 14:47:37 +0000 (15:47 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 26 Apr 2010 14:41:20 +0000 (07:41 -0700)
commite075e2caebf932a85786e6d5eb544ee4b0e1441e
tree3b29b8a4d3a705e9f79a2edbdeecd86aa7af9135
parent5b4ce46f453bb83ce2e382ecccdb89d4920bc613
KVM: SVM: Reset cr0 properly on vcpu reset

commit 18fa000ae453767b59ab97477925895a3f0c46ea upstream

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@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kvm/svm.c