lkml.org 
[lkml]   [2021]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 14/19] x86/fpu: Prepare for KVM XFD_ERR handling
From
On 12/8/21 01:03, Yang Zhong wrote:
>
> The guest XFD_ERR value is saved in fpu_guest::xfd_err. There is
> no need to save host XFD_ERR because it's always cleared to ZERO
> by the host #NM handler (which cannot be preempted by a vCPU
> thread to observe a non-zero value).
>
> The lower two bits in fpu_guest::xfd_err is borrowed for special
> purposes. The state components (FP and SSE) covered by the two
> bits are not XSAVE-enabled feature, thus not XFD-enabled either.
> It's impossible to see hardware setting them in XFD_ERR:
>
> - XFD_ERR_GUEST_DISABLED (bit 0)
>
> Indicate that XFD extension is not exposed to the guest thus
> no need to save/restore it.

Can this instead just check if xfeatures includes any dynamic-save features?

Paolo

> - XFD_ERR_GUEST_SAVED (bit 1)
>
> Indicate fpu_guest::xfd_err already contains a saved value
> thus no need for duplicated saving (e.g. when the vCPU thread
> is preempted multiple times before re-enter the guest).

\
 
 \ /
  Last update: 2021-12-10 17:17    [W:0.576 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site