diff options
author | Avi Kivity <avi@qumranet.com> | 2007-03-21 17:11:36 +0100 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-05-03 09:52:26 +0200 |
commit | 6da63cf95f6a19fe0a302232048452c96b178e45 (patch) | |
tree | ee415a52fe660721ea6307cfcb207f6b4f285ff9 /drivers/kvm | |
parent | KVM: Hack real-mode segments on vmx from KVM_SET_SREGS (diff) | |
download | linux-6da63cf95f6a19fe0a302232048452c96b178e45.tar.xz linux-6da63cf95f6a19fe0a302232048452c96b178e45.zip |
KVM: Don't allow the guest to turn off the cpu cache
The cpu cache is a host resource; the guest should not be able to turn
it off (even for itself).
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm')
-rw-r--r-- | drivers/kvm/svm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index d3cc1157d23b..191bc45b83e0 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c @@ -737,8 +737,10 @@ static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) } #endif vcpu->svm->cr0 = cr0; - vcpu->svm->vmcb->save.cr0 = cr0 | CR0_PG_MASK | CR0_WP_MASK; vcpu->cr0 = cr0; + cr0 |= CR0_PG_MASK | CR0_WP_MASK; + cr0 &= ~(CR0_CD_MASK | CR0_NW_MASK); + vcpu->svm->vmcb->save.cr0 = cr0; } static void svm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) |