diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2008-09-24 19:28:34 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2008-10-15 08:25:28 -0400 |
commit | e48258009d941891fca35348986b8d280caf31cd (patch) | |
tree | 73d1fb56a9fc22c1e55160bb04e772bd6b2244fb /arch/x86/kvm/x86.c | |
parent | 582801a95d2f2ceab841779e1dec0e11dfec44c0 (diff) |
KVM: PIC: enhance IPI avoidance
The PIC code makes little effort to avoid kvm_vcpu_kick(), resulting in
unnecessary guest exits in some conditions.
For example, if the timer interrupt is routed through the IOAPIC, IRR
for IRQ 0 will get set but not cleared, since the APIC is handling the
acks.
This means that everytime an interrupt < 16 is triggered, the priority
logic will find IRQ0 pending and send an IPI to vcpu0 (in case IRQ0 is
not masked, which is Linux's case).
Introduce a new variable isr_ack to represent the IRQ's for which the
guest has been signalled / cleared the ISR. Use it to avoid more than
one IPI per trigger-ack cycle, in addition to the avoidance when ISR is
set in get_priority().
Signed-off-by: Marcelo Tosatti <mtosatti@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 | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 1c5864ac0837..4cfdd1b6df0b 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -3963,6 +3963,7 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, | |||
3963 | pr_debug("Set back pending irq %d\n", | 3963 | pr_debug("Set back pending irq %d\n", |
3964 | pending_vec); | 3964 | pending_vec); |
3965 | } | 3965 | } |
3966 | kvm_pic_clear_isr_ack(vcpu->kvm); | ||
3966 | } | 3967 | } |
3967 | 3968 | ||
3968 | kvm_set_segment(vcpu, &sregs->cs, VCPU_SREG_CS); | 3969 | kvm_set_segment(vcpu, &sregs->cs, VCPU_SREG_CS); |