RE: [patch 13/31] x86/fpu: Move KVMs FPU swapping to FPU core

Liu, Jing2
2021-10-15T09:20:17Z

On 10/15/2021 3:14 AM, Thomas Gleixner wrote:
> Paolo,
>
[...]
> >> vcpu_create()
> >>
> >> fpu_init_fpstate_user(guest_fpu, supported_xcr0)
> >>
> >> That will (it does not today) do:
> >>
> >> guest_fpu::__state_perm = supported_xcr0 &
> >> xstate_get_group_perm();
> >>
> >> The you have the information you need right in the guest FPU.
> >
> > Good, I wasn't aware of the APIs that will be there.
>
> Me neither, but that's a pretty obvious consequence of the work I'm doing
> for AMX. So I made it up for you. :)

Do you mean that fpu_init_fpstate_user() will be updated to add
supported_xcr0 later? :)

I'm thinking if guest_fpu::xfd is good to directly initialize as user's
init_fpstate.xfd. Because before guest initializes XFD, "hardware"
is reset value. So it would be better to make guest_fpu::xfd the
same so no need to reload zero before vmenter during this time.

Thanks,
Jing