diff -Naurp -X /home/jbarnes/dontdiff 240-qla2xxx-driver.patch/arch/ia64/kernel/head.S 250-spinlock-profiling-hack.patch/arch/ia64/kernel/head.S
--- 240-qla2xxx-driver.patch/arch/ia64/kernel/head.S	Tue Dec 30 16:38:56 2003
+++ 250-spinlock-profiling-hack.patch/arch/ia64/kernel/head.S	Wed Dec 31 12:26:41 2003
@@ -888,6 +888,8 @@ GLOBAL_ENTRY(ia64_spinlock_contention_pr
 	cmp4.eq p14,p0=r30,r0
 (p14)	br.cond.sptk.few b6	// lock is now free, try to acquire
 	br.cond.sptk.few .wait
+	.global ia64_spinlock_contention_pre3_4_end    // for kernprof
+ia64_spinlock_contention_pre3_4_end:
 END(ia64_spinlock_contention_pre3_4)
 
 #else
diff -Naurp -X /home/jbarnes/dontdiff 240-qla2xxx-driver.patch/arch/ia64/kernel/irq.c 250-spinlock-profiling-hack.patch/arch/ia64/kernel/irq.c
--- 240-qla2xxx-driver.patch/arch/ia64/kernel/irq.c	Tue Dec 30 16:39:48 2003
+++ 250-spinlock-profiling-hack.patch/arch/ia64/kernel/irq.c	Wed Dec 31 12:26:41 2003
@@ -1058,7 +1058,7 @@ static void register_irq_proc (unsigned 
 #endif
 }
 
-cpumask_t prof_cpu_mask = CPU_MASK_ALL;
+cpumask_t prof_cpu_mask;
 
 void init_irq_proc (void)
 {
diff -Naurp -X /home/jbarnes/dontdiff 240-qla2xxx-driver.patch/arch/ia64/kernel/time.c 250-spinlock-profiling-hack.patch/arch/ia64/kernel/time.c
--- 240-qla2xxx-driver.patch/arch/ia64/kernel/time.c	Tue Dec 30 16:39:50 2003
+++ 250-spinlock-profiling-hack.patch/arch/ia64/kernel/time.c	Wed Dec 31 12:26:41 2003
@@ -202,6 +202,9 @@ ia64_do_profile (struct pt_regs * regs)
 {
 	unsigned long ip, slot;
 	extern cpumask_t prof_cpu_mask;
+#ifdef CONFIG_SMP
+	extern char ia64_spinlock_contention_pre3_4[], ia64_spinlock_contention_pre3_4_end[];
+#endif
 
 	profile_hook(regs);
 
@@ -216,7 +219,14 @@ ia64_do_profile (struct pt_regs * regs)
 	 * bits 2 and 3 rather than bits 0 and 1.
 	 */
 	slot = ip & 3;
-	ip = (ip & ~3UL) + 4*slot;
+	ip = (ip & ~3UL);
+#ifdef CONFIG_SMP
+	if (ip >= (unsigned long)ia64_spinlock_contention_pre3_4 &&
+			ip < (unsigned long)ia64_spinlock_contention_pre3_4_end)
+		ip = regs->r28;
+	else
+#endif
+	ip += 4*slot;
 
 	/*
 	 * Only measure the CPUs specified by /proc/irq/prof_cpu_mask.
