Skip to content

Commit

Permalink
KVM: Don't allow the guest to turn off the cpu cache
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
avikivity committed May 3, 2007
1 parent 038881c commit 6da63cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6da63cf

Please sign in to comment.