aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/i8254.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2008-10-20 04:20:02 -0400
committerAvi Kivity <avi@redhat.com>2008-12-31 09:51:46 -0500
commit8fdb2351d51b040146f10a624387bbd102d851c0 (patch)
treec28ff5ec61f51cb1a04b7e29923e4ce3f2aba421 /arch/x86/kvm/i8254.c
parent291fd39bfc2089c2dae79cf2d7cfca81b14ca769 (diff)
KVM: x86: Fix and refactor NMI watchdog emulation
This patch refactors the NMI watchdog delivery patch, consolidating tests and providing a proper API for delivering watchdog events. An included micro-optimization is to check only for apic_hw_enabled in kvm_apic_local_deliver (the test for LVT mask is covering the soft-disabled case already). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Acked-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/i8254.c')
-rw-r--r--arch/x86/kvm/i8254.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
index 580cc1d01c7d..b6fcf5a9e502 100644
--- a/arch/x86/kvm/i8254.c
+++ b/arch/x86/kvm/i8254.c
@@ -612,15 +612,18 @@ static void __inject_pit_timer_intr(struct kvm *kvm)
612 mutex_unlock(&kvm->lock); 612 mutex_unlock(&kvm->lock);
613 613
614 /* 614 /*
615 * Provides NMI watchdog support in IOAPIC mode. 615 * Provides NMI watchdog support via Virtual Wire mode.
616 * The route is: PIT -> PIC -> LVT0 in NMI mode, 616 * The route is: PIT -> PIC -> LVT0 in NMI mode.
617 * timer IRQs will continue to flow through the IOAPIC. 617 *
618 * Note: Our Virtual Wire implementation is simplified, only
619 * propagating PIT interrupts to all VCPUs when they have set
620 * LVT0 to NMI delivery. Other PIC interrupts are just sent to
621 * VCPU0, and only if its LVT0 is in EXTINT mode.
618 */ 622 */
619 for (i = 0; i < KVM_MAX_VCPUS; ++i) { 623 for (i = 0; i < KVM_MAX_VCPUS; ++i) {
620 vcpu = kvm->vcpus[i]; 624 vcpu = kvm->vcpus[i];
621 if (!vcpu) 625 if (vcpu)
622 continue; 626 kvm_apic_nmi_wd_deliver(vcpu);
623 kvm_apic_local_deliver(vcpu, APIC_LVT0);
624 } 627 }
625} 628}
626 629