You could simplify this by allocating the state the first time XCR0
Thinking more about it, #NM only has to be trapped if XCR0 enables
a dynamic feature. In other words, the guest value of XFD can be
limited to (host_XFD|guest_XFD) & guest_XCR0. This avoids that
KVM unnecessarily traps for old guests that use CR0.TS.
enables the feature in question.
(This is how regular non-virt userspace*should* work too, but it
looks like I’ve probably been outvoted on that front…)