On Tue, Sep 26, 2023, Sean Christopherson wrote:
Masking fpstate->user_xfeatures is buggy for another reason: it's destructive if userspace calls KVM_SET_CPUID multiple times. No real world userspace actually calls KVM_SET_CPUID to "expand" features, but it's technically possible and KVM is supposed to allow it.
This particular bit is wrong, KVM overwrites user_xfeatures, it doesn't AND it. I misremembered the code.