Re: [PATCH v8 06/26] x86/fpu/xstate: Create guest fpstate with guest specific config
From: Edgecombe, Rick P
Date: Wed Jan 03 2024 - 13:17:06 EST
On Thu, 2023-12-21 at 09:02 -0500, Yang Weijiang wrote:
> #if IS_ENABLED(CONFIG_KVM)
> -static void __fpstate_reset(struct fpstate *fpstate, u64 xfd);
> -
> static void fpu_init_guest_permissions(struct fpu_guest *gfpu)
> {
> struct fpu_state_perm *fpuperm;
> @@ -272,25 +270,54 @@ static void fpu_init_guest_permissions(struct
> fpu_guest *gfpu)
> gfpu->perm = perm & ~FPU_GUEST_PERM_LOCKED;
> }
>
> -bool fpu_alloc_guest_fpstate(struct fpu_guest *gfpu)
> +static struct fpstate *__fpu_alloc_init_guest_fpstate(struct
> fpu_guest *gfpu)
> {
> + bool compacted = cpu_feature_enabled(X86_FEATURE_XCOMPACTED);
With CONFIG_WERROR I get:
arch/x86/kernel/fpu/core.c: In function
‘__fpu_alloc_init_guest_fpstate’:
arch/x86/kernel/fpu/core.c:275:14: error: unused variable ‘compacted’
[-Werror=unused-variable]
275 | bool compacted =
cpu_feature_enabled(X86_FEATURE_XCOMPACTED);