From: "H. Peter Anvin" <hpa@zytor.com>
To: Borislav Petkov <bp@alien8.de>,
Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>
Cc: herbert@gondor.apana.org.au, davem@davemloft.net,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
tglx@linutronix.de, mingo@redhat.com,
dave.hansen@linux.intel.com, x86@kernel.org, seanjc@google.com,
kim.phillips@amd.com, kirill.shutemov@linux.intel.com,
jmattson@google.com, babu.moger@amd.com, kai.huang@intel.com,
acme@redhat.com, aik@amd.com, namhyung@kernel.org,
CobeChen@zhaoxin.com, TimGuo@zhaoxin.com, LeoLiu-oc@zhaoxin.com,
GeorgeXue@zhaoxin.com
Subject: Re: [PATCH v2 2/3] x86/cpufeatures: Add CPU feature flags for Zhaoxin Hash Engine
Date: Tue, 23 Jan 2024 07:42:00 -0800 [thread overview]
Message-ID: <AADBA4D3-3D36-4AB6-B0D1-510DD5347430@zytor.com> (raw)
In-Reply-To: <20240123094427.GAZa-Ke5d2Kwyk2nSU@fat_crate.local>
On January 23, 2024 1:44:27 AM PST, Borislav Petkov <bp@alien8.de> wrote:
>On Tue, Jan 23, 2024 at 10:28:51AM +0800, Tony W Wang-oc wrote:
>> Zhaoxin CPUs have implemented the SHA(Secure Hash Algorithm) as its
>> instrucions.
>> Add two CPU feature flags indicated by CPUID.(EAX=C0000001,ECX=0):EDX
>> bit 25/26 which will be used by Zhaoxin SHA driver.
>>
>> Signed-off-by: Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>
>> ---
>> arch/x86/include/asm/cpufeatures.h | 4 +++-
>> tools/arch/x86/include/asm/cpufeatures.h | 4 +++-
>> 2 files changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
>> index 29cb275a219d..28b0e62dbdf5 100644
>> --- a/arch/x86/include/asm/cpufeatures.h
>> +++ b/arch/x86/include/asm/cpufeatures.h
>> @@ -145,7 +145,7 @@
>> #define X86_FEATURE_RDRAND ( 4*32+30) /* RDRAND instruction */
>> #define X86_FEATURE_HYPERVISOR ( 4*32+31) /* Running on a hypervisor */
>>
>> -/* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */
>> +/* VIA/Cyrix/Centaur/Zhaoxin-defined CPU features, CPUID level 0xC0000001, word 5 */
>
>Does that mean that all those companies agree on the contents of this
>CPUID leaf?
>
>> #define X86_FEATURE_XSTORE ( 5*32+ 2) /* "rng" RNG present (xstore) */
>> #define X86_FEATURE_XSTORE_EN ( 5*32+ 3) /* "rng_en" RNG enabled */
>> #define X86_FEATURE_XCRYPT ( 5*32+ 6) /* "ace" on-CPU crypto (xcrypt) */
>> @@ -156,6 +156,8 @@
>> #define X86_FEATURE_PHE_EN ( 5*32+11) /* PHE enabled */
>> #define X86_FEATURE_PMM ( 5*32+12) /* PadLock Montgomery Multiplier */
>> #define X86_FEATURE_PMM_EN ( 5*32+13) /* PMM enabled */
>> +#define X86_FEATURE_PHE2 ( 5*32+25) /* "phe2" Zhaoxin Hash Engine */
>> +#define X86_FEATURE_PHE2_EN ( 5*32+26) /* "phe2_en" PHE2 enabled */
> ^^^^^^^^^
>
>From: Documentation/arch/x86/cpuinfo.rst
>
>"a: Feature flags can be derived from the contents of CPUID leaves.
>------------------------------------------------------------------
>These feature definitions are organized mirroring the layout of CPUID
>leaves and grouped in words with offsets as mapped in enum cpuid_leafs
>in cpufeatures.h (see arch/x86/include/asm/cpufeatures.h for details).
>If a feature is defined with a X86_FEATURE_<name> definition in
>cpufeatures.h, and if it is detected at run time, the flags will be
>displayed accordingly in /proc/cpuinfo. For example, the flag "avx2"
>comes from X86_FEATURE_AVX2 in cpufeatures.h."
>
>Is your grep broken?
>
Well, Centaur bought Cyrix, and then VIA bought Centaur. I think Zhaoxin is a joint venture between VIA and the City of Shanghai, or something like that?
next prev parent reply other threads:[~2024-01-23 15:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-23 2:28 [PATCH v2 0/3] Add Zhaoxin hardware engine driver support for SHA Tony W Wang-oc
2024-01-23 2:28 ` [PATCH v2 1/3] crypto: padlock-sha: Matches CPU with Family with 6 explicitly Tony W Wang-oc
2024-01-23 16:33 ` Dave Hansen
2024-01-31 9:45 ` Tony W Wang-oc
2024-01-31 15:33 ` Dave Hansen
2024-02-01 2:37 ` Tony W Wang-oc
2024-02-01 16:42 ` Dave Hansen
2024-01-23 2:28 ` [PATCH v2 2/3] x86/cpufeatures: Add CPU feature flags for Zhaoxin Hash Engine Tony W Wang-oc
2024-01-23 9:44 ` Borislav Petkov
2024-01-23 15:42 ` H. Peter Anvin [this message]
2024-01-23 16:00 ` Borislav Petkov
2024-01-31 8:59 ` Tony W Wang-oc
2024-01-23 2:28 ` [PATCH v2 3/3] crypto: Zhaoxin: Hardware Engine Driver for SHA1/256/384/512 Tony W Wang-oc
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=AADBA4D3-3D36-4AB6-B0D1-510DD5347430@zytor.com \
--to=hpa@zytor.com \
--cc=CobeChen@zhaoxin.com \
--cc=GeorgeXue@zhaoxin.com \
--cc=LeoLiu-oc@zhaoxin.com \
--cc=TimGuo@zhaoxin.com \
--cc=TonyWWang-oc@zhaoxin.com \
--cc=acme@redhat.com \
--cc=aik@amd.com \
--cc=babu.moger@amd.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=jmattson@google.com \
--cc=kai.huang@intel.com \
--cc=kim.phillips@amd.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=seanjc@google.com \
--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