mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cao jin <caoj.fnst@cn.fujitsu.com>
To: Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@intel.com>
Cc: <x86@kernel.org>, <linux-kernel@vger.kernel.org>,
	<tglx@linutronix.de>, <mingo@redhat.com>, <hpa@zytor.com>
Subject: Re: [PATCH] x86/cpufeature: drop *_MASK_CEHCK
Date: Wed, 28 Aug 2019 11:10:16 +0800	[thread overview]
Message-ID: <6b7de083-4901-6a72-8d89-75ea3456ffb8@cn.fujitsu.com> (raw)
In-Reply-To: <20190827172015.GH29752@zn.tnic>

On 8/28/19 1:20 AM, Borislav Petkov wrote:
> 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.
> 

A subtle issue hard to detect by eyes.  Sure, on the way.
-- 
Sincerely,
Cao jin



      reply	other threads:[~2019-08-28  3:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-27  7:05 Cao jin
2019-08-27  7:41 ` Borislav Petkov
2019-08-27 16:33   ` Dave Hansen
2019-08-27 17:20     ` Borislav Petkov
2019-08-28  3:10       ` Cao jin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6b7de083-4901-6a72-8d89-75ea3456ffb8@cn.fujitsu.com \
    --to=caoj.fnst@cn.fujitsu.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®