mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 18:21:39 +01:00
Lazy FPU avoids some work during a context switch but pushes more expensive costs elsewhere: * 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. * A key difference between 32-bit and 64-bit OSes is that %xmm is in the base featureset for 64-bit and thus gets ubiquitous use in userspace. This is likely why we hit 83%. * 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@citrix.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>