linux-kernel-test/arch/x86/kvm
Chris Lalancette 529df65e39 KVM: Search the LAPIC's for one that will accept a PIC interrupt
Older versions of 32-bit linux have a "Checking 'hlt' instruction"
test where they repeatedly call the 'hlt' instruction, and then
expect a timer interrupt to kick the CPU out of halt.  This happens
before any LAPIC or IOAPIC setup happens, which means that all of
the APIC's are in virtual wire mode at this point.  Unfortunately,
the current implementation of virtual wire mode is hardcoded to
only kick the BSP, so if a crash+kexec occurs on a different
vcpu, it will never get kicked.

This patch makes pic_unlock() do the equivalent of
kvm_irq_delivery_to_apic() for the IOAPIC code.  That is, it runs
through all of the vcpus looking for one that is in virtual wire
mode.  In the normal case where LAPICs and IOAPICs are configured,
this won't be used at all.  In the bootstrap phase of a modern
OS, before the LAPICs and IOAPICs are configured, this will have
exactly the same behavior as today; VCPU0 is always looked at
first, so it will always get out of the loop after the first
iteration.  This will only go through the loop more than once
during a kexec/kdump, in which case it will only do it a few times
until the kexec'ed kernel programs the LAPIC and IOAPIC.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2010-08-01 10:47:17 +03:00
..
emulate.c KVM: x86 emulator: fix group3 instruction decoding 2010-08-01 10:46:55 +03:00
i8254.c KVM: x86: Introduce a workqueue to deliver PIT timer interrupts 2010-08-01 10:46:49 +03:00
i8254.h KVM: x86: Introduce a workqueue to deliver PIT timer interrupts 2010-08-01 10:46:49 +03:00
i8259.c KVM: Search the LAPIC's for one that will accept a PIC interrupt 2010-08-01 10:47:17 +03:00
irq.c KVM: x86: Introduce a workqueue to deliver PIT timer interrupts 2010-08-01 10:46:49 +03:00
irq.h KVM: i8259: reduce excessive abstraction for pic_irq_request() 2010-08-01 10:47:03 +03:00
Kconfig Merge branch 'kvm-updates/2.6.34' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2010-03-05 13:12:34 -08:00
kvm_cache_regs.h KVM: VMX: Enable XSAVE/XRSTOR for guest 2010-08-01 10:46:31 +03:00
kvm_timer.h KVM: arch/x86/kvm/kvm_timer.h checkpatch cleanup 2010-05-17 12:14:42 +03:00
lapic.c KVM: Add mini-API for vcpu->requests 2010-08-01 10:47:05 +03:00
lapic.h KVM: Add HYPER-V apic access MSRs 2010-03-01 12:36:00 -03:00
Makefile KVM: Move assigned device code to own file 2009-12-03 09:32:09 +02:00
mmu.c KVM: Add mini-API for vcpu->requests 2010-08-01 10:47:05 +03:00
mmu.h KVM: x86 emulator: fix memory access during x86 emulation 2010-03-01 12:36:11 -03:00
mmutrace.h KVM: MMU: split the operations of kvm_mmu_zap_page() 2010-08-01 10:39:27 +03:00
paging_tmpl.h KVM: Remove memory alias support 2010-08-01 10:47:00 +03:00
svm.c KVM: Add mini-API for vcpu->requests 2010-08-01 10:47:05 +03:00
timer.c KVM: Add mini-API for vcpu->requests 2010-08-01 10:47:05 +03:00
trace.h KVM: Trace emulated instructions 2010-05-17 12:17:35 +03:00
tss.h KVM: x86: hardware task switching support 2008-04-27 12:00:39 +03:00
vmx.c KVM: Add mini-API for vcpu->requests 2010-08-01 10:47:05 +03:00
x86.c KVM: x86: Enable AVX for guest 2010-08-01 10:47:10 +03:00
x86.h KVM: Remove memory alias support 2010-08-01 10:47:00 +03:00