@@ -211,6 +211,7 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str)
{"avx512-vpopcntdq",0x00000007,0,CPUID_REG_ECX, 14, 1},
{"rdpid", 0x00000007, 0, CPUID_REG_ECX, 22, 1},
{"cldemote", 0x00000007, 0, CPUID_REG_ECX, 25, 1},
+ {"pks", 0x00000007, 0, CPUID_REG_ECX, 31, 1},
{"avx512-4vnniw",0x00000007, 0, CPUID_REG_EDX, 2, 1},
{"avx512-4fmaps",0x00000007, 0, CPUID_REG_EDX, 3, 1},
@@ -134,7 +134,7 @@ static const char *const str_7c0[32] =
/* 24 */ [25] = "cldemote",
/* 26 */ [27] = "movdiri",
[28] = "movdir64b", [29] = "enqcmd",
- [30] = "sgx-lc",
+ [30] = "sgx-lc", [31] = "pks",
};
static const char *const str_e7d[32] =
@@ -121,6 +121,7 @@
#define cpu_has_movdiri boot_cpu_has(X86_FEATURE_MOVDIRI)
#define cpu_has_movdir64b boot_cpu_has(X86_FEATURE_MOVDIR64B)
#define cpu_has_enqcmd boot_cpu_has(X86_FEATURE_ENQCMD)
+#define cpu_has_pks boot_cpu_has(X86_FEATURE_PKS)
/* CPUID level 0x80000007.edx */
#define cpu_has_hw_pstate boot_cpu_has(X86_FEATURE_HW_PSTATE)
@@ -148,6 +148,8 @@
#define MSR_PL3_SSP 0x000006a7
#define MSR_INTERRUPT_SSP_TABLE 0x000006a8
+#define MSR_PKRS 0x000006e1
+
#define MSR_X2APIC_FIRST 0x00000800
#define MSR_X2APIC_LAST 0x000008ff
@@ -74,6 +74,7 @@
#define X86_CR4_SMAP 0x00200000 /* enable SMAP */
#define X86_CR4_PKE 0x00400000 /* enable PKE */
#define X86_CR4_CET 0x00800000 /* Control-flow Enforcement Technology */
+#define X86_CR4_PKS 0x01000000 /* Protection Key Supervisor */
/*
* XSTATE component flags in XCR0
@@ -227,6 +227,7 @@ XEN_CPUFEATURE(CLDEMOTE, 6*32+25) /*A CLDEMOTE instruction */
XEN_CPUFEATURE(MOVDIRI, 6*32+27) /*a MOVDIRI instruction */
XEN_CPUFEATURE(MOVDIR64B, 6*32+28) /*a MOVDIR64B instruction */
XEN_CPUFEATURE(ENQCMD, 6*32+29) /* ENQCMD{,S} instructions */
+XEN_CPUFEATURE(PKS, 6*32+31) /* Protection Key for Supervisor */
/* AMD-defined CPU features, CPUID level 0x80000007.edx, word 7 */
XEN_CPUFEATURE(HW_PSTATE, 7*32+ 7) /* Hardware Pstates */