From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796411713; b=m9sMD317Xfiy+NDdD+NkTi/cnFsbjkcmfACBNw+S4AHqoJGeD2ISzBUwrxv7iPkyfWh7 cP4SD8brhYx5x1hp6OoFplXV4il+zmVygDL+8+tqbhaLq4U/X+cWH5VuStRVFL2fzrHf3 Gmh+H1Fd5X7mTOgLcHvvBfYIaBrWTjPa99d0lGJyVc7S5ah4HZApsFWhtW6dpk8VGriMZ 41ZX854zXb6VPlLPwoWmyr0GMt2qWrDFpZtXqQ/0we7iYBhdn5kYUVYfrjRUHYAhkAEbz nOz8cGlBW4ObG8pZqxEurab5jubaenfPBY248lwJ142o6qkyihChlE8KAfnu8Izp7zw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796411713; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=XAPQA+WaffdzKzL9vVxM0OFLud3jHiOMR04j5XQIekI=; b=HQpwCUjiOqAMiOAjxKcM9emKpPSI+Iz5fZciBfayku41gSHFCw+fZ3HhCpM3PsHyShj6 7ZiGzSy+Mq9LRTnXXjSVOnQNivWkjx/lh2y2EO9KosjUy2ezdCLSzO4NHxNCoikS03wuk 0d7s+4kxjIXjdEspEjlNrp8nMl/PI9AOTh54l8prMxFAfq4Kbkurb19S2Au4IfxbL3mHJ XaVIqtiaPTAB3gynoDlah369d0ZA059gNpdBK1Hu3W9xy4jLJkj10oYw6hsvysp5VayRj vKOLVueeWLNtyhBnpvgq6ux78ayRVGNel/dMig+J08BBO1xgJAoXWzkXqnrTaVFbUxw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=PNnXW0s3; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65305606A32F for ; Fri, 4 Dec 2026 19:15:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=PNnXW0s3 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D92931F0093B; Fri, 4 Dec 2026 19:15:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796411713; bh=XAPQA+WaffdzKzL9vVxM0OFLud3jHiOMR04j5XQIekI=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=PNnXW0s3hY/wM37Q2Pi5wLTP6SDLDlUvrci2aCfZgtFuiWiKu2WVx+g3o2IW9NpRC lmP/e61+dZTImHCG/ZBy0BWR2RjF+N0NrDx+2RJvLqXVI8F0HDjFlaPeZC1+1EOd+m VjbwqGeWek6KD58njAsRcRTzBiZR7BvO93rXl0ZvDdUy/GmOJKqZCcklMWQfcBjJTG O9tT4Iqv7WegfrLREd7s4aq1YHn/km6WM24Yco8LUiebSDs/w4JyxPMhaSv9BLoAru 8Ukcy6jhWmOSXMvdG4PJQqLRCAUblJldieiD1uRxYJr2LneI+O+LwkPnc7dALXZse+ jSP+NDj7vB96g== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 6.1.y 23/24] x86/fpu: Ensure guest FPU is resident in hardware when updating actual XFD MSR Reply-To: sashiko-reviews@lists.linux.dev To: "Paolo Bonzini" , kvm@vger.kernel.org In-Reply-To: <20261204180423.2168641-24-pbonzini@redhat.com> References: <20261204180423.2168641-1-pbonzini@redhat.com> <20261204180423.2168641-24-pbonzini@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 19:15:12 +0000 X-Mailing-List: kvm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [High] x86/fpu: undefined fpregs_lock_and_load() call in fpu_update_guest_xfd() -- commit 1699a8ac95cf60d653358ccad0388430af2ea364 Author: Sean Christopherson x86/fpu: Ensure guest FPU is resident in hardware when updating actual XFD = MSR This commit updates fpu_update_guest_xfd() to ensure the guest FPU state is resident in hardware before updating the XFD MSR, replacing fpregs_lock() a= nd conditional XSTATE_BV clearing with fpregs_lock_and_load(). Link: https://patch.msgid.link/20261119001506.64568-4-seanjc@google.com > diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c > index 99e910ebedc46..f21e42de9c252 100644 > --- a/arch/x86/kernel/fpu/core.c > +++ b/arch/x86/kernel/fpu/core.c > @@ -319,19 +319,18 @@ void fpu_update_guest_xfd(struct fpu_guest *guest_f= pu, u64 xfd) > } > =20 > /* > - * If the guest's FPU state is in hardware, just update XFD: the XSAVE > - * in fpu_swap_kvm_fpstate will clear XSTATE_BV[i] whenever XFD[i]=3D1. > - * > - * If however the guest's FPU state is NOT resident in hardware, clear > - * disabled components in XSTATE_BV now, or a subsequent XRSTOR will > - * attempt to load disabled components and generate #NM _in the host_. > + * If the guest's FPU state is in-use, then ensure the state is resident > + * in hardware and simply update XFD. The guest is responsible for > + * clearing disabled components when doing its own XRSTOR operations, > + * and the XSAVE in fpu_swap_kvm_fpstate() when putting the guest FPU > + * will clear XSTATE_BV[i] whenever XFD[i]=3D1. > + */ > + fpregs_lock_and_load(); [Severity: High] Does this break builds with CONFIG_X86_64 and CONFIG_KVM enabled? fpregs_lock_and_load() is neither declared nor defined in this 6.1.y tree, resulting in an implicit declaration and link failure. Existing callers su= ch as fpu_clone() open-code fpregs_lock() followed by a TIF_NEED_FPU_LOAD check and fpregs_restore_userregs() instead. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204180423.2168= 641-1-pbonzini@redhat.com?part=3D23