summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/lapic.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-10-25 15:23:55 +0200
committerAvi Kivity <avi@redhat.com>2011-01-12 11:23:36 +0200
commit83bcacb1a548d4d8df532376c981277761622bce (patch)
treedde9955df18fee353cd01419b625618b6e58cc23 /arch/x86/kvm/lapic.c
parent82ca2d108b493f7d916975805668bef2096f1147 (diff)
downloadlinux-83bcacb1a548d4d8df532376c981277761622bce.tar.gz
linux-83bcacb1a548d4d8df532376c981277761622bce.tar.bz2
linux-83bcacb1a548d4d8df532376c981277761622bce.zip
KVM: Avoid double interrupt injection with vapic
After an interrupt injection, the PPR changes, and we have to reflect that into the vapic. This causes a KVM_REQ_EVENT to be set, which causes the whole interrupt injection routine to be run again (harmlessly). Optimize by only setting KVM_REQ_EVENT if the ppr was lowered; otherwise there is no chance that a new injection is needed. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/lapic.c')
-rw-r--r--arch/x86/kvm/lapic.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 413f8973a855..93cf9d0d3653 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -277,7 +277,8 @@ static void apic_update_ppr(struct kvm_lapic *apic)
if (old_ppr != ppr) {
apic_set_reg(apic, APIC_PROCPRI, ppr);
- kvm_make_request(KVM_REQ_EVENT, apic->vcpu);
+ if (ppr < old_ppr)
+ kvm_make_request(KVM_REQ_EVENT, apic->vcpu);
}
}