|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v1 1/8] x86: Always use eager-fpu
On 19/03/2026 1:29 pm, Ross Lagerwall wrote: > Lazy FPU avoids some work during a context switch but pushes the costs > elsewhere: I'd phrase this as "more expensive costs elsewhere". We're trading off a slightly-longer XRSTOR now, for 1) in PV guests, an #NM exception 2) in HVM guests, an #NM exception and VMExit and the longer XRSTOR. Lazy is only a win even in theory if the sum of time handing #NM is less than sum of time doing the longer XRSTOR, and with ... > * For a workload running some Windows VMs, I measured about 83% of > context switches out had used the FPU so most of the time the FPU > save/restore is not avoided, just delayed. ... this "No, 83% of the time", falls firmly into "no not a win" category. > * Setting/clearing the cr0.TS bit is serializing and reportedly slower > than the processor optimized xsave/restore. > * Linux uses PKRU so a partial xsave/restore is performed on each > context switch anyway, followed by a second xsave/restore at some > point during execution. "This interferes with the 'modified' optimisation that hardware uses to try and reduce the cost of the following XSAVE". > > There is no measurable performance benefit for using lazy FPU and it > adds unwanted complexity so remove the option and always use eager-fpu. > > Signed-off-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx> I think we want one other bullet point. A key difference between 32bit and 64bit OSes is that %xmm is in the base featureset for 64bit an thus get ubiquitous use in userspace. This is likely why we hit 83%. Otherwise, Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> > diff --git a/docs/misc/hypfs-paths.pandoc b/docs/misc/hypfs-paths.pandoc > index e86f7d0dbef9..1553cb0bcb7f 100644 > --- a/docs/misc/hypfs-paths.pandoc > +++ b/docs/misc/hypfs-paths.pandoc > @@ -108,12 +108,10 @@ A populated Xen hypervisor file system might look like > the following example: > active-hvm/ directory for mitigations active in hvm doamins > msr-spec-ctrl "No" or "Yes" > rsb "No" or "Yes" > - eager-fpu "No" or "Yes" > md-clear "No" or "Yes" > active-pv/ directory for mitigations active in pv doamins > msr-spec-ctrl "No" or "Yes" > rsb "No" or "Yes" > - eager-fpu "No" or "Yes" > md-clear "No" or "Yes" > xpti "No" or list of "dom0", "domU", "PCID-on" > l1tf-shadow "No" or list of "dom0", "domU" Juergen, do we want to nuke this whole paragraph? I recall that we never took the patch wiring up the speculation controls. If so, it will be better to split this into a separate patch, rather than to wonder why we've got a hypfs docs change with no associated code change. ~Andrew
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |