lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c61a227e-e35e-55a8-3571-6e015e222d5f@intel.com>
Date:   Fri, 4 Feb 2022 16:11:14 -0800
From:   Reinette Chatre <reinette.chatre@...el.com>
To:     Shuah Khan <skhan@...uxfoundation.org>, <shuah@...nel.org>,
        <linux-kselftest@...r.kernel.org>
CC:     <linux-kernel@...r.kernel.org>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Ram Pai <linuxram@...ibm.com>,
        Sandipan Das <sandipan@...ux.ibm.com>,
        "Florian Weimer" <fweimer@...hat.com>,
        "Desnes A. Nunes do Rosario" <desnesn@...ux.vnet.ibm.com>,
        Ingo Molnar <mingo@...nel.org>,
        "Thiago Jung Bauermann" <bauerman@...ux.ibm.com>,
        Michael Ellerman <mpe@...erman.id.au>,
        Michal Suchanek <msuchanek@...e.de>, <linux-mm@...ck.org>,
        "Chang S . Bae" <chang.seok.bae@...el.com>,
        Borislav Petkov <bp@...e.de>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>, <x86@...nel.org>,
        Andy Lutomirski <luto@...nel.org>
Subject: Re: [PATCH 0/3] selftests: Remove duplicate CPUID wrappers

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@...ux.intel.com>
>> Cc: Ram Pai <linuxram@...ibm.com>
>> Cc: Sandipan Das <sandipan@...ux.ibm.com>
>> Cc: Florian Weimer <fweimer@...hat.com>
>> Cc: "Desnes A. Nunes do Rosario" <desnesn@...ux.vnet.ibm.com>
>> Cc: Ingo Molnar <mingo@...nel.org>
>> Cc: Thiago Jung Bauermann <bauerman@...ux.ibm.com>
>> Cc: Michael Ellerman <mpe@...erman.id.au>
>> Cc: Michal Suchanek <msuchanek@...e.de>
>> Cc: linux-mm@...ck.org
>> Cc: Chang S. Bae <chang.seok.bae@...el.com>
>> Cc: Borislav Petkov <bp@...e.de>
>> Cc: Thomas Gleixner <tglx@...utronix.de>
>> Cc: Ingo Molnar <mingo@...hat.com>
>> Cc: "H. Peter Anvin" <hpa@...or.com>
>> Cc: x86@...nel.org
>> Cc: Andy Lutomirski <luto@...nel.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ