[PATCH RFC v2 8/9] x86/fpu/apx: Enable APX state support

Chang S. Bae posted 9 patches 9 months ago
[PATCH RFC v2 8/9] x86/fpu/apx: Enable APX state support
Posted by Chang S. Bae 9 months ago
With securing APX against conflicting MPX, it is now ready to be enabled.
Include APX in the enabled xfeature set.

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
---
 arch/x86/include/asm/fpu/xstate.h | 3 ++-
 arch/x86/kernel/fpu/xstate.c      | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/fpu/xstate.h b/arch/x86/include/asm/fpu/xstate.h
index 7f39fe7980c5..b308a76afbb7 100644
--- a/arch/x86/include/asm/fpu/xstate.h
+++ b/arch/x86/include/asm/fpu/xstate.h
@@ -32,7 +32,8 @@
 				      XFEATURE_MASK_PKRU | \
 				      XFEATURE_MASK_BNDREGS | \
 				      XFEATURE_MASK_BNDCSR | \
-				      XFEATURE_MASK_XTILE)
+				      XFEATURE_MASK_XTILE | \
+				      XFEATURE_MASK_APX)
 
 /*
  * Features which are restored when returning to user space.
diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
index 0d68d5c4bc48..a5e3954dc834 100644
--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
@@ -371,7 +371,8 @@ static __init void os_xrstor_booting(struct xregs_state *xstate)
 	 XFEATURE_MASK_BNDCSR |			\
 	 XFEATURE_MASK_PASID |			\
 	 XFEATURE_MASK_CET_USER |		\
-	 XFEATURE_MASK_XTILE)
+	 XFEATURE_MASK_XTILE |			\
+	 XFEATURE_MASK_APX)
 
 /*
  * setup the xstate image representing the init state
-- 
2.45.2
Re: [PATCH RFC v2 8/9] x86/fpu/apx: Enable APX state support
Posted by Sohil Mehta 8 months ago
On 3/20/2025 4:42 PM, Chang S. Bae wrote:
> With securing APX against conflicting MPX, it is now ready to be enabled.
> Include APX in the enabled xfeature set.
> 
> Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
> ---
>  arch/x86/include/asm/fpu/xstate.h | 3 ++-
>  arch/x86/kernel/fpu/xstate.c      | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 

Reviewed-by: Sohil Mehta <sohil.mehta@intel.com>

> diff --git a/arch/x86/include/asm/fpu/xstate.h b/arch/x86/include/asm/fpu/xstate.h
> index 7f39fe7980c5..b308a76afbb7 100644
> --- a/arch/x86/include/asm/fpu/xstate.h
> +++ b/arch/x86/include/asm/fpu/xstate.h
> @@ -32,7 +32,8 @@
>  				      XFEATURE_MASK_PKRU | \
>  				      XFEATURE_MASK_BNDREGS | \
>  				      XFEATURE_MASK_BNDCSR | \
> -				      XFEATURE_MASK_XTILE)
> +				      XFEATURE_MASK_XTILE | \
> +				      XFEATURE_MASK_APX)
>  
>  /*
>   * Features which are restored when returning to user space.
> diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
> index 0d68d5c4bc48..a5e3954dc834 100644
> --- a/arch/x86/kernel/fpu/xstate.c
> +++ b/arch/x86/kernel/fpu/xstate.c
> @@ -371,7 +371,8 @@ static __init void os_xrstor_booting(struct xregs_state *xstate)
>  	 XFEATURE_MASK_BNDCSR |			\
>  	 XFEATURE_MASK_PASID |			\
>  	 XFEATURE_MASK_CET_USER |		\
> -	 XFEATURE_MASK_XTILE)
> +	 XFEATURE_MASK_XTILE |			\
> +	 XFEATURE_MASK_APX)
>  
>  /*
>   * setup the xstate image representing the init state