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=1796235662; b=ljc/9cskXRoyehSM5cjDBbQeHAdhgzYJhl0+mSG71FYw0iSsjG+zV5RvoVnbIT1K0lXx GjK8TycL8mQPIyWXDE5/FFnXPFVoBgarajfpdSh/sK47ObhVNJOmCKaVZEr0kelTu55ko pbo7ZbEQg3JqIys3jxGdTKAOeQfXjxNukxuXU+x9+XGCRWOlC55JRHkMC6BvH4+agBFBA +pVJKON3cqUH+UvRe3BZiQTdPV7eXYe5zt9sTBzOfnl+mu2q1abN2EyFq/imY/Bn904Ek n1vPKqiu97908JUgVlrUpogsncGaj5Hn6zSqs0PZ6/9lZqfXAF/8BDxR++My0UQ2UMg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796235662; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=fOn2oUwoRy77NldrtD1q2R1zxDKOf/0wnX+rUy1SGE8=; b=eBejLvJ6woUr7UJSZwZlGtyJoECC83G5ng7weU3vxdj9O6f79DqyvldOAzPS8yGnRVXl TUvZIjPzOyXPMOt0BO7mutUAARGFWOF/cHVmzQ0CfK9QlLqnq2LxTepuGTxbAcxga/X7d hZINVGUhx+1zFChS4NDo85CSq+3pCIzsTig8QGeBCsV17PRwZjnBoi2RvQqi3DZqNRjk2 vgYyEHRXoUlykivUWT+nbhZD4F76ell0a6CMGomK6XQOhlOf5ZhFttX2ahGiRt6pieCrt 2LM51z5jyywLL70tjWgW2niXqfUEe04TI42mtG+jn3QG8aKqi5pkFBHZU2YlT2uO+MA== 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=UT232ghT; 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 C8D87606A322 for ; Wed, 2 Dec 2026 18:21:02 +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=UT232ghT Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36B371F00893; Wed, 2 Dec 2026 18:21:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796235662; bh=fOn2oUwoRy77NldrtD1q2R1zxDKOf/0wnX+rUy1SGE8=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=UT232ghTPKFhEQ5ipINr/dG2uySJdHkQe2XklmZORurBvbqdRFuLCV0ThqO/P3JtU cDClIKiVP3Qzua6k2O/wpXkVVpNxWe3UskrSNG00M3haIUxxNf1HKYgltfR+dNGod5 TSDzVtMrKAovjDrshM5laax260JLpuWwAMM0jAiz7SNkdi8btbo924HFRhkYilHUA8 nBIisTZc/Vjwjjm3JCHfiKwbDSvahXMai9oQXB1/RPKTCBZAHNNhOlzK+A3p0DxQrd fmNiM+1IXxDJXMMdMI9ffB0ZjGmUKVGtSL/a/7N3kudRgS7XyvFOcqC570aZzYQ1k5 QpZiafJgo7ZUA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 2/2] KVM: PPC: Don't map unclassified guest state IDs onto bit 0 Reply-To: sashiko-reviews@lists.linux.dev To: "Amit Machhiwal" Cc: kvm@vger.kernel.org In-Reply-To: <20261202181630.21203-3-amachhiw@linux.ibm.com> References: <20261202181630.21203-1-amachhiw@linux.ibm.com> <20261202181630.21203-3-amachhiw@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 18:21:01 +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: - [Low] KVM: PPC: missing Fixes trailer on kvmppc_gse_flatten_iden() bug fix -- commit 3fb79be85605a3aaa7279630bfc52cabade894f3 Author: Amit Machhiwal > KVM: PPC: Don't map unclassified guest state IDs onto bit 0 > > kvmppc_gse_flatten_iden() converts a guest state ID into a bitmap > position. For an ID that does not belong to any guest state class it > returns 0, which is also the valid position of KVMPPC_GSID_BLANK. A > caller passing such an ID therefore silently reads or modifies the > state of an unrelated element, and because ID 0 terminates the > kvmppc_gsbm_for_each() style iterators, a stray bit 0 also hides every > other element from them. > > Return -1 for an unclassified ID instead and make the users of > kvmppc_gse_flatten_iden() cope with it: > > - kvmppc_gsp_insert(), kvmppc_gsbm_set() and kvmppc_gsbm_clear() warn > once and do nothing. > - kvmppc_gsbm_test() warns once and returns false. > - kvmppc_gsbm_next() warns once and ends the iteration if the previous > ID is unclassified. The old "flatten(prev) + 1" form would have > turned -1 back into position 0, so check the result first. > - kvmppc_gsp_lookup() returns NULL, as for an element that is absent. > > The guest state buffer is produced by the L0 hypervisor. PowerVM is not > expected to send an element that L1 cannot interpret, but other L0 > implementations exist, for example the QEMU TCG nestedv2 model, and L1 > should not depend on that. Elements received from L0 are already > rejected by kvmppc_gse_parse() if their ID is unclassified, so they > never reach these helpers. The warnings can therefore only be triggered > by a kernel bug, such as adding a new guest state ID without a class, > and not by the contents of a guest state buffer. > > Cc: stable@vger.kernel.org > Signed-off-by: Amit Machhiwal [Severity: Low] This fixes a bug in kvmppc_gse_flatten_iden() and carries a stable tag. Should this include: Fixes: 6ccbbc33f06a ("KVM: PPC: Add helper library for Guest State Buffer= s") --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202181630.2120= 3-1-amachhiw@linux.ibm.com?part=3D2