aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/svm.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-03-21 12:11:36 -0400
committerAvi Kivity <avi@qumranet.com>2007-05-03 03:52:26 -0400
commit6da63cf95f6a19fe0a302232048452c96b178e45 (patch)
treeee415a52fe660721ea6307cfcb207f6b4f285ff9 /drivers/kvm/svm.c
parent038881c8bec0e9a796d1782c56e29e7c2456626d (diff)
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/svm.c')
-rw-r--r--drivers/kvm/svm.c4
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)
737 } 737 }
738#endif 738#endif
739 vcpu->svm->cr0 = cr0; 739 vcpu->svm->cr0 = cr0;
740 vcpu->svm->vmcb->save.cr0 = cr0 | CR0_PG_MASK | CR0_WP_MASK;
741 vcpu->cr0 = cr0; 740 vcpu->cr0 = cr0;
741 cr0 |= CR0_PG_MASK | CR0_WP_MASK;
742 cr0 &= ~(CR0_CD_MASK | CR0_NW_MASK);
743 vcpu->svm->vmcb->save.cr0 = cr0;
742} 744}
743 745
744static void svm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) 746static void svm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)