mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: john stultz <johnstul@us.ibm.com>
To: marcelo <marcelo@conectiva.com.br>
Cc: lkml <linux-kernel@vger.kernel.org>, James <jamesclv@us.ibm.com>,
	"Martin J. Bligh" <mbligh@aracnet.com>
Subject: [PATCH] linux-2.4.20_summit_A0 (1/4)
Date: 02 Dec 2002 17:02:02 -0800	[thread overview]
Message-ID: <1038877322.6884.24.camel@w-jstultz2.beaverton.ibm.com> (raw)
In-Reply-To: <1038877250.6884.21.camel@w-jstultz2.beaverton.ibm.com>

Marcelo,
	Part 1/4: Clustered apic tweaks

Please apply.

Thanks
-john

diff -Nru a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c
--- a/arch/i386/kernel/apic.c	Mon Dec  2 11:36:17 2002
+++ b/arch/i386/kernel/apic.c	Mon Dec  2 11:36:17 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	Mon Dec  2 11:36:17 2002
+++ b/arch/i386/kernel/io_apic.c	Mon Dec  2 11:36:17 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	Mon Dec  2 11:36:17 2002
+++ b/include/asm-i386/smpboot.h	Mon Dec  2 11:36:17 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)
 





  reply	other threads:[~2002-12-03  0:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-03  1:00 [PATCHSET] linux-2.4.20_summit_A0 (0/4) john stultz
2002-12-03  1:02 ` john stultz [this message]
2002-12-03  1:03   ` [PATCH] linux-2.4.20_summit_A0 (2/4) john stultz
2002-12-03  1:04     ` [PATCH] linux-2.4.20_summit_A0 (3/4) john stultz
2002-12-03  1:05       ` [PATCH] linux-2.4.20_summit_A0 (4/4) john stultz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1038877322.6884.24.camel@w-jstultz2.beaverton.ibm.com \
    --to=johnstul@us.ibm.com \
    --cc=jamesclv@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=mbligh@aracnet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®