All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Jason Andryuk <jandryuk@gmail.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Wei Liu" <wl@xen.org>, "Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH 3/3] x86: short-circuit certain cpu_has_* when x86-64-v{2,3} are in effect
Date: Mon, 17 Jul 2023 15:38:29 +0200	[thread overview]
Message-ID: <40039335-8df7-cda6-c69c-cc94e80cb164@suse.com> (raw)
In-Reply-To: <CAKf6xpt9RTA7sef_QBM=y2gcZURcGzCpU9itUwCD5EPDTtukqA@mail.gmail.com>

On 17.07.2023 14:35, Jason Andryuk wrote:
> On Wed, Jul 12, 2023 at 8:36 AM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> Certain fallback code can be made subject to DCE this way. Note that
>> CX16 has no compiler provided manifest constant, so CONFIG_* are used
>> there instead. Note also that we don't have cpu_has_movbe nor
>> cpu_has_lzcnt (aka cpu_has_abm).
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Reviewed-by: Jason Andryuk <jandryuk@gmail.com>

Thanks.

>> --- a/xen/arch/x86/include/asm/cpufeature.h
>> +++ b/xen/arch/x86/include/asm/cpufeature.h
>> @@ -76,13 +76,19 @@ static inline bool boot_cpu_has(unsigned
>>  #define cpu_has_eist            boot_cpu_has(X86_FEATURE_EIST)
>>  #define cpu_has_ssse3           boot_cpu_has(X86_FEATURE_SSSE3)
>>  #define cpu_has_fma             boot_cpu_has(X86_FEATURE_FMA)
>> -#define cpu_has_cx16            boot_cpu_has(X86_FEATURE_CX16)
>> +#define cpu_has_cx16            (IS_ENABLED(CONFIG_X86_64_V2) || \
>> +                                 IS_ENABLED(CONFIG_X86_64_V3) || \
>> +                                 boot_cpu_has(X86_FEATURE_CX16))
> 
> If you think there may be more ABI selections in the future, it might
> be better to express the "V$N" numerically and check >= 2.  Or you can
> add a Kconfig CONFIG_X86_64_CX16 and select that as appropriate.  But
> if there aren't going to be more of these, then this is fine.

I was thinking this same way: If more appear (which aren't SIMD-only,
like v4 is), we can use a numeric CONFIG_*, but for now it's good
enough (and slightly simpler) this way.

Jan


  reply	other threads:[~2023-07-17 13:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12 12:32 [PATCH 0/3] x86: allow Kconfig control over psABI level Jan Beulich
2023-07-12 12:33 ` [PATCH 1/3] " Jan Beulich
2023-07-12 13:01   ` Jan Beulich
2023-07-17 12:23   ` Jason Andryuk
2023-07-17 13:35     ` Jan Beulich
2023-07-18  6:08   ` Jan Beulich
2023-07-12 12:34 ` [PATCH 2/3] x86: use POPCNT for hweight<N>() when available Jan Beulich
2023-07-17 12:30   ` Jason Andryuk
2023-07-12 12:35 ` [PATCH 3/3] x86: short-circuit certain cpu_has_* when x86-64-v{2,3} are in effect Jan Beulich
2023-07-17 12:35   ` Jason Andryuk
2023-07-17 13:38     ` Jan Beulich [this message]
2023-07-12 14:25 ` [PATCH 0.5/3] build: make cc-option properly deal with unrecognized sub-options Jan Beulich
2023-07-12 14:26 ` Jan Beulich
2023-07-18 14:09   ` Jan Beulich

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=40039335-8df7-cda6-c69c-cc94e80cb164@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jandryuk@gmail.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.