Skip to content

Commit 00a1c40

Browse files
hanliyangWangYuli
authored andcommitted
x86/cpufeatures: Add CSV3 CPU feature
hygon inclusion category: feature CVE: NA --------------------------- Add CPU feature detection for Hygon 3rd CSV. This feature enhances CSV2 by also isolating NPT and VMCB, making them in-accessible to the hypervisor. Signed-off-by: hanliyang <hanliyang@hygon.cn>
1 parent 4a0be8d commit 00a1c40

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

arch/x86/include/asm/cpufeatures.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,8 @@
465465
#define X86_FEATURE_V_TSC_AUX (19*32+ 9) /* "" Virtual TSC_AUX */
466466
#define X86_FEATURE_SME_COHERENT (19*32+10) /* "" AMD hardware-enforced cache coherency */
467467
#define X86_FEATURE_DEBUG_SWAP (19*32+14) /* AMD SEV-ES full debug state swap support */
468+
/* HYGON 3rd CSV */
469+
#define X86_FEATURE_CSV3 (19*32 + 30) /* HYGON 3rd CSV */
468470

469471
/* AMD-defined Extended Feature 2 EAX, CPUID level 0x80000021 (EAX), word 20 */
470472
#define X86_FEATURE_NO_NESTED_DATA_BP (20*32+ 0) /* "" No Nested Data Breakpoints */

arch/x86/kernel/cpu/hygon.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ static void early_detect_mem_encrypt(struct cpuinfo_x86 *c)
300300
clear_csv:
301301
setup_clear_cpu_cap(X86_FEATURE_SEV);
302302
setup_clear_cpu_cap(X86_FEATURE_SEV_ES);
303+
setup_clear_cpu_cap(X86_FEATURE_CSV3);
303304
}
304305

305306
static void early_init_hygon(struct cpuinfo_x86 *c)

0 commit comments

Comments
 (0)