diff options
author | Gleb Natapov <gleb@redhat.com> | 2009-05-11 06:35:54 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-06-10 04:48:59 -0400 |
commit | 8db3baa2db34035b2ddb7d0e8b186eb92a056532 (patch) | |
tree | 8b208b113eb934b7123f8579f5535bb69ade1c7e /arch/x86/kvm/x86.c | |
parent | 36752c9b91f75aa3ff0f214a89f13d806cb2f61f (diff) |
KVM: Disable CR8 intercept if tpr patching is active
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index beb806b03a2e..249540f98513 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -3142,7 +3142,10 @@ static void update_cr8_intercept(struct kvm_vcpu *vcpu) | |||
3142 | if (!kvm_x86_ops->update_cr8_intercept) | 3142 | if (!kvm_x86_ops->update_cr8_intercept) |
3143 | return; | 3143 | return; |
3144 | 3144 | ||
3145 | max_irr = kvm_lapic_find_highest_irr(vcpu); | 3145 | if (!vcpu->arch.apic->vapic_addr) |
3146 | max_irr = kvm_lapic_find_highest_irr(vcpu); | ||
3147 | else | ||
3148 | max_irr = -1; | ||
3146 | 3149 | ||
3147 | if (max_irr != -1) | 3150 | if (max_irr != -1) |
3148 | max_irr >>= 4; | 3151 | max_irr >>= 4; |
@@ -3249,10 +3252,8 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
3249 | kvm_x86_ops->enable_irq_window(vcpu); | 3252 | kvm_x86_ops->enable_irq_window(vcpu); |
3250 | 3253 | ||
3251 | if (kvm_lapic_enabled(vcpu)) { | 3254 | if (kvm_lapic_enabled(vcpu)) { |
3252 | if (!vcpu->arch.apic->vapic_addr) | 3255 | update_cr8_intercept(vcpu); |
3253 | update_cr8_intercept(vcpu); | 3256 | kvm_lapic_sync_to_vapic(vcpu); |
3254 | else | ||
3255 | kvm_lapic_sync_to_vapic(vcpu); | ||
3256 | } | 3257 | } |
3257 | 3258 | ||
3258 | up_read(&vcpu->kvm->slots_lock); | 3259 | up_read(&vcpu->kvm->slots_lock); |