Re: [PATCH v4] x86: under bios control, restore AP's APIC_LVTTHMRto the BSP value

From: Borislav Petkov
Date: Mon Nov 09 2009 - 08:23:36 EST


On Mon, Nov 09, 2009 at 08:10:05PM +0800, Yong Wang wrote:
> > > + mcheck_init();
> >
> > I think you need
> >
> > #ifdef CONFIG_X86_MCE
> > ...
> > #endif
> >
> > here for cases where mcheck is config-disabled, no?
> >
>
> Petkov, thanks for the review. Part of my patch is as below. Does this
> resolve your concern?

Sorry, my comment was wrong. I remember seeing "#ifdef CONFIG_X86_MCE...
#endif" around mcheck_cpu_init(), that's why I asked. Anyways, with
CONFIG_X86_MCE disabled I still get

...
/home/boris/kernel/linux-2.6/arch/x86/include/asm/mce.h:126: warning: âmcheck_initâ defined but not used
CC arch/x86/ia32/audit.o
AS arch/x86/kernel/entry_64.o
CC arch/x86/kernel/traps.o
LD arch/x86/ia32/built-in.o
LD arch/x86/kvm/built-in.o
CC [M] arch/x86/kvm/svm.o
/home/boris/kernel/linux-2.6/arch/x86/include/asm/mce.h:126: warning: âmcheck_initâ defined but not used
CC arch/x86/kernel/irq.o
/home/boris/kernel/linux-2.6/arch/x86/include/asm/mce.h:126: warning: âmcheck_initâ defined but not used
...


which should be fixed IMHO by inlining mcheck_init() like
mcheck_cpu_init(). And while we're at it, we should remove the #ifdef's
around mcheck_cpu_init() in identify_cpu() since they're not needed.

> diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
> index 161485d..41d8e42 100644
> --- a/arch/x86/include/asm/mce.h
> +++ b/arch/x86/include/asm/mce.h
> @@ -120,8 +120,10 @@ extern int mce_disabled;
> extern int mce_p5_enabled;
>
> #ifdef CONFIG_X86_MCE
> +int mcheck_init(void);
> void mcheck_cpu_init(struct cpuinfo_x86 *c);
> #else
> +static int mcheck_init(void) { return 0; }
> static inline void mcheck_cpu_init(struct cpuinfo_x86 *c) {}
> #endif

Thanks.

--
Regards/Gruss,
Boris.

Operating | Advanced Micro Devices GmbH
System | Karl-Hammerschmidt-Str. 34, 85609 Dornach b. MÃnchen, Germany
Research | GeschÃftsfÃhrer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni
Center | Sitz: Dornach, Gemeinde Aschheim, Landkreis MÃnchen
(OSRC) | Registergericht MÃnchen, HRB Nr. 43632

--
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/