diff options
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r-- | arch/x86/kvm/svm.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index de755cb1431d..1a582f1090e8 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -792,6 +792,10 @@ static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) | |||
792 | vcpu->arch.cr0 = cr0; | 792 | vcpu->arch.cr0 = cr0; |
793 | cr0 |= X86_CR0_PG | X86_CR0_WP; | 793 | cr0 |= X86_CR0_PG | X86_CR0_WP; |
794 | cr0 &= ~(X86_CR0_CD | X86_CR0_NW); | 794 | cr0 &= ~(X86_CR0_CD | X86_CR0_NW); |
795 | if (!vcpu->fpu_active) { | ||
796 | svm->vmcb->control.intercept_exceptions |= (1 << NM_VECTOR); | ||
797 | cr0 |= X86_CR0_TS; | ||
798 | } | ||
795 | svm->vmcb->save.cr0 = cr0; | 799 | svm->vmcb->save.cr0 = cr0; |
796 | } | 800 | } |
797 | 801 | ||
@@ -1096,6 +1100,24 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 *data) | |||
1096 | case MSR_IA32_SYSENTER_ESP: | 1100 | case MSR_IA32_SYSENTER_ESP: |
1097 | *data = svm->vmcb->save.sysenter_esp; | 1101 | *data = svm->vmcb->save.sysenter_esp; |
1098 | break; | 1102 | break; |
1103 | /* Nobody will change the following 5 values in the VMCB so | ||
1104 | we can safely return them on rdmsr. They will always be 0 | ||
1105 | until LBRV is implemented. */ | ||
1106 | case MSR_IA32_DEBUGCTLMSR: | ||
1107 | *data = svm->vmcb->save.dbgctl; | ||
1108 | break; | ||
1109 | case MSR_IA32_LASTBRANCHFROMIP: | ||
1110 | *data = svm->vmcb->save.br_from; | ||
1111 | break; | ||
1112 | case MSR_IA32_LASTBRANCHTOIP: | ||
1113 | *data = svm->vmcb->save.br_to; | ||
1114 | break; | ||
1115 | case MSR_IA32_LASTINTFROMIP: | ||
1116 | *data = svm->vmcb->save.last_excp_from; | ||
1117 | break; | ||
1118 | case MSR_IA32_LASTINTTOIP: | ||
1119 | *data = svm->vmcb->save.last_excp_to; | ||
1120 | break; | ||
1099 | default: | 1121 | default: |
1100 | return kvm_get_msr_common(vcpu, ecx, data); | 1122 | return kvm_get_msr_common(vcpu, ecx, data); |
1101 | } | 1123 | } |
@@ -1156,6 +1178,10 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data) | |||
1156 | case MSR_IA32_SYSENTER_ESP: | 1178 | case MSR_IA32_SYSENTER_ESP: |
1157 | svm->vmcb->save.sysenter_esp = data; | 1179 | svm->vmcb->save.sysenter_esp = data; |
1158 | break; | 1180 | break; |
1181 | case MSR_IA32_DEBUGCTLMSR: | ||
1182 | pr_unimpl(vcpu, "%s: MSR_IA32_DEBUGCTLMSR 0x%llx, nop\n", | ||
1183 | __FUNCTION__, data); | ||
1184 | break; | ||
1159 | case MSR_K7_EVNTSEL0: | 1185 | case MSR_K7_EVNTSEL0: |
1160 | case MSR_K7_EVNTSEL1: | 1186 | case MSR_K7_EVNTSEL1: |
1161 | case MSR_K7_EVNTSEL2: | 1187 | case MSR_K7_EVNTSEL2: |