Commit ac6c2bc5 authored by Avi Kivity's avatar Avi Kivity Committed by Linus Torvalds

[PATCH] kvm: Fix mmu going crazy of guest sets cr0.wp == 0

The kvm mmu relies on cr0.wp being set even if the guest does not set it.  The
vmx code correctly forces cr0.wp at all times, the svm code does not, so it
can't boot solaris without this patch.
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 988ad74f
...@@ -723,7 +723,7 @@ static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) ...@@ -723,7 +723,7 @@ static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0)
} }
#endif #endif
vcpu->svm->cr0 = cr0; vcpu->svm->cr0 = cr0;
vcpu->svm->vmcb->save.cr0 = cr0 | CR0_PG_MASK; vcpu->svm->vmcb->save.cr0 = cr0 | CR0_PG_MASK | CR0_WP_MASK;
vcpu->cr0 = cr0; vcpu->cr0 = cr0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment