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]
Message-ID: <20190827172015.GH29752@zn.tnic>
Date:   Tue, 27 Aug 2019 19:20:15 +0200
From:   Borislav Petkov <bp@...en8.de>
To:     Dave Hansen <dave.hansen@...el.com>
Cc:     Cao jin <caoj.fnst@...fujitsu.com>, x86@...nel.org,
        linux-kernel@...r.kernel.org, tglx@...utronix.de, mingo@...hat.com,
        hpa@...or.com
Subject: Re: [PATCH] x86/cpufeature: drop *_MASK_CEHCK

On Tue, Aug 27, 2019 at 09:33:11AM -0700, Dave Hansen wrote:
> The point was that there are 5 files in the code that need to be changed
> if you change NCAPINTS:
> 
> 1. arch/x86/include/asm/required-features.h
> 2. arch/x86/include/asm/disabled-features.h
> 3. tools/arch/x86/include/asm/disabled-features.h
> 4. tools/arch/x86/include/asm/required-features.h
> 5. arch/x86/include/asm/cpufeature.h (2 sites)
> 
> Each of those sites has a compile-time check for NCAPINTS.  The problem
> is that the *-features.h code doesn't get compiled directly so a
> BUILD_BUG_ON() doesn't work by itself.  So, for the sites there, we put
> it somewhere that *will* get compiled: the macros that actually check
> the bits.
> 
> It looks weird, but the end effect is good: If you change NCAPINTS, you
> get compile errors in 5 files and have to go edit those 5 files to fix
> it.  Your patch makes it easier to introduce errors and miss one of
> those sites.

... and we wouldn't want to debug any strange bugs from missing a case.
So, Cao, I wouldn't mind having the gist of that above somewhere around
there in a comment explicitly.

Thx.

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ