Kernel KVM virtualization development
 help / color / mirror / Atom feed
* [PATCH 0/5] KVM: x86: Expose Zhaoxin CPUID 0xC0000001 EDX cryptographic features
@ 2026-05-13  9:36 Ewan Hai
  2026-05-13  9:36 ` [PATCH 1/5] KVM: x86: Expose Zhaoxin SM2 CPUID feature Ewan Hai
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Ewan Hai @ 2026-05-13  9:36 UTC (permalink / raw)
  To: seanjc, pbonzini, tglx, mingo, bp, dave.hansen, x86, hpa, kvm,
	linux-kernel
  Cc: cobechen, tonywwang

This series exposes five groups of Zhaoxin-specific CPUID 0xC0000001 EDX
feature bits to KVM guests. Each group corresponds to a category of
user-mode cryptographic or RNG instructions that have been present in
Zhaoxin processors but not yet advertised by KVM.

All instructions covered here are user-mode and available in all CPU
modes (real / V86 / compat / protected / long), with no associated MSR
control. Each feature is reported as a (X, X_EN) pair where the two
bits are redundant by hardware design (set or cleared together), and both
are CPUID-level reporting bits requiring no KVM emulation.

The five feature groups:

1. SM2 (bits 0, 1): SM2 elliptic-curve public-key cryptography algorithm
   per GM/T 0003-2012. Used for key generation, encryption/decryption,
   digital signatures, and key exchange in Chinese cryptographic
   standards.

2. CCS (bits 4, 5): SM3 hash algorithm per GM/T 0004-2012 and SM4 block
   cipher per GM/T 0002-2012 (supports ECB / CBC / CFB / OFB / CTR plus
   CBC-MAC / CFB-MAC). Foundational primitives for Chinese cryptographic
   protocols.

3. RNG2 (bits 22, 23): Second-generation hardware RNG exposed via the
   REP XRNG2 instruction. Two on-die RNG sources selectable per call,
   with raw and post-processed output modes. Provides high-quality
   entropy for cryptographic operations.

4. PHE2 (bits 25, 26): SHA-384 and SHA-512 hardware acceleration per
   FIPS 180-3, exposed via REP XSHA384 and REP XSHA512. Used by TLS,
   SSH, file integrity, and signature schemes.

5. RSA (bits 27, 28): Big-number modular exponentiation (REP XMODEXP,
   A^B mod M) and modular multiplication (REP MONTMUL2, A*B mod M),
   supporting operand sizes from 256 to 32768 bits. Used for RSA and
   related public-key operations.

References:
  The instruction encodings, control-word formats, and per-feature
  semantics referenced in the individual patches are documented in:
    - GMI Instruction Set Reference (SM2 / SM3 / SM4)
    - PadLock Instruction Reference (XRNG2 / XSHA384 / XSHA512 /
      XMODEXP / MONTMUL2)
  Both available from https://kib.kiev.ua/x86docs/Zhaoxin/

Ewan Hai (5):
  KVM: x86: Expose Zhaoxin SM2 CPUID feature
  KVM: x86: Expose Zhaoxin CCS (SM3 + SM4) CPUID feature
  KVM: x86: Expose Zhaoxin RNG2 CPUID feature
  KVM: x86: Expose Zhaoxin PHE2 CPUID feature
  KVM: x86: Expose Zhaoxin RSA CPUID feature

 arch/x86/kvm/cpuid.c         | 10 ++++++++++
 arch/x86/kvm/reverse_cpuid.h | 12 ++++++++++++
 2 files changed, 22 insertions(+)


base-commit: 50897c955902c93ae71c38698abb910525ebdc89
--
2.34.1

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH 0/5] KVM: x86: Expose Zhaoxin CPUID 0xC0000001 EDX cryptographic features
@ 2026-05-13  8:30 Ewan Hai
  2026-05-13  8:30 ` [PATCH 4/5] KVM: x86: Expose Zhaoxin PHE2 CPUID feature Ewan Hai
  0 siblings, 1 reply; 8+ messages in thread
From: Ewan Hai @ 2026-05-13  8:30 UTC (permalink / raw)
  To: seanjc, pbonzini, tglx, mingo, bp, dave.hansen, x86, hpa, kvm,
	linux-kernel
  Cc: cobechen, tonywwang

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2920 bytes --]

This series exposes five groups of Zhaoxin-specific CPUID 0xC0000001 EDXfeature bits to KVM guests. Each group corresponds to a category ofuser-mode cryptographic or RNG instructions that have been present inZhaoxin processors but not yet advertised by KVM.All instructions covered here are user-mode and available in all CPUmodes (real / V86 / compat / protected / long), with no associated MSRcontrol. Each feature is reported as a (X, X_EN) pair where the twobits are redundant by hardware design (set or cleared together), and bothare CPUID-level reporting bits requiring no KVM emulation.The five feature groups:1. SM2 (bits 0, 1): SM2 elliptic-curve public-key cryptography algorithm   per GM/T 0003-2012. Used for key generation, encryption/decryption,   digital signatures, and key exchange in Chinese cryptographic   standards.2. CCS (bits 4, 5): SM3 hash algorithm per GM/T 0004-2012 and SM4 block   cipher per GM/T 0002-2012 (supports ECB / CBC / CFB / OFB / CTR plus   CBC-MAC / CFB-MAC). Foundational primitives for Chinese cryptographic   protocols.3. RNG2 (bits 22, 23): Second-generation hardware RNG exposed via the   REP XRNG2 instruction. Two on-die RNG sources selectable per call,   with raw and post-processed output modes. Provides high-quality   entropy for cryptographic operations.4. PHE2 (bits 25, 26): SHA-384 and SHA-512 hardware acceleration per   FIPS 180-3, exposed via REP XSHA384 and REP XSHA512. Used by TLS,   SSH, file integrity, and signature schemes.5. RSA (bits 27, 28): Big-number modular exponentiation (REP XMODEXP,   A^B mod M) and modular multiplication (REP MONTMUL2, A*B mod M),   supporting operand sizes from 256 to 32768 bits. Used for RSA and   related public-key operations.References:  The instruction encodings, control-word formats, and per-feature  semantics referenced in the individual patches are documented in:    - GMI Instruction Set Reference (SM2 / SM3 / SM4)    - PadLock Instruction Reference (XRNG2 / XSHA384 / XSHA512 /      XMODEXP / MONTMUL2)  Both available from https://kib.kiev.ua/x86docs/Zhaoxin/Ewanhaioc (5):  KVM: x86: Expose Zhaoxin SM2 CPUID feature  KVM: x86: Expose Zhaoxin CCS (SM3 + SM4) CPUID feature  KVM: x86: Expose Zhaoxin RNG2 CPUID feature  KVM: x86: Expose Zhaoxin PHE2 CPUID feature  KVM: x86: Expose Zhaoxin RSA CPUID feature arch/x86/kvm/cpuid.c         | 10 ++++++++++ arch/x86/kvm/reverse_cpuid.h | 12 ++++++++++++ 2 files changed, 22 insertions(+)base-commit: 50897c955902c93ae71c38698abb910525ebdc89--2.34.1




保密声明
本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件或其内容做任何未经授权的查阅、使用、复制或转发。

This email contains confidential or legally privileged information and is for the sole use of its intended recipient. Any unauthorized review, use, copying or forwarding of this email or the content of this email is strictly prohibited.

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

end of thread, other threads:[~2026-05-13 10:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-13  9:36 [PATCH 0/5] KVM: x86: Expose Zhaoxin CPUID 0xC0000001 EDX cryptographic features Ewan Hai
2026-05-13  9:36 ` [PATCH 1/5] KVM: x86: Expose Zhaoxin SM2 CPUID feature Ewan Hai
2026-05-13 10:36   ` Binbin Wu
2026-05-13  9:36 ` [PATCH 2/5] KVM: x86: Expose Zhaoxin CCS (SM3 + SM4) " Ewan Hai
2026-05-13  9:36 ` [PATCH 3/5] KVM: x86: Expose Zhaoxin RNG2 " Ewan Hai
2026-05-13  9:36 ` [PATCH 4/5] KVM: x86: Expose Zhaoxin PHE2 " Ewan Hai
2026-05-13  9:36 ` [PATCH 5/5] KVM: x86: Expose Zhaoxin RSA " Ewan Hai
  -- strict thread matches above, loose matches on Subject: below --
2026-05-13  8:30 [PATCH 0/5] KVM: x86: Expose Zhaoxin CPUID 0xC0000001 EDX cryptographic features Ewan Hai
2026-05-13  8:30 ` [PATCH 4/5] KVM: x86: Expose Zhaoxin PHE2 CPUID feature Ewan Hai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox