On Mon, May 12, 2025 at 07:13:08AM -0700, Sean Christopherson wrote: >On Mon, May 12, 2025, Chao Gao wrote: >> @@ -535,10 +538,20 @@ void fpstate_init_user(struct fpstate *fpstate) >> >> static void __fpstate_reset(struct fpstate *fpstate, u64 xfd) >> { >> - /* Initialize sizes and feature masks */ >> - fpstate->size = fpu_kernel_cfg.default_size; >> + /* >> + * Initialize sizes and feature masks. Supervisor features and >> + * sizes may diverge between guest FPUs and host FPUs, whereas >> + * user features and sizes are always identical the same. > >Pick of of "identical" or "the same" :-) Sure. > >And maybe explain why supervisor features can diverge, while the kernel ensures >user features are identical? Ditto for the XFD divergence. E.g. I think this >would be accurate (though I may be reading too much into user features): > > /* > * Supervisor features (and thus sizes) may diverge between guest FPUs > * and host FPUs, as some supervisor features are supported for guests > * despite not being utilized by the host. User features and sizes are > * always identical, which allows for common guest and userspace ABI. > * > * For the host, set XFD to the kernel's desired initialization value. > * For guests, set XFD to its architectural RESET value. > */ Yea, this looks much better.