From: Shuah Khan <skhan@linuxfoundation.org>
To: Reinette Chatre <reinette.chatre@intel.com>,
shuah@kernel.org, linux-kselftest@vger.kernel.org
Cc: dave.hansen@linux.intel.com, sandipan@linux.ibm.com,
fweimer@redhat.com, desnesn@linux.vnet.ibm.com, mingo@kernel.org,
bauerman@linux.ibm.com, mpe@ellerman.id.au, msuchanek@suse.de,
linux-mm@kvack.org, chang.seok.bae@intel.com, bp@suse.de,
tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
luto@kernel.org, x86@kernel.org,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH V3 0/4] selftests: Remove duplicate CPUID wrappers
Date: Mon, 25 Apr 2022 15:08:52 -0600 [thread overview]
Message-ID: <c34b6dd7-fbae-3105-a8a9-c18957dc7ca2@linuxfoundation.org> (raw)
In-Reply-To: <cover.1650918160.git.reinette.chatre@intel.com>
On 4/25/22 3:01 PM, Reinette Chatre wrote:
> Changes since V2:
> - V2: https://lore.kernel.org/lkml/cover.1647360971.git.reinette.chatre@intel.com/
> - Rebased against v5.18-rc4, no functional changes.
> - Add text in cover letter and first patch to highlight that
> the __cpuid_count() macro provided is not a new implementation but
> copied from gcc.
>
> Changes since V1:
> - V1: https://lore.kernel.org/lkml/cover.1644000145.git.reinette.chatre@intel.com/
> - Change solution to not use __cpuid_count() from compiler's
> cpuid.h but instead use a local define of __cpuid_count()
> provided in kselftest.h to ensure tests continue working
> in all supported environments. (Shuah)
> - Rewrite cover letter and changelogs to reflect new solution.
>
> 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.
>
> Both gcc and clang/LLVM provide wrappers for CPUID but
> the wrappers are not available in the minimal required
> version of gcc, v3.2, that the selftests need to be used
> in. __cpuid_count() was added to gcc in v4.4, which is ok for
> kernels after v4.19 when the gcc minimal required version
> was changed to v4.6.
>
> Copy gcc's __cpuid_count() to provide a local define of
> __cpuid_count() to kselftest.h to ensure that selftests can
> still work in environments with older stable kernels (v4.9
> and v4.14 that have the minimal required version of gcc of
> v3.2). Update tests with private CPUID wrappers to use the
> new macro.
>
> Cc: Dave Hansen <dave.hansen@linux.intel.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 (4):
> selftests: Provide local define of __cpuid_count()
> selftests/vm/pkeys: Use provided __cpuid_count() macro
> selftests/x86/amx: Use provided __cpuid_count() macro
> selftests/x86/corrupt_xstate_header: Use provided __cpuid_count()
> macro
>
> tools/testing/selftests/kselftest.h | 15 ++++++++++++
> tools/testing/selftests/vm/pkey-x86.h | 21 ++--------------
> tools/testing/selftests/x86/amx.c | 24 ++++++-------------
> .../selftests/x86/corrupt_xstate_header.c | 16 ++-----------
> 4 files changed, 26 insertions(+), 50 deletions(-)
>
>
> base-commit: af2d861d4cd2a4da5137f795ee3509e6f944a25b
>
Thank you. I will queue this up for Linux 5.19-rc1
thanks,
-- Shuah
prev parent reply other threads:[~2022-04-25 21:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-25 21:01 Reinette Chatre
2022-04-25 21:01 ` [PATCH V3 1/4] selftests: Provide local define of __cpuid_count() Reinette Chatre
2022-04-25 21:01 ` [PATCH V3 2/4] selftests/vm/pkeys: Use provided __cpuid_count() macro Reinette Chatre
2022-04-25 21:01 ` [PATCH V3 3/4] selftests/x86/amx: " Reinette Chatre
2022-04-25 21:01 ` [PATCH V3 4/4] selftests/x86/corrupt_xstate_header: " Reinette Chatre
2022-04-25 21:08 ` Shuah Khan [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=c34b6dd7-fbae-3105-a8a9-c18957dc7ca2@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--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-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=msuchanek@suse.de \
--cc=reinette.chatre@intel.com \
--cc=sandipan@linux.ibm.com \
--cc=shuah@kernel.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