DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Yonghao Li <cruselee1@live.cn>
Cc: <thomas@monjalon.net>, <konstantin.ananyev@huawei.com>,
	<dev@dpdk.org>, <stable@dpdk.org>
Subject: Re: [PATCH] eal/x86: fix LZCNT CPU feature bit
Date: Mon, 31 Aug 2026 09:02:45 +0100	[thread overview]
Message-ID: <apU1JV-ays2oJDgZ@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <OSZPR01MB8612B5D71DC37D3A5F2D428DE0AC2@OSZPR01MB8612.jpnprd01.prod.outlook.com>

On Fri, Aug 28, 2026 at 09:32:52PM +0100, Yonghao Li wrote:
> LZCNT support is enumerated by CPUID.80000001H:ECX[5]. The current
> definition checks ECX bit 4, which identifies CR8 legacy mode on AMD
> processors and is reserved on Intel processors. As a result,
> RTE_CPUFLAG_LZCNT can be reported incorrectly.
> 
> Check ECX bit 5 instead.
> 
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
> Signed-off-by: Yonghao Li <cruselee1@live.cn>
> ---
>  .mailmap                   | 1 +
>  lib/eal/x86/rte_cpuflags.c | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/.mailmap b/.mailmap
> index fcb3d1bb3f..fad671fbe9 100644
> --- a/.mailmap
> +++ b/.mailmap
> @@ -1933,6 +1933,7 @@ Yong Wang <wang.yong19@zte.com.cn> <yongwang@vmware.com>
>  Yong Xu <yong.xu@corigine.com>
>  Yong Zhang <zhang.yong25@zte.com.cn>
>  Yongfeng Wang <mannywang@tencent.com>
> +Yonghao Li <cruselee1@live.cn>
>  Yongji Xie <xieyongji@baidu.com>
>  Yongjie Gu <yongjiex.gu@intel.com>
>  Yongping Zhang <yongping.zhang@broadcom.com>
> diff --git a/lib/eal/x86/rte_cpuflags.c b/lib/eal/x86/rte_cpuflags.c
> index 5d1f352e04..80b71a3ce0 100644
> --- a/lib/eal/x86/rte_cpuflags.c
> +++ b/lib/eal/x86/rte_cpuflags.c
> @@ -137,7 +137,7 @@ struct feature_entry rte_cpu_feature_table[] = {
>  	FEAT_DEF(AVX512VP2INTERSECT, 0x00000007, 0, RTE_REG_EDX,  8)
>  
>  	FEAT_DEF(LAHF_SAHF, 0x80000001, 0, RTE_REG_ECX,  0)
> -	FEAT_DEF(LZCNT, 0x80000001, 0, RTE_REG_ECX,  4)
> +	FEAT_DEF(LZCNT, 0x80000001, 0, RTE_REG_ECX,  5)
>  	FEAT_DEF(MONITORX, 0x80000001, 0, RTE_REG_ECX,  29)
>  

Confirmed by checking Table 21-90 in the Intel SDM Vol 1 docs. Thanks for
catching this.

Acked-by: Bruce Richardson <bruce.richardson@intel.com>


      parent reply	other threads:[~2026-08-31  8:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28 20:32 [PATCH] eal/x86: fix LZCNT CPU feature bit Yonghao Li
2026-08-31  7:51 ` David Marchand
2026-08-31  8:02 ` Bruce Richardson [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=apU1JV-ays2oJDgZ@bricha3-mobl1.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=cruselee1@live.cn \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@huawei.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /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