Skip to content

Commit 6ffdb49

Browse files
ereshetovahansendc
authored andcommitted
x86/cpufeatures: Add X86_FEATURE_SGX_EUPDATESVN feature flag
Add a flag indicating whenever ENCLS[EUPDATESVN] SGX instruction is supported. This will be used by SGX driver to perform CPU SVN updates. Signed-off-by: Elena Reshetova <elena.reshetova@intel.com> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Reviewed-by: Kai Huang <kai.huang@intel.com> Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com> Tested-by: Nataliia Bondarevska <bondarn@google.com>
1 parent 483fc19 commit 6ffdb49

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

arch/x86/include/asm/cpufeatures.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@
499499
#define X86_FEATURE_IBPB_EXIT_TO_USER (21*32+14) /* Use IBPB on exit-to-userspace, see VMSCAPE bug */
500500
#define X86_FEATURE_ABMC (21*32+15) /* Assignable Bandwidth Monitoring Counters */
501501
#define X86_FEATURE_MSR_IMM (21*32+16) /* MSR immediate form instructions */
502+
#define X86_FEATURE_SGX_EUPDATESVN (21*32+17) /* Support for ENCLS[EUPDATESVN] instruction */
502503

503504
/*
504505
* BUG word(s)

arch/x86/kernel/cpu/cpuid-deps.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ static const struct cpuid_dep cpuid_deps[] = {
7979
{ X86_FEATURE_SGX_LC, X86_FEATURE_SGX },
8080
{ X86_FEATURE_SGX1, X86_FEATURE_SGX },
8181
{ X86_FEATURE_SGX2, X86_FEATURE_SGX1 },
82+
{ X86_FEATURE_SGX_EUPDATESVN, X86_FEATURE_SGX1 },
8283
{ X86_FEATURE_SGX_EDECCSSA, X86_FEATURE_SGX1 },
8384
{ X86_FEATURE_XFD, X86_FEATURE_XSAVES },
8485
{ X86_FEATURE_XFD, X86_FEATURE_XGETBV1 },

arch/x86/kernel/cpu/scattered.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ static const struct cpuid_bit cpuid_bits[] = {
4343
{ X86_FEATURE_PER_THREAD_MBA, CPUID_ECX, 0, 0x00000010, 3 },
4444
{ X86_FEATURE_SGX1, CPUID_EAX, 0, 0x00000012, 0 },
4545
{ X86_FEATURE_SGX2, CPUID_EAX, 1, 0x00000012, 0 },
46+
{ X86_FEATURE_SGX_EUPDATESVN, CPUID_EAX, 10, 0x00000012, 0 },
4647
{ X86_FEATURE_SGX_EDECCSSA, CPUID_EAX, 11, 0x00000012, 0 },
4748
{ X86_FEATURE_HW_PSTATE, CPUID_EDX, 7, 0x80000007, 0 },
4849
{ X86_FEATURE_CPB, CPUID_EDX, 9, 0x80000007, 0 },

0 commit comments

Comments
 (0)