x86/sgx: Move ENCLS leaf definitions to sgx.h
authorSean Christopherson <sean.j.christopherson@intel.com>
Fri, 19 Mar 2021 07:23:04 +0000 (20:23 +1300)
committerBorislav Petkov <bp@suse.de>
Tue, 6 Apr 2021 07:43:41 +0000 (09:43 +0200)
Move the ENCLS leaf definitions to sgx.h so that they can be used by
KVM.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Kai Huang <kai.huang@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Jarkko Sakkinen <jarkko@kernel.org>
Acked-by: Dave Hansen <dave.hansen@intel.com>
Link: https://lkml.kernel.org/r/2e6cd7c5c1ced620cfcd292c3c6c382827fde6b2.1616136308.git.kai.huang@intel.com
arch/x86/include/asm/sgx.h
arch/x86/kernel/cpu/sgx/encls.h

index 14bb5f7..34f4423 100644 (file)
 /* The bitmask for the EPC section type. */
 #define SGX_CPUID_EPC_MASK     GENMASK(3, 0)
 
+enum sgx_encls_function {
+       ECREATE = 0x00,
+       EADD    = 0x01,
+       EINIT   = 0x02,
+       EREMOVE = 0x03,
+       EDGBRD  = 0x04,
+       EDGBWR  = 0x05,
+       EEXTEND = 0x06,
+       ELDU    = 0x08,
+       EBLOCK  = 0x09,
+       EPA     = 0x0A,
+       EWB     = 0x0B,
+       ETRACK  = 0x0C,
+};
+
 /**
  * enum sgx_return_code - The return code type for ENCLS, ENCLU and ENCLV
  * %SGX_NOT_TRACKED:           Previous ETRACK's shootdown sequence has not
index 443188f..be5c496 100644 (file)
 #include <asm/traps.h>
 #include "sgx.h"
 
-enum sgx_encls_function {
-       ECREATE = 0x00,
-       EADD    = 0x01,
-       EINIT   = 0x02,
-       EREMOVE = 0x03,
-       EDGBRD  = 0x04,
-       EDGBWR  = 0x05,
-       EEXTEND = 0x06,
-       ELDU    = 0x08,
-       EBLOCK  = 0x09,
-       EPA     = 0x0A,
-       EWB     = 0x0B,
-       ETRACK  = 0x0C,
-};
-
 /**
  * ENCLS_FAULT_FLAG - flag signifying an ENCLS return code is a trapnr
  *