[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a0bfd816-f4f9-6b98-22cc-8edd3c126041@redhat.com>
Date: Fri, 10 Dec 2021 17:16:47 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Yang Zhong <yang.zhong@...el.com>, x86@...nel.org,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com
Cc: seanjc@...gle.com, jun.nakajima@...el.com, kevin.tian@...el.com,
jing2.liu@...ux.intel.com, jing2.liu@...el.com
Subject: Re: [PATCH 14/19] x86/fpu: Prepare for KVM XFD_ERR handling
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).
Powered by blists - more mailing lists