Re: [PATCH RFC 3/7] kvm: x86: XSAVE state and XFD MSRs context switch

From: Liu, Jing2
Date: Mon Feb 22 2021 - 03:54:11 EST




On 2/9/2021 2:55 AM, Konrad Rzeszutek Wilk wrote:
On Mon, Feb 08, 2021 at 07:12:22PM +0100, Paolo Bonzini wrote:
[...]

However, running the host with _more_ bits set than necessary in XFD should
not be a problem as long as the host doesn't use the AMX instructions. So
perhaps Jing can look into keeping XFD=0 for as little time as possible, and
XFD=host_XFD|guest_XFD as much as possible.
This sounds like the lazy-fpu (eagerfpu?) that used to be part of the
kernel? I recall that we had a CVE for that - so it may also be worth
double-checking that we don't reintroduce that one.
Not sure if this means lazy restore, but the spec mentions that
"System software should not use XFD to implement a 'lazy restore' approach
to management of the XTILEDATA state component." One reason is XSAVE(S)
will lose the xTILEDATA when XFD[i] is nonzero.

Thanks,
Jing