diff options
author | Radim Krčmář <rkrcmar@redhat.com> | 2014-03-11 14:11:18 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-03-12 13:21:10 -0400 |
commit | 596f3142d2b7be307a1652d59e7b93adab918437 (patch) | |
tree | d48dead1f93b9766d14d4ccb9e0cb3b462ba9de4 /arch | |
parent | 6cbde8253a8143ada18ec0d1711230747a7c1934 (diff) |
KVM: SVM: fix cr8 intercept window
We always disable cr8 intercept in its handler, but only re-enable it
if handling KVM_REQ_EVENT, so there can be a window where we do not
intercept cr8 writes, which allows an interrupt to disrupt a higher
priority task.
Fix this by disabling intercepts in the same function that re-enables
them when needed. This fixes BSOD in Windows 2008.
Cc: <stable@vger.kernel.org>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/svm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index e81df8fce027..2de1bc09a8d4 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -3002,10 +3002,8 @@ static int cr8_write_interception(struct vcpu_svm *svm) | |||
3002 | u8 cr8_prev = kvm_get_cr8(&svm->vcpu); | 3002 | u8 cr8_prev = kvm_get_cr8(&svm->vcpu); |
3003 | /* instruction emulation calls kvm_set_cr8() */ | 3003 | /* instruction emulation calls kvm_set_cr8() */ |
3004 | r = cr_interception(svm); | 3004 | r = cr_interception(svm); |
3005 | if (irqchip_in_kernel(svm->vcpu.kvm)) { | 3005 | if (irqchip_in_kernel(svm->vcpu.kvm)) |
3006 | clr_cr_intercept(svm, INTERCEPT_CR8_WRITE); | ||
3007 | return r; | 3006 | return r; |
3008 | } | ||
3009 | if (cr8_prev <= kvm_get_cr8(&svm->vcpu)) | 3007 | if (cr8_prev <= kvm_get_cr8(&svm->vcpu)) |
3010 | return r; | 3008 | return r; |
3011 | kvm_run->exit_reason = KVM_EXIT_SET_TPR; | 3009 | kvm_run->exit_reason = KVM_EXIT_SET_TPR; |
@@ -3567,6 +3565,8 @@ static void update_cr8_intercept(struct kvm_vcpu *vcpu, int tpr, int irr) | |||
3567 | if (is_guest_mode(vcpu) && (vcpu->arch.hflags & HF_VINTR_MASK)) | 3565 | if (is_guest_mode(vcpu) && (vcpu->arch.hflags & HF_VINTR_MASK)) |
3568 | return; | 3566 | return; |
3569 | 3567 | ||
3568 | clr_cr_intercept(svm, INTERCEPT_CR8_WRITE); | ||
3569 | |||
3570 | if (irr == -1) | 3570 | if (irr == -1) |
3571 | return; | 3571 | return; |
3572 | 3572 | ||