aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2008-04-09 08:15:29 -0400
committerAvi Kivity <avi@qumranet.com>2008-04-27 05:01:18 -0400
commit6394b6494c0a352a2db3ea3e891ba7aeea7c1441 (patch)
tree71c4d3e7cda2adcdfd3717bc40aa4e2b89c87e53 /arch/x86/kvm
parentec077263b2bb841d973d82342b7fbc07bbad4246 (diff)
KVM: SVM: align shadow CR4.MCE with host
This patch aligns the host version of the CR4.MCE bit with the CR4 active in the guest. This is necessary to get MCE exceptions when the guest is running. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/svm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index d7439ceb2ac2..8af463b91526 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -878,9 +878,12 @@ set:
878 878
879static void svm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) 879static void svm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
880{ 880{
881 unsigned long host_cr4_mce = read_cr4() & X86_CR4_MCE;
882
881 vcpu->arch.cr4 = cr4; 883 vcpu->arch.cr4 = cr4;
882 if (!npt_enabled) 884 if (!npt_enabled)
883 cr4 |= X86_CR4_PAE; 885 cr4 |= X86_CR4_PAE;
886 cr4 |= host_cr4_mce;
884 to_svm(vcpu)->vmcb->save.cr4 = cr4; 887 to_svm(vcpu)->vmcb->save.cr4 = cr4;
885} 888}
886 889