lkml.org 
[lkml]   [2022]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] x86/fpu: Remove dynamic features from xcomp_bv for init_fpstate
From
On 10/13/22 09:23, Chang S. Bae wrote:
>
> --- a/arch/x86/kernel/fpu/xstate.c
> +++ b/arch/x86/kernel/fpu/xstate.c
> @@ -1127,8 +1127,12 @@ void __copy_xstate_to_uabi_buf(struct membuf to,
> struct fpstate *fpstate,
>          * non-compacted format disabled features still occupy state space,
>          * but there is no state to copy from in the compacted
>          * init_fpstate. The gap tracking will zero these states.
> +        *
> +        * In the case of guest fpstate, this user_xfeatures does not
> +        * dynamically reflect the capacity of the XSAVE buffer but
> +        * xfeatures does. So AND them together.
>          */
> -       mask = fpstate->user_xfeatures;
> +       mask = fpstate->user_xfeatures & fpstate->xfeatures;

I'm not sure this is quite right either.

Doesn't kvm expect that all of the ->user_xfeatures will end up being
copied out? We surely can't copy them from 'fpstate' if the feature
isn't there, but we can't skip them entirely, can we?

\
 
 \ /
  Last update: 2022-10-13 19:22    [W:0.089 / U:22.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site