lkml.org 
[lkml]   [2007]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] [39/50] i386: fix 4 bit apicid assumption of mach-default
    Date

    From: "Siddha, Suresh B" <suresh.b.siddha@intel.com>

    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>
    Signed-off-by: Andi Kleen <ak@suse.de>
    Cc: Andi Kleen <ak@suse.de>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    ---

    include/asm-i386/mach-default/mach_apicdef.h | 8 +++++++-
    1 file changed, 7 insertions(+), 1 deletion(-)

    Index: linux/include/asm-i386/mach-default/mach_apicdef.h
    ===================================================================
    --- linux.orig/include/asm-i386/mach-default/mach_apicdef.h
    +++ linux/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)
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2007-09-22 00:49    [W:5.037 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site