Re: [patch 4/6] x86/fpu: Add guest support to xfd_enable_feature()
From: Paolo Bonzini
Date:  Tue Dec 14 2021 - 05:22:17 EST
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