From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA356258CE9 for ; Thu, 8 Jan 2026 16:26:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767889609; cv=none; b=PlLSdFpg9lvYxEVPa4Q1c2hVBPQkUgcTjx6JYj0sGJqBXxiptS3ghT5l+DpRwnrDrq3NP5nT24OrhwV8yclWlOP1xiHji62lxcD8W+v5H723nmtZm36G9uUeWP4TFa40LiMMFYUpf6IwuH8LDubAWCVxelSrG4ZpBJEiITknDnA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767889609; c=relaxed/simple; bh=TcDnE5qvaDc3YSS7vXonKFmEf+Fri5utJK1HO3xaxFI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=OCwR2TjaltT7QA0cDmu67QNFZ5S91h2ul51e4oPgyWC47V/z4GZiZ/Xfr+Nc41VUQ35o6tPu/GZlBxIDwU+D1N8tJXtsj6KItIHWEeNsYQr7C+pDtNPkIbUHvVEQLE8mvxBUx9Bvt4F7WTmGxKX6ps3/uot2OzK2Zo7xsc4fWRA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=EYJwDhzr; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=PmWeMjhn; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EYJwDhzr"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="PmWeMjhn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767889607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KcISVsCJgyrXQOFSAZiH/0oamlEfajFIB58IcXKXFQo=; b=EYJwDhzrlX/mcrm8Dqa93jsNK+MDIA84Pi7wgmuHUiGjlsn5BhW88psuBfCOcrdEniXS4H uIHyWw/vdyB/cEa4+aeDjryrsz/AdhpLgovpsPJOiiq4KY46Uqf73Zn5jdaN8Cu9s95wJ/ YGYZq4bO5TPOdCUUp6m4xs5DVYznoTc= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-35-oCNP2-tPP8-SBue_r5h9ig-1; Thu, 08 Jan 2026 11:26:45 -0500 X-MC-Unique: oCNP2-tPP8-SBue_r5h9ig-1 X-Mimecast-MFC-AGG-ID: oCNP2-tPP8-SBue_r5h9ig_1767889605 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-430fe16b481so1810823f8f.3 for ; Thu, 08 Jan 2026 08:26:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1767889604; x=1768494404; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KcISVsCJgyrXQOFSAZiH/0oamlEfajFIB58IcXKXFQo=; b=PmWeMjhnjyTBU01NHVxEyUs7TY1305x5LstSlY1z9qeEhEYXblRA1R+aDONe0tjqA3 ca4ECDWT3k5OYiQIubtIoPcjBUaH053BKDGjaV6te+D8gERn7M07wXy6iqY1Bl0KBsuQ Z5y62IrX1+RwyBo+ruEUNBztTdVNd8DuFVyKVYej2JILISlGw4dbualomUgA5Fd/3XoO 5H4mFyq2RVvAgNi1EYj2+0mRTWe+QIj1vNKsVNghJQcHai4revLVXkYWNEfcXJAptYO6 WwyPCBdToKWY2b0znbMv/kSVRGptc4xemIHtnWsFVfkvYgAjJhgM89PiGG1NKze4k67X ohEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767889604; x=1768494404; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=KcISVsCJgyrXQOFSAZiH/0oamlEfajFIB58IcXKXFQo=; b=OLxX7rPFBsNwLgEplpzaNFDfmYTKN7bqxsPS2hHp8GWYWPeQuLXKC46bdQ1RXctbFf SZnZYkTsgpN9kNmEPaDuYbM/o+CiO8xj8cvnydVRtgygVifCW9Hpr4sfheXtr2xX3BPW u7O0gx3vsX6MlLUInDB6Edj2Fj0wFioQn9hmcDJqWJuo4yGGd8NT4hpKXF0r1tMgpF6g sgByIqOj6OhrpJW/bg0fZ7HnlAzCmbB6lp2mAodaVB6/VMYGeLhZRyO+DotqNXSP7cKf yz1wYbes/1pnIW/ULHeDi3ckpxKS4j/tnEy2yORxoFbrGJU90hZEcLH1WOuIBONKQ4f+ UH8Q== X-Gm-Message-State: AOJu0Yy7cBcOiukda/QeWzKkAhRiJfvNw3IdnhpOgzmOhm40k9B2ruad 3AsFhM7yCQ2UMyXKHTWv3oPHjJ76CrRnPMCbtmptk7vVmOjhh64e2UVaBXfEeJgKsqaAW4vafYz l94+HqLKHLgvcjvPgBaL7HidJBReaztYs8BwWLuueMgScQWjJ1Rv2+z4sgpe8prCogsMv/pOzYM FAMaYYv9z/hNJJfEpRfktVH6MGQnykY19gKQeEuj08 X-Gm-Gg: AY/fxX4ExxDBjd3V0A6afTGJAd5EGKaaYf7mCTmiR0sy162a/QdaoxLo+L84uFjWNHf 2JsK96LmINPcX2J4kFzoavZ5dk0+SrqY1VEjZuBEVzxr166ie9w409AC/GLw+MJBHJ9MIta5F10 e3ycW3ehC0KdZ71ScjoQxLg/FlAFzQGwKjhCrlUBLdwafYbUtMvVno7h/oLXbcY6f81cvU+OBnZ 9XqyElR2hl7l4L779cdUDKjLxNWwc0JLFoTd8dWR5qtGon90LmagLGknCR0yyvQaXT0 X-Received: by 2002:a05:6000:2882:b0:42b:55a1:214c with SMTP id ffacd0b85a97d-432c37c1462mr7264860f8f.55.1767889604574; Thu, 08 Jan 2026 08:26:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IGuEIeET8h3W6uEZxJBwbbw9fxFbSf3TPfGzC3PFihaqUtx/tV5O/OFOh8GEgcfVZ0sjWATbOyzNazfJK/JcCI= X-Received: by 2002:a05:6000:2882:b0:42b:55a1:214c with SMTP id ffacd0b85a97d-432c37c1462mr7264842f8f.55.1767889604137; Thu, 08 Jan 2026 08:26:44 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20260101090516.316883-1-pbonzini@redhat.com> <20260101090516.316883-2-pbonzini@redhat.com> <959b98b1-fbc4-4515-bc7c-8c146c6c8529@linux.intel.com> In-Reply-To: <959b98b1-fbc4-4515-bc7c-8c146c6c8529@linux.intel.com> From: Paolo Bonzini Date: Thu, 8 Jan 2026 17:26:32 +0100 X-Gm-Features: AQt7F2pBdzRwiZhc6SZz6ZRtf4UB-NlFDQw5YKdy9WxEii3ry597CDwoHXRvJj4 Message-ID: Subject: Re: [PATCH 1/4] x86/fpu: Clear XSTATE_BV[i] in save state whenever XFD[i]=1 To: Binbin Wu Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, seanjc@google.com, x86@kernel.org, stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jan 8, 2026 at 4:08=E2=80=AFAM Binbin Wu wrote: > > + /* > > + * KVM's guest ABI is that setting XFD[i]=3D1 *can* immediately r= evert > > + * the save state to initialized. Likewise, KVM_GET_XSAVE does t= he > > Nit: > To me "initialized" has the implication that it's active. > I prefer the description "initial state" or "initial configuration" used = in > SDM here. > I am not a native English speaker though, please ignore it if it's just m= y > feeling. Sure, why not: KVM's guest ABI is that setting XFD[i]=3D1 *can* immediately revert the save state to its initial configuration. Likewise, KVM_GET_XSAVE does the same as XSAVE and returns XSTATE_BV[i]=3D0 whenever XFD[i]=3D1. > > + /* > > + * Do not reject non-initialized disabled features for backwards > > + * compatibility, but clear XSTATE_BV[i] whenever XFD[i]=3D1. > > + * Otherwise, XRSTOR would cause a #NM. > > + */ Same here: For backwards compatibility, do not expect disabled features to be in their initial state. XSTATE_BV[i] must still be cleared whenever XFD[i]=3D1, or XRSTOR would cause a #NM. Thanks! Paolo