* [patch] i386, apic: fix 4 bit apicid assumption of mach-default
@ 2007-08-29 1:29 Siddha, Suresh B
0 siblings, 0 replies; only message in thread
From: Siddha, Suresh B @ 2007-08-29 1:29 UTC (permalink / raw)
To: ak, akpm; +Cc: linux-kernel
Andi/Andrew,
Can you pick this up for your trees and if there are no issues, can you please
push it to mainline before .23 gets released.
We have seen a boot failure with fewer cpu sockets populated on a MP platform.
Similar problem can happen on a fully populated system, if # of cpus <= 8
and any of the apic id's is > 16
thanks,
suresh
---
Fix get_apic_id() in mach-default, so that it uses 8 bits incase of xAPIC case
and 4 bits for legacy APIC case.
This fixes the i386 kernel assumption that apic id is less than 16 for xAPIC
platforms with 8 cpus or less and makes the kernel boot on such platforms.
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---
diff --git a/include/asm-i386/mach-default/mach_apicdef.h b/include/asm-i386/mach-default/mach_apicdef.h
index 7bcb350..ae98413 100644
--- a/include/asm-i386/mach-default/mach_apicdef.h
+++ b/include/asm-i386/mach-default/mach_apicdef.h
@@ -1,11 +1,17 @@
#ifndef __ASM_MACH_APICDEF_H
#define __ASM_MACH_APICDEF_H
+#include <asm/apic.h>
+
#define APIC_ID_MASK (0xF<<24)
static inline unsigned get_apic_id(unsigned long x)
{
- return (((x)>>24)&0xF);
+ unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR));
+ if (APIC_XAPIC(ver))
+ return (((x)>>24)&0xFF);
+ else
+ return (((x)>>24)&0xF);
}
#define GET_APIC_ID(x) get_apic_id(x)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-08-29 1:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-29 1:29 [patch] i386, apic: fix 4 bit apicid assumption of mach-default Siddha, Suresh B
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox