Skip to contentSkip to conversation

i386 dynamic fixup SMP workaround

PATCH New Luca Barbieri 1 participant 1 message Aug 28, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i386 dynamic fixup SMP workaround

This code implements the send-IPIs-to-lock-everyone-else workaround that allows the code to run on Intel P6 processors.
Currently the code is enabled on all SMP systems since reliably determining whether a given processor is broken or not is hard. This may be changed in future.
Note that due to lack of suitable hardware, the SMP part has not been tested.

I'd like to now whether this whole idea of self modifying code has some hope of being accepted or not.

If no serious problems are raised and no notices of unacceptability are made, I'll proceed to send the CPU selection patch and, after that, the final patch that implements both things all over the tree.

BTW the CPU selection patch changes the interface so that each CPU has its own y/n switch and the kernel automagically chooses the best options for the set of selected CPUs. This is a wholly different issue that will be explained in depth in the message including the patch.

arch/i386/kernel/entry.S +1 -0
diff --exclude-from=/home/ldb/src/linux-exclude -urNdp linux-2.5.32_fixup/arch/i386/kernel/entry.S linux-2.5.32_fixup_smp/arch/i386/kernel/entry.S
@@ -353,6 +353,7 @@ ENTRY(name)				\
 BUILD_INTERRUPT(reschedule_interrupt,RESCHEDULE_VECTOR)
 BUILD_INTERRUPT(invalidate_interrupt,INVALIDATE_TLB_VECTOR)
 BUILD_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR)
+BUILD_INTERRUPT(dynamic_fixup_smp_lock_interrupt, DYNAMIC_FIXUP_SMP_LOCK_VECTOR)
 #endif
 
 /*
arch/i386/kernel/fixup.c +135 -4

166 lines not on this page · raw message

arch/i386/kernel/i8259.c +3 -0
diff --exclude-from=/home/ldb/src/linux-exclude -urNdp linux-2.5.32_fixup/arch/i386/kernel/i8259.c linux-2.5.32_fixup_smp/arch/i386/kernel/i8259.c
@@ -407,6 +407,9 @@ void __init init_IRQ(void)
 
 	/* IPI for generic function call */
 	set_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt);
+
+	/* IPI for smp lock by dynamic fixup code */
+	set_intr_gate(DYNAMIC_FIXUP_SMP_LOCK_VECTOR, dynamic_fixup_smp_lock_interrupt);
 #endif	
 
 #ifdef CONFIG_X86_LOCAL_APIC
include/asm-i386/hw_irq.h +1 -0
diff --exclude-from=/home/ldb/src/linux-exclude -urNdp linux-2.5.32_fixup/include/asm-i386/hw_irq.h linux-2.5.32_fixup_smp/include/asm-i386/hw_irq.h
@@ -32,6 +32,7 @@ extern void (*interrupt[NR_IRQS])(void);
 extern asmlinkage void reschedule_interrupt(void);
 extern asmlinkage void invalidate_interrupt(void);
 extern asmlinkage void call_function_interrupt(void);
+extern asmlinkage void dynamic_fixup_smp_lock_interrupt(void);
 #endif
 
 #ifdef CONFIG_X86_LOCAL_APIC
include/asm-i386/irq_vectors.h +2 -1
diff --exclude-from=/home/ldb/src/linux-exclude -urNdp linux-2.5.32_fixup/include/asm-i386/irq_vectors.h linux-2.5.32_fixup_smp/include/asm-i386/irq_vectors.h
@@ -27,8 +27,9 @@
 #define INVALIDATE_TLB_VECTOR	0xfd
 #define RESCHEDULE_VECTOR	0xfc
 #define CALL_FUNCTION_VECTOR	0xfb
+#define DYNAMIC_FIXUP_SMP_LOCK_VECTOR	0xfa
 
-#define DYNAMIC_FIXUP_VECTOR	0xfa
+#define DYNAMIC_FIXUP_VECTOR	0xf1
 
 #define THERMAL_APIC_VECTOR	0xf0
 /*