All of lore.kernel.org
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: Xiaochen Shen <shenxiaochen@open-hieco.net>,
	<tony.luck@intel.com>, <bp@alien8.de>, <fenghuay@nvidia.com>
Cc: <babu.moger@amd.com>, <james.morse@arm.com>,
	<Dave.Martin@arm.com>, <x86@kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] selftests/resctrl: Add CPU vendor detection for Hygon
Date: Thu, 4 Dec 2025 15:48:18 -0800	[thread overview]
Message-ID: <06157ac8-d84b-4887-a7e8-50fe5909febe@intel.com> (raw)
In-Reply-To: <20251204123816.2802393-2-shenxiaochen@open-hieco.net>

Hi Xiaochen,

On 12/4/25 4:38 AM, Xiaochen Shen wrote:
> The resctrl selftest currently fails on Hygon CPUs that support Platform
> QoS features, printing the error:
> 
>   "# Can not get vendor info..."
> 
> This occurs because vendor detection is missing for Hygon CPUs.
> 
> Fix this by extending the CPU vendor detection logic to include
> Hygon's vendor ID.
> 
> Signed-off-by: Xiaochen Shen <shenxiaochen@open-hieco.net>
> ---
>  tools/testing/selftests/resctrl/resctrl.h       | 1 +
>  tools/testing/selftests/resctrl/resctrl_tests.c | 2 ++
>  2 files changed, 3 insertions(+)
> 
> diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h
> index cd3adfc14969..df2a59e0141e 100644
> --- a/tools/testing/selftests/resctrl/resctrl.h
> +++ b/tools/testing/selftests/resctrl/resctrl.h
> @@ -38,6 +38,7 @@
>   */
>  #define ARCH_INTEL     1
>  #define ARCH_AMD       2
> +#define ARCH_HYGON     3

The comment before these defines attempts to provide guidance but it is clearly still
quite subtle that these values are required to be unique bits. Consider for example
their usage in test_vendor_specific_check():
	return get_vendor() & test->vendor_specific

This should either be 4 or a better solution is probably to switch all of these to use
BIT() (linux/bits.h is available via tools/include that is already in include path).

Reinette


  reply	other threads:[~2025-12-04 23:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-04 12:38 [PATCH 0/3] selftests/resctrl: Add Hygon CPUs support and bug fixes Xiaochen Shen
2025-12-04 12:38 ` [PATCH 1/3] selftests/resctrl: Add CPU vendor detection for Hygon Xiaochen Shen
2025-12-04 23:48   ` Reinette Chatre [this message]
2025-12-05  7:01     ` Xiaochen Shen
2025-12-04 12:38 ` [PATCH 2/3] selftests/resctrl: Fix a division by zero error on Hygon Xiaochen Shen
2025-12-05  0:56   ` Reinette Chatre
2025-12-05  4:56     ` Xiaochen Shen
2025-12-04 12:38 ` [PATCH 3/3] selftests/resctrl: Fix non-contiguous CBM check for Hygon Xiaochen Shen
2025-12-05  0:55   ` Reinette Chatre
2025-12-05  7:15     ` Xiaochen Shen

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=06157ac8-d84b-4887-a7e8-50fe5909febe@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=Dave.Martin@arm.com \
    --cc=babu.moger@amd.com \
    --cc=bp@alien8.de \
    --cc=fenghuay@nvidia.com \
    --cc=james.morse@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shenxiaochen@open-hieco.net \
    --cc=tony.luck@intel.com \
    --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 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.