linux/arch
Ewan Hai-oc 3ee865eb69 KVM: x86: Expose Zhaoxin CCS (SM3 + SM4) CPUID feature
Advertise the Zhaoxin CCS (Chinese Cryptography Standard) feature to
guests via CPUID 0xC0000001 EDX bits 4 (CCS) and 5 (CCS_EN). CCS groups
two unprivileged instructions for Chinese national cryptographic
primitives, documented in the Zhaoxin GMI Instruction Set Reference,
chapter 2 ("CCS instruction group"):

  - SM3 (encoding F3 0F A6 E8, subsection 2.1) implements the SM3 hash
    algorithm specified in GM/T 0004-2012. It supports two modes
    selected by RAX: auto-padding stream mode (RAX=0) and pre-padded
    block mode (RAX=-1).

  - SM4 (encoding F3 0F A7 F0, subsection 2.2) implements the SM4 block
    cipher specified in GM/T 0002-2012, supporting ECB / CBC / CFB /
    OFB / CTR modes via a control word in RAX, and CBC-MAC / CFB-MAC
    when RAX bit[11] is set.

Both instructions are unprivileged (no CPL restriction) and available
in all CPU modes, with no associated MSR control. The CCS and CCS_EN
bits are redundant by hardware design (set or cleared together) and
both serve purely as CPUID-level feature-presence reporting flags
requiring no KVM emulation. Both bits are advertised because different
software may probe either one when checking for CCS availability.

Reviewed-by: Binbin Wu <binbin.wu@linux.intel.com>
Signed-off-by: Ewan Hai <ewanhai-oc@zhaoxin.com>
Link: https://patch.msgid.link/20260610023512.3690734-3-ewanhai-oc@zhaoxin.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
2026-07-10 09:07:34 -07:00
..
alpha ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
arc ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
arm ARM fixes for 7.1 2026-06-14 15:37:39 +01:00
arm64 KVM/arm64 updates for 7.2 2026-06-12 10:51:42 +02:00
csky ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
hexagon ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
loongarch LoongArch: KVM: Add missing slots_lock for device register/unregister 2026-06-11 20:46:44 +08:00
m68k ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
microblaze ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
mips TTY/Serial driver fixes for 7.1-rc6 2026-05-30 08:34:03 -07:00
nios2 NIOS2: updates for v7.2 2026-05-23 09:21:08 -07:00
openrisc ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
parisc ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
powerpc Including fixes from Bluetooth, wireless and netfilter. 2026-05-21 14:39:12 -07:00
riscv KVM/riscv changes for 7.2 2026-06-15 15:38:14 +02:00
s390 KVM: s390: Fix S390_USER_OPEREXEC and more gmap fixes 2026-06-24 13:41:41 +02:00
sh ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
sparc ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
um ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
x86 KVM: x86: Expose Zhaoxin CCS (SM3 + SM4) CPUID feature 2026-07-10 09:07:34 -07:00
xtensa ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
.gitignore
Kconfig parisc architecture fixes and updates for kernel v7.1-rc1: 2026-04-18 11:37:36 -07:00