All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/cpufeatures: Add new Zhaoxin CPU features
@ 2020-06-29 11:21 Tony W Wang-oc
  2020-07-06 16:02 ` Luck, Tony
  0 siblings, 1 reply; 3+ messages in thread
From: Tony W Wang-oc @ 2020-06-29 11:21 UTC (permalink / raw)
  To: tglx, mingo, bp, x86, hpa, tony.luck, pawan.kumar.gupta,
	jpoimboe, peterz, thellstrom, mgross, kim.phillips, linux-kernel
  Cc: DavidWang, CooperYan, QiyuanWang, HerryYang, CobeChen

Add new Zhaoxin CPU features for enumeration in /proc/cpuinfo:
SM2, SM2_EN, SM3, SM4, SM3_EN, SM4_EN, PARALLAX, PARALLAX_EN,
TM3, TM3_EN, RNG2, RNG2_EN, PHE2, PHE2_EN, RSA, RSA_EN.

CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 0]  SM2
CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 1]  SM2_EN
CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 4]  SM3 SM4
CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 5]  SM3_EN SM4_EN
CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 16] PARALLAX
CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 17] PARALLAX_EN
CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 20] TM3
CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 21] TM3_EN
CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 22] RNG2
CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 23] RNG2_EN
CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 25] PHE2
CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 26] PHE2_EN
CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 27] RSA
CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 28] RSA_EN

SM2, SM3, SM4 are Chinese Cipher Security algorithm.
PARALLAX is a feature that automatically adjusts processors's voltage
as a function of temperature.
TM3 is Zhaoxin CPU Thermal Monitor v3.
RNG2 is Zhaoxin Random Number Generation v2.
PHE2 is Zhaoxin Padlock Hash Engine v2.
RSA is Zhaoxin hardware support for RSA algorithm.

Signed-off-by: Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>
---
 arch/x86/include/asm/cpufeatures.h | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
index c693ebf..a6c2d2b 100644
--- a/arch/x86/include/asm/cpufeatures.h
+++ b/arch/x86/include/asm/cpufeatures.h
@@ -145,9 +145,13 @@
 #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 */
+#define X86_FEATURE_SM2			( 5*32+ 0) /* Chinese cipher security hardware support of SM2 */
+#define X86_FEATURE_SM2_EN		( 5*32+ 1) /* SM2 enabled */
 #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_CCS			( 5*32+ 4) /* "sm3 sm4" Chinese Cipher Security hardware support*/
+#define X86_FEATURE_CCS_EN		( 5*32+ 5) /* "sm3_en sm4_en" sm3 sm4 enabled */
 #define X86_FEATURE_XCRYPT		( 5*32+ 6) /* "ace" on-CPU crypto (xcrypt) */
 #define X86_FEATURE_XCRYPT_EN		( 5*32+ 7) /* "ace_en" on-CPU crypto enabled */
 #define X86_FEATURE_ACE2		( 5*32+ 8) /* Advanced Cryptography Engine v2 */
@@ -156,6 +160,16 @@
 #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_PARALLAX		( 5*32+16) /* Parallax auto adjust processor voltage */
+#define X86_FEATURE_PARALLAX_EN		( 5*32+17) /* Parallax auto adjust processor voltage enabled */
+#define X86_FEATURE_TM3			( 5*32+20) /* Thermal Monitor v3 support */
+#define X86_FEATURE_TM3_EN		( 5*32+21) /* TM3 enabled */
+#define X86_FEATURE_RNG2		( 5*32+22) /* RNG v2 present */
+#define X86_FEATURE_RNG2_EN		( 5*32+23) /* RNG v2 enabled */
+#define X86_FEATURE_PHE2		( 5*32+25) /* PHE v2 present */
+#define X86_FEATURE_PHE2_EN		( 5*32+26) /* PHE v2 enabled */
+#define X86_FEATURE_RSA			( 5*32+27) /* RSA hardware support */
+#define X86_FEATURE_RSA_EN		( 5*32+28) /* RSA enabled */
 
 /* More extended AMD flags: CPUID level 0x80000001, ECX, word 6 */
 #define X86_FEATURE_LAHF_LM		( 6*32+ 0) /* LAHF/SAHF in long mode */
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/cpufeatures: Add new Zhaoxin CPU features
  2020-06-29 11:21 [PATCH] x86/cpufeatures: Add new Zhaoxin CPU features Tony W Wang-oc
@ 2020-07-06 16:02 ` Luck, Tony
  2020-07-07  2:43   ` Tony W Wang-oc
  0 siblings, 1 reply; 3+ messages in thread
From: Luck, Tony @ 2020-07-06 16:02 UTC (permalink / raw)
  To: Tony W Wang-oc
  Cc: tglx, mingo, bp, x86, hpa, pawan.kumar.gupta, jpoimboe, peterz,
	thellstrom, mgross, kim.phillips, linux-kernel, DavidWang,
	CooperYan, QiyuanWang, HerryYang, CobeChen

On Mon, Jun 29, 2020 at 07:21:29PM +0800, Tony W Wang-oc wrote:
> Add new Zhaoxin CPU features for enumeration in /proc/cpuinfo:
> SM2, SM2_EN, SM3, SM4, SM3_EN, SM4_EN, PARALLAX, PARALLAX_EN,
> TM3, TM3_EN, RNG2, RNG2_EN, PHE2, PHE2_EN, RSA, RSA_EN.
> 
> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 0]  SM2
> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 1]  SM2_EN
> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 4]  SM3 SM4
> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 5]  SM3_EN SM4_EN
> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 16] PARALLAX
> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 17] PARALLAX_EN
> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 20] TM3
> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 21] TM3_EN
> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 22] RNG2
> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 23] RNG2_EN
> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 25] PHE2
> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 26] PHE2_EN
> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 27] RSA
> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 28] RSA_EN
> 
> SM2, SM3, SM4 are Chinese Cipher Security algorithm.
> PARALLAX is a feature that automatically adjusts processors's voltage
> as a function of temperature.
> TM3 is Zhaoxin CPU Thermal Monitor v3.
> RNG2 is Zhaoxin Random Number Generation v2.
> PHE2 is Zhaoxin Padlock Hash Engine v2.
> RSA is Zhaoxin hardware support for RSA algorithm.

Boris is on vacation, so I'll ask the question that he would ask
if he were here ... "Are there some follow-up patches that use all
of these feature bits?"

Just adding bits to /proc/cpuinfo is of limited use.

-Tony

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/cpufeatures: Add new Zhaoxin CPU features
  2020-07-06 16:02 ` Luck, Tony
@ 2020-07-07  2:43   ` Tony W Wang-oc
  0 siblings, 0 replies; 3+ messages in thread
From: Tony W Wang-oc @ 2020-07-07  2:43 UTC (permalink / raw)
  To: Luck, Tony
  Cc: tglx, mingo, bp, x86, hpa, pawan.kumar.gupta, jpoimboe, peterz,
	thellstrom, mgross, kim.phillips, linux-kernel, DavidWang,
	CooperYan, QiyuanWang, HerryYang, CobeChen



On 07/07/2020 00:02, Luck, Tony wrote:
> On Mon, Jun 29, 2020 at 07:21:29PM +0800, Tony W Wang-oc wrote:
>> Add new Zhaoxin CPU features for enumeration in /proc/cpuinfo:
>> SM2, SM2_EN, SM3, SM4, SM3_EN, SM4_EN, PARALLAX, PARALLAX_EN,
>> TM3, TM3_EN, RNG2, RNG2_EN, PHE2, PHE2_EN, RSA, RSA_EN.
>>
>> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 0]  SM2
>> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 1]  SM2_EN
>> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 4]  SM3 SM4
>> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 5]  SM3_EN SM4_EN
>> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 16] PARALLAX
>> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 17] PARALLAX_EN
>> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 20] TM3
>> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 21] TM3_EN
>> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 22] RNG2
>> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 23] RNG2_EN
>> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 25] PHE2
>> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 26] PHE2_EN
>> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 27] RSA
>> CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 28] RSA_EN
>>
>> SM2, SM3, SM4 are Chinese Cipher Security algorithm.
>> PARALLAX is a feature that automatically adjusts processors's voltage
>> as a function of temperature.
>> TM3 is Zhaoxin CPU Thermal Monitor v3.
>> RNG2 is Zhaoxin Random Number Generation v2.
>> PHE2 is Zhaoxin Padlock Hash Engine v2.
>> RSA is Zhaoxin hardware support for RSA algorithm.
> 
> Boris is on vacation, so I'll ask the question that he would ask
> if he were here ... "Are there some follow-up patches that use all
> of these feature bits?"

No for up to now.

Sincerely
TonyWWang-oc

> 
> Just adding bits to /proc/cpuinfo is of limited use.
> 
> -Tony
> .
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-07  2:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-29 11:21 [PATCH] x86/cpufeatures: Add new Zhaoxin CPU features Tony W Wang-oc
2020-07-06 16:02 ` Luck, Tony
2020-07-07  2:43   ` Tony W Wang-oc

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.