KVM: nSVM: Do not report CLTS via SVM_EXIT_WRITE_CR0 to L1
authorJan Kiszka <jan.kiszka@siemens.com>
Sun, 29 Jun 2014 19:55:53 +0000 (21:55 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 9 Jul 2014 16:09:55 +0000 (18:09 +0200)
CLTS only changes TS which is not monitored by selected CR0
interception. So skip any attempt to translate WRITE_CR0 to
CR0_SEL_WRITE for this instruction.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm.c

index b5e994ad0135973acb1a449ce3b5442a2aa9b43b..c79766e1f1e040ef1b74a270b679d50b95e184fe 100644 (file)
@@ -4205,7 +4205,8 @@ static int svm_check_intercept(struct kvm_vcpu *vcpu,
                if (info->intercept == x86_intercept_cr_write)
                        icpt_info.exit_code += info->modrm_reg;
 
-               if (icpt_info.exit_code != SVM_EXIT_WRITE_CR0)
+               if (icpt_info.exit_code != SVM_EXIT_WRITE_CR0 ||
+                   info->intercept == x86_intercept_clts)
                        break;
 
                intercept = svm->nested.intercept;