lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 9 Nov 2009 14:23:38 +0100
From:	Borislav Petkov <borislav.petkov@....com>
To:	Yong Wang <yong.y.wang@...ux.intel.com>
CC:	Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Suresh Siddha <suresh.b.siddha@...el.com>,
	Arjan van de Ven <arjan@...radead.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4] x86: under bios control, restore AP's APIC_LVTTHMR
 to the BSP value

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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists