Re: MCE, AMD: Hide smp-only code around CONFIG_SMP

From: Borislav Petkov
Date: Wed Feb 08 2012 - 08:05:53 EST


On Wed, Feb 08, 2012 at 08:22:11AM -0400, Kevin Winchester wrote:
> Does this work? arch/x86/kernel/cpu/mcheck/mce_amd.c includes
> <linux/smp.h> rather than <asm/smp.h> directly. And <linux/smp.h>
> only includes <asm/smp.h> for the CONFIG_SMP case. Or perhaps one of
> the other includes in mce_amd.c includes <asm/smp.h>?

It looks like it:

$ make arch/x86/kernel/cpu/mcheck/mce_amd.i
$ grep 'asm/smp.h' arch/x86/kernel/cpu/mcheck/mce_amd.i
# 1 "/home/boris/kernel/linux-2.6/arch/x86/include/asm/smp.h" 1
# 13 "/home/boris/kernel/linux-2.6/arch/x86/include/asm/smp.h"
# 14 "/home/boris/kernel/linux-2.6/arch/x86/include/asm/smp.h" 2
# 16 "/home/boris/kernel/linux-2.6/arch/x86/include/asm/smp.h" 2

and this one pulls in the cpu_llc* crap.

# 183 "/home/boris/kernel/linux-2.6/arch/x86/include/asm/smp.h"
# 225 "/home/boris/kernel/linux-2.6/arch/x86/include/asm/smp.h"
# 236 "/home/boris/kernel/linux-2.6/arch/x86/include/asm/smp.h"

So some other headers seem to pull in asm/smp.h.

HTH.

--
Regards/Gruss,
Boris.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/