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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 14 Jun 2010 14:33:42 +0200
From:	Hans Rosenfeld <hans.rosenfeld@....com>
To:	"H. Peter Anvin" <hpa@...or.com>
CC:	"mingo@...hat.com" <mingo@...hat.com>,
	"tglx@...utronix.de" <tglx@...utronix.de>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] AMD errata checking framework

On Fri, Jun 11, 2010 at 04:14:31PM -0400, H. Peter Anvin wrote:
> On 06/11/2010 06:25 AM, Hans Rosenfeld wrote:
> > +
> > +/*
> > + * Check for the presence of an AMD erratum.
> > + * Arguments are defined in processor.h for each known erratum.
> > + */
> > +bool cpu_has_amd_erratum(const struct cpuinfo_x86 *cpu, bool osvw, ...)
> > +{
> 
> /home/hpa/kernel/linux-2.6-tip.cpu/arch/x86/kernel/cpu/amd.c: In
> function ?cpu_has_amd_erratum?:
> /home/hpa/kernel/linux-2.6-tip.cpu/arch/x86/kernel/cpu/amd.c:635: error:
> expected expression before ?do?
> /home/hpa/kernel/linux-2.6-tip.cpu/arch/x86/kernel/cpu/amd.c:636: error:
> expected expression before ?do?
> /home/hpa/kernel/linux-2.6-tip.cpu/arch/x86/kernel/cpu/amd.c:632:
> warning: unused variable ?t?

Umpf. It seems like I underestimated the brokenness of rdmsrl() etc..
A new patch set will follow shortly. I also added va_end() calls where
necessary and replaced static_cpu_has() with cpu_has().

> Also, the use of divide and modulo when shifts and masks work are
> generally frowned upon in Linux as a matter of style.

While I agree in principle, I think that in this special case the
divide and modulo by 64 make it easier to understand what the code
does on the first look. But if you insist I will send another patch
set that replaces divide and modulo with shifts and masks.


Hans


-- 
%SYSTEM-F-ANARCHISM, The operating system has been overthrown

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ