lkml.org 
[lkml]   [2023]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v7 06/26] x86/fpu/xstate: Create guest fpstate with guest specific config
Date
On Fri, 2023-11-24 at 00:53 -0500, Yang Weijiang wrote:
> +static struct fpstate *__fpu_alloc_init_guest_fpstate(struct
> fpu_guest *gfpu)
>  {
> +       bool compacted = cpu_feature_enabled(X86_FEATURE_XCOMPACTED);
> +       unsigned int gfpstate_size, size;
>         struct fpstate *fpstate;
> -       unsigned int size;
>  
> -       size = fpu_user_cfg.default_size + ALIGN(offsetof(struct
> fpstate, regs), 64);
> +       /*
> +        * fpu_guest_cfg.default_features includes all enabled
> xfeatures
> +        * except the user dynamic xfeatures. If the user dynamic
> xfeatures
> +        * are enabled, the guest fpstate will be re-allocated to
> hold all
> +        * guest enabled xfeatures, so omit user dynamic xfeatures
> here.
> +        */
> +       gfpstate_size =
> xstate_calculate_size(fpu_guest_cfg.default_features,
> +                                             compacted);

Why not fpu_guest_cfg.default_size here?

> +
> +       size = gfpstate_size + ALIGN(offsetof(struct fpstate, regs),
> 64);

\
 
 \ /
  Last update: 2023-11-28 16:20    [W:0.734 / U:1.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site