diff -urN linux-2.4.21-pre5/arch/i386/kernel/io_apic.c linux-2.4.21-pre5-apic/arch/i386/kernel/io_apic.c --- linux-2.4.21-pre5/arch/i386/kernel/io_apic.c Sat Feb 1 19:42:12 2003 +++ linux-2.4.21-pre5-apic/arch/i386/kernel/io_apic.c Sat Mar 1 09:38:18 2003 @@ -1313,6 +1313,34 @@ static void mask_and_ack_level_ioapic_irq (unsigned int irq) { /* nothing */ } +/* + * This function currently is only a helper for the i386 smp boot process where + * we need to reprogram the ioredtbls to cater for the cpus which have come online + * so mask in all cases should simply be TARGET_CPUS + */ +void __devinit set_ioapic_logical_dest (unsigned long mask) +{ + struct IO_APIC_route_entry entry; + unsigned long flags; + int apic, pin; + + if (skip_ioapic_setup == 1) + return; + + spin_lock_irqsave(&ioapic_lock, flags); + for (apic = 0; apic < nr_ioapics; apic++) { + for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) { + *(((int *)&entry)+0) = io_apic_read(apic, 0x10+pin*2); + *(((int *)&entry)+1) = io_apic_read(apic, 0x11+pin*2); + entry.dest.logical.logical_dest = mask; + io_apic_write(apic, 0x10 + 2 * pin, *(((int *)&entry) + 0)); + io_apic_write(apic, 0x11 + 2 * pin, *(((int *)&entry) + 1)); + } + + } + spin_unlock_irqrestore(&ioapic_lock, flags); +} + static void set_ioapic_affinity (unsigned int irq, unsigned long mask) { unsigned long flags; diff -urN linux-2.4.21-pre5/arch/i386/kernel/smpboot.c linux-2.4.21-pre5-apic/arch/i386/kernel/smpboot.c --- linux-2.4.21-pre5/arch/i386/kernel/smpboot.c Sat Feb 1 19:42:12 2003 +++ linux-2.4.21-pre5-apic/arch/i386/kernel/smpboot.c Sat Mar 1 09:41:38 2003 @@ -971,6 +971,8 @@ extern int prof_old_multiplier[NR_CPUS]; extern int prof_counter[NR_CPUS]; +extern void set_ioapic_logical_dest(unsigned long mask); + static int boot_cpu_logical_apicid; /* Where the IO area was mapped on multiquad, always 0 otherwise */ void *xquad_portio; @@ -1223,5 +1225,6 @@ synchronize_tsc_bp(); smp_done: + set_ioapic_logical_dest(cpu_online_map); zap_low_mappings(); }