mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nikolay Borisov <nik.borisov@suse.com>
To: Borislav Petkov <bp@kernel.org>, X86 ML <x86@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"Borislav Petkov (AMD)" <bp@alien8.de>
Subject: Re: [PATCH] x86/cpu: Hide and rename static_cpu_has()
Date: Mon, 22 Jun 2026 01:13:22 +0300	[thread overview]
Message-ID: <34d9fd50-0e35-4dae-8610-4caba75e76c3@suse.com> (raw)
In-Reply-To: <20260620015041.336288-1-bp@kernel.org>



On 20.06.26 г. 4:50 ч., Borislav Petkov wrote:
> From: "Borislav Petkov (AMD)" <bp@alien8.de>
> 
> cpu_feature_enabled() is the one to use to test feature flags so hide
> the static thing which doesn't pay attention to disabled mask bits
> anyway.
> 
> Use the following command to do the replacement:
> 
>    $ git grep --files-with-matches -w static_cpu_has -- ':(exclude)*cpufeature.h' \
>    | xargs sed -i 's/static_cpu_has(/cpu_feature_enabled\(/g'
> 
> There should be no functional changes resulting from this.
> 
> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>

static_cpu_has is generally used in performance critical parts of the 
code. Your change basically adds a __builtin_constant_p() && 
DISABLED_MASK check which only evaluate during compile time so from a 
perf point of view this shouldn't bring any negative effects.


Reviewed-by: Nikolay Borisov <nik.borisov@suse.com>

  reply	other threads:[~2026-06-21 22:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-20  1:50 Borislav Petkov
2026-06-21 22:13 ` Nikolay Borisov [this message]
2026-06-22  0:19   ` Borislav Petkov
2026-07-07 16:12 ` [tip: x86/cpu] " tip-bot2 for Borislav Petkov (AMD)

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=34d9fd50-0e35-4dae-8610-4caba75e76c3@suse.com \
    --to=nik.borisov@suse.com \
    --cc=bp@alien8.de \
    --cc=bp@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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

Powered by JetHome