public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] linux-2.4.20-pre11_clustered-apic-tweaks_A0
@ 2002-10-16 23:02 john stultz
  2002-10-17  0:05 ` [PATCH] linux-2.4.20-pre11_summit_A0 (1/3 - cleanups) john stultz
  0 siblings, 1 reply; 4+ messages in thread
From: john stultz @ 2002-10-16 23:02 UTC (permalink / raw)
  To: marcelo; +Cc: Martin J. Bligh, James, lkml

Marcelo, all, 

	Originally I was going to send a larger patch that had the rest of the
needed changes for summit, but I've gone through and split that up even
more. This is similar to the earlier cleanup I sent you (although this
one compiles & boots on UP properly :), and just moves some code around
in preparation for further changes. 

	Again,  this code originally comes from James Cleverdon's summit patch,
which I have been chopping/crushing/blending up into hopefully more
easily digestible pieces. Thus I deserve none of the credit, and all the
blame for this. 

please consider for acceptance.

thanks
-john

diff -Nru a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c
--- a/arch/i386/kernel/apic.c	Wed Oct 16 15:52:39 2002
+++ b/arch/i386/kernel/apic.c	Wed Oct 16 15:52:39 2002
@@ -261,6 +261,14 @@
 	apic_write_around(APIC_LVT1, value);
 }
 
+static unsigned long calculate_ldr(unsigned long old)
+{
+	unsigned long id;
+	
+	id = 1UL << smp_processor_id();
+	return (old & ~APIC_LDR_MASK)|SET_APIC_LOGICAL_ID(id);
+}
+
 void __init setup_local_APIC (void)
 {
 	unsigned long value, ver, maxlvt;
@@ -304,9 +312,7 @@
 		 * Set up the logical destination ID.
 		 */
 		value = apic_read(APIC_LDR);
-		value &= ~APIC_LDR_MASK;
-		value |= (1<<(smp_processor_id()+24));
-		apic_write_around(APIC_LDR, value);
+		apic_write_around(APIC_LDR, calculate_ldr(value));
 	}
 
 	/*
diff -Nru a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
--- a/arch/i386/kernel/io_apic.c	Wed Oct 16 15:52:39 2002
+++ b/arch/i386/kernel/io_apic.c	Wed Oct 16 15:52:39 2002
@@ -1067,7 +1067,7 @@
 		
 		old_id = mp_ioapics[apic].mpc_apicid;
 
-		if (mp_ioapics[apic].mpc_apicid >= 0xf) {
+		if (mp_ioapics[apic].mpc_apicid >= apic_broadcast_id) {
 			printk(KERN_ERR "BIOS bug, IO-APIC#%d ID is %d in the MPC table!...\n",
 				apic, mp_ioapics[apic].mpc_apicid);
 			printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n",
@@ -1086,7 +1086,7 @@
 			for (i = 0; i < 0xf; i++)
 				if (!(phys_id_present_map & (1 << i)))
 					break;
-			if (i >= 0xf)
+			if (i >= apic_broadcast_id)
 				panic("Max APIC ID exceeded!\n");
 			printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n",
 				i);
diff -Nru a/include/asm-i386/smpboot.h b/include/asm-i386/smpboot.h
--- a/include/asm-i386/smpboot.h	Wed Oct 16 15:52:39 2002
+++ b/include/asm-i386/smpboot.h	Wed Oct 16 15:52:39 2002
@@ -41,6 +41,9 @@
 #endif /* CONFIG_X86_IO_APIC */
 #endif /* CONFIG_X86_LOCAL_APIC */
 
+#define apic_broadcast_id (APIC_BROADCAST_ID_APIC)
+
+
 #define TRAMPOLINE_LOW phys_to_virt((clustered_apic_mode == CLUSTERED_APIC_NUMAQ)?0x8:0x467)
 #define TRAMPOLINE_HIGH phys_to_virt((clustered_apic_mode == CLUSTERED_APIC_NUMAQ)?0xa:0x469)
 




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-10-17  3:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-16 23:02 [PATCH] linux-2.4.20-pre11_clustered-apic-tweaks_A0 john stultz
2002-10-17  0:05 ` [PATCH] linux-2.4.20-pre11_summit_A0 (1/3 - cleanups) john stultz
2002-10-17  0:39   ` [PATCH] linux-2.4.20-pre11_summit_A0 (2/3 - XAPIC code) john stultz
2002-10-17  3:54     ` [PATCH] linux-2.4.20-pre11_summit_A0 (3/3 - Integration) john stultz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox