Skip to content

Commit

Permalink
KVM: SVM: reset mmu context in init_vmcb
Browse files Browse the repository at this point in the history
Since commit aad8270 no mmu reinitialization is performed
via init_vmcb.

Zero vcpu->arch.cr0 and pass the reset value as a parameter to
kvm_set_cr0.

Signed-off-by: Marcelo Tosatti <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>
  • Loading branch information
matosatti authored and avikivity committed Oct 24, 2010
1 parent c41a15d commit 678041a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,8 +827,8 @@ static void init_vmcb(struct vcpu_svm *svm)
* This is the guest-visible cr0 value.
* svm_set_cr0() sets PG and WP and clears NW and CD on save->cr0.
*/
svm->vcpu.arch.cr0 = X86_CR0_NW | X86_CR0_CD | X86_CR0_ET;
(void)kvm_set_cr0(&svm->vcpu, svm->vcpu.arch.cr0);
svm->vcpu.arch.cr0 = 0;
(void)kvm_set_cr0(&svm->vcpu, X86_CR0_NW | X86_CR0_CD | X86_CR0_ET);

save->cr4 = X86_CR4_PAE;
/* rdx = ?? */
Expand Down

0 comments on commit 678041a

Please sign in to comment.