[PATCH] x86_64: ioapic virtual wire mode fix

o Currently, during kexec reboot, IOAPIC is re-programmed back to virtual
wire mode if there was an i8259 connected to it. This enables getting
timer interrupts in second kernel in legacy mode.

o After putting into virtual wire mode, IOAPIC delivers the i8259 interrupts
to CPU0. This works well for kexec but not for kdump as we might crash
on a different CPU and second kernel will not see timer interrupts.

o This patch modifies the redirection table entry to deliver the timer
interrupts to the cpu we are rebooting (instead of hardcoding to zero).
This ensures that second kernel receives timer interrupts even on a
non-boot cpu.

Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Vivek Goyal and committed by Linus Torvalds af5b9804 79f12614

+2 -1
+2 -1
arch/x86_64/kernel/io_apic.c
··· 1307 1307 entry.dest_mode = 0; /* Physical */ 1308 1308 entry.delivery_mode = dest_ExtINT; /* ExtInt */ 1309 1309 entry.vector = 0; 1310 - entry.dest.physical.physical_dest = 0; 1310 + entry.dest.physical.physical_dest = 1311 + GET_APIC_ID(apic_read(APIC_ID)); 1311 1312 1312 1313 /* 1313 1314 * Add it to the IO-APIC irq-routing table: