linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: Shuah Khan <skhan@linuxfoundation.org>, <shuah@kernel.org>,
	<linux-kselftest@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Ram Pai <linuxram@us.ibm.com>,
	Sandipan Das <sandipan@linux.ibm.com>,
	"Florian Weimer" <fweimer@redhat.com>,
	"Desnes A. Nunes do Rosario" <desnesn@linux.vnet.ibm.com>,
	Ingo Molnar <mingo@kernel.org>,
	"Thiago Jung Bauermann" <bauerman@linux.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Michal Suchanek <msuchanek@suse.de>, <linux-mm@kvack.org>,
	"Chang S . Bae" <chang.seok.bae@intel.com>,
	Borislav Petkov <bp@suse.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	<x86@kernel.org>, Andy Lutomirski <luto@kernel.org>
Subject: Re: [PATCH 0/3] selftests: Remove duplicate CPUID wrappers
Date: Fri, 4 Feb 2022 16:11:14 -0800	[thread overview]
Message-ID: <c61a227e-e35e-55a8-3571-6e015e222d5f@intel.com> (raw)
In-Reply-To: <81df8c0e-fde6-f3b8-f988-b539f193635b@linuxfoundation.org>

Hi Shuah,

On 2/4/2022 3:39 PM, Shuah Khan wrote:
> On 2/4/22 12:17 PM, Reinette Chatre wrote:
>> A few tests that require running CPUID do so with a private
>> implementation of a wrapper for CPUID. This duplication of
>> the CPUID wrapper should be avoided but having one is also
>> unnecessary because of the existence of a macro that can
>> be used instead.
>>
>> This series replaces private CPUID wrappers with calls
>> to the __cpuid_count() macro from cpuid.h as made available
>> by gcc and clang/llvm.
>>
>> Cc: Dave Hansen <dave.hansen@linux.intel.com>
>> Cc: Ram Pai <linuxram@us.ibm.com>
>> Cc: Sandipan Das <sandipan@linux.ibm.com>
>> Cc: Florian Weimer <fweimer@redhat.com>
>> Cc: "Desnes A. Nunes do Rosario" <desnesn@linux.vnet.ibm.com>
>> Cc: Ingo Molnar <mingo@kernel.org>
>> Cc: Thiago Jung Bauermann <bauerman@linux.ibm.com>
>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>> Cc: Michal Suchanek <msuchanek@suse.de>
>> Cc: linux-mm@kvack.org
>> Cc: Chang S. Bae <chang.seok.bae@intel.com>
>> Cc: Borislav Petkov <bp@suse.de>
>> Cc: Thomas Gleixner <tglx@linutronix.de>
>> Cc: Ingo Molnar <mingo@redhat.com>
>> Cc: "H. Peter Anvin" <hpa@zytor.com>
>> Cc: x86@kernel.org
>> Cc: Andy Lutomirski <luto@kernel.org>
>>
>> Reinette Chatre (3):
>>    selftests/vm/pkeys: Use existing __cpuid_count() macro
>>    selftests/x86/amx: Use existing __cpuid_count() macro
>>    selftests/x86/corrupt_xstate_header: Use existing __cpuid_count()
>>      macro
>>
>>   tools/testing/selftests/vm/pkey-x86.h         | 22 +++---------------
>>   tools/testing/selftests/x86/amx.c             | 23 +++++--------------
>>   .../selftests/x86/corrupt_xstate_header.c     | 17 ++------------
>>   3 files changed, 11 insertions(+), 51 deletions(-)
>>
> 
> I am all for this cleanup. However, I am not finding __cpuid_count()
> marco on my system with gcc:
> 
> gcc --version
> gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0
> 
> My concern is regression on older gcc versions.

Please see this message from our earlier thread where you were able
to find it on your system:
https://lore.kernel.org/linux-kselftest/63293c72-55ca-9446-35eb-74aff4c8ba5d@linuxfoundation.org/

As mentioned in that thread, on my system it arrived via user space's
libgcc-dev package. This does not seem to be the first time including
files from this source - I did a quick check and from what I can tell
existing kselftest includes like stdarg.h, stdbool.h, stdatomic.h,
unwind.h, x86intrin.h ... arrive via libgcc-dev.

Reinette


  reply	other threads:[~2022-02-05  0:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-04 19:17 [PATCH 0/3] selftests: Remove duplicate CPUID wrappers Reinette Chatre
2022-02-04 19:17 ` [PATCH 1/3] selftests/vm/pkeys: Use existing __cpuid_count() macro Reinette Chatre
2022-02-04 23:39 ` [PATCH 0/3] selftests: Remove duplicate CPUID wrappers Shuah Khan
2022-02-05  0:11   ` Reinette Chatre [this message]
2022-02-07 18:00     ` Shuah Khan
2022-02-07 19:13       ` Reinette Chatre

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=c61a227e-e35e-55a8-3571-6e015e222d5f@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=bauerman@linux.ibm.com \
    --cc=bp@suse.de \
    --cc=chang.seok.bae@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=desnesn@linux.vnet.ibm.com \
    --cc=fweimer@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxram@us.ibm.com \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=msuchanek@suse.de \
    --cc=sandipan@linux.ibm.com \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --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;
as well as URLs for NNTP newsgroup(s).