Re: [PATCH 09/25] x86/sgx: Move ENCLS leaf definitions to sgx.h

2021-03-01 Thread Kai Huang
On Mon, 2021-03-01 at 08:25 -0800, Sean Christopherson wrote:
> On Mon, Mar 01, 2021, Kai Huang wrote:
> > And because they're architectural.
> 
> Heh, this snarky sentence can be dropped, it was a lot more clever when these
> were being moved to sgx_arch.h.

Sure. Reasonable to me.

> 
> > Signed-off-by: Sean Christopherson 
> > Acked-by: Dave Hansen 
> > Acked-by: Jarkko Sakkinen 
> > Signed-off-by: Kai Huang 
> > ---
> >  arch/x86/include/asm/sgx.h  | 15 +++
> >  arch/x86/kernel/cpu/sgx/encls.h | 15 ---
> >  2 files changed, 15 insertions(+), 15 deletions(-)




Re: [PATCH 09/25] x86/sgx: Move ENCLS leaf definitions to sgx.h

2021-03-01 Thread Sean Christopherson
On Mon, Mar 01, 2021, Kai Huang wrote:
> And because they're architectural.

Heh, this snarky sentence can be dropped, it was a lot more clever when these
were being moved to sgx_arch.h.

> Signed-off-by: Sean Christopherson 
> Acked-by: Dave Hansen 
> Acked-by: Jarkko Sakkinen 
> Signed-off-by: Kai Huang 
> ---
>  arch/x86/include/asm/sgx.h  | 15 +++
>  arch/x86/kernel/cpu/sgx/encls.h | 15 ---
>  2 files changed, 15 insertions(+), 15 deletions(-)


[PATCH 09/25] x86/sgx: Move ENCLS leaf definitions to sgx.h

2021-03-01 Thread Kai Huang
From: Sean Christopherson 

Move the ENCLS leaf definitions to sgx.h so that they can be used by
KVM.  And because they're architectural.

Signed-off-by: Sean Christopherson 
Acked-by: Dave Hansen 
Acked-by: Jarkko Sakkinen 
Signed-off-by: Kai Huang 
---
 arch/x86/include/asm/sgx.h  | 15 +++
 arch/x86/kernel/cpu/sgx/encls.h | 15 ---
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/arch/x86/include/asm/sgx.h b/arch/x86/include/asm/sgx.h
index d4ad35f6319a..48f0c42027c0 100644
--- a/arch/x86/include/asm/sgx.h
+++ b/arch/x86/include/asm/sgx.h
@@ -27,6 +27,21 @@
 /* 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
diff --git a/arch/x86/kernel/cpu/sgx/encls.h b/arch/x86/kernel/cpu/sgx/encls.h
index 443188fe7e70..be5c49689980 100644
--- a/arch/x86/kernel/cpu/sgx/encls.h
+++ b/arch/x86/kernel/cpu/sgx/encls.h
@@ -11,21 +11,6 @@
 #include 
 #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
  *
-- 
2.29.2