Re: [patch 4/6] x86/fpu: Add guest support to xfd_enable_feature()

Paolo Bonzini
2021-12-14T10:22:09Z

On 12/14/21 07:05, Tian, Kevin wrote:
>> + if (guest_fpu) {
>> + newfps->is_guest = true;
>> + newfps->is_confidential = curfps->is_confidential;
>> + newfps->in_use = curfps->in_use;
>> + guest_fpu->xfeatures |= xfeatures;
>> + }
>> +
> As you explained guest fpstate is not current active in the restoring
> path, thus it's not correct to always inherit attributes from the
> active one.

Indeed, guest_fpu->fpstate should be used instead of curfps.

Paolo