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=1796178131; b=H8ArKtToo4SIdfd/tO2+ZHHIhiSI64N/tQOCYmMTtanN4p+IjuyoBRsXqL3tYpyjnSyy OCBeZdUw+O0NIHcrhkFkvtrXl/W+SH2N2mZ8m/VBIobmJX1+YAzV8XXZc0kNAENZd1khZ iqgcpjRUvtN5EEfdGxMjKNAAhiIH5qcNCW08AW9Nfny4AN32bvcYkh+BDAEhxMVHhLiPA YX/EZU/ZrAuNy3HmQ8xBFWjMnqWHol1RPrqpu2qTIEFwRi6z7X8ypSCxr/Zhj7yvBKgMB 3w2yn+BJMUbPBw53Hrb3aQM/cSN1CYdWUg8H16RLyHeIb4MB/6Qu9sXJbpVgCOumzAg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796178131; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=SFm7Jj18G2boqfY9/I0jtIlEKLnnOsh/l4l5tJsP84s=; b=vEqyTRuMZedlF/rjE2juYiMbHl+f7QBBjmD2FtgyCbAtVPcvmILgf+tGt+mZzVnOgvDs 2nJaWAm+LaJhHlMDRuk5EP98HLJ1fyKU5nJ9+Me1EaSwjoDcno4R9AQZjxdE5DcOoDOfx /WztTHHmP5gv0x7Z7NlBwyECYg5DNs92ZXIlCH59807VscfrHILR/w/JR/XgyC6b4WqrW 70KHFBpjEjfMZgZsoG/QCSz3VldNgQiLe9JyvvHZqJ/KxAmHFv1Z90bOZtrrNgbpCqYY/ JlY8IeJe/jtnmYvxFdSItSaqaR9BC5UHC0Pkd3QVVv9fPH0r1PU4eoZNKUHxZ+wlNcA== 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=mYar6i0a; 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 EB816606A31A for ; Wed, 2 Dec 2026 02:22:10 +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=mYar6i0a Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25EFF1F000C1; Wed, 2 Dec 2026 02:22:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796178130; bh=SFm7Jj18G2boqfY9/I0jtIlEKLnnOsh/l4l5tJsP84s=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=mYar6i0aKPJyKG6nqOcmQSpwuvglFINwcovY3+uk9s9XrCR0teV8gz3zx0rhRhgCj 9xCHId2ay0wbgmEJ2UR3Jr6LvdUV9WbfgnIJGNxj3YTrNZWx+eoGy2rYzttZA6iSmU /4sDIcqB3UH1mdy0DNXOkLSSdpY+a7PqszUcDgj1tUK6CvIRl01NQh+cfsQ2cu4RNy fisKllk+xWy5iLK1IHFmaQtRXND5I2wwai2uDch6/zZ/9nHQik1nOPxUumQ1L6q6+n Z9PC1Fw5oXQsHJdFQyDb3EcRe2lW8a9cY9AyRnZORcxCyAX5ii+qfjl9QmV5Dg8rNR 1oQCzYjZrA5Vg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [RFC PATCH] gpu: nova-core: gsp: add RM alloc/control/free RPCs and client/device API Reply-To: sashiko-reviews@lists.linux.dev To: =?utf-8?b?QWd1c3TDrW4gUGVyZWlyYQ==?= , "Danilo Krummrich" , "Alexandre Courbot" , "Alice Ryhl" , "David Airlie" , "Simona Vetter" Cc: nova-gpu@lists.linux.dev, dri-devel@lists.freedesktop.org, ojeda@kernel.org, gary@garyguo.net In-Reply-To: <20261202015357.153058-1-agustin.pereira.ro@gmail.com> References: <20261202015357.153058-1-agustin.pereira.ro@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 02:22:09 +0000 X-Mailing-List: nova-gpu@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] gpu: nova-core: gsp: unchecked rpc_result and wrong reply type in RmFreeReply - [Low] gpu: nova-core: RmControlReply::read() drains sbuffer after read_exact() -- commit c67e31312d3a98810c1881e3bd0e412db7ac2488 Author: Agust=C3=ADn Pereira gpu: nova-core: gsp: add RM alloc/control/free RPCs and client/device API This commit implements the GSP-RM object alloc, control, and free RPCs along with RAII handle wrappers for RM clients, devices, subdevices, and child objects. > diff --git a/drivers/gpu/nova-core/gsp/commands.rs b/drivers/gpu/nova-cor= e/gsp/commands.rs > index cdbb13674f082..80b8da1ad672c 100644 > --- a/drivers/gpu/nova-core/gsp/commands.rs > +++ b/drivers/gpu/nova-core/gsp/commands.rs [ ... ] > @@ -329,3 +330,185 @@ fn read( [ ... ] > +impl MessageFromGsp for RmControlRepl= y

{ > + const FUNCTION: MsgFunction =3D MsgFunction::GspRmControl; > + type InitError =3D Error; > + type Message =3D fw::commands::GspRmControlHeader; > + > + fn read( > + msg: &Self::Message, > + sbuffer: &mut SBufferIter>, > + ) -> Result { > + msg.status().into_result()?; > + > + let mut params =3D P::zeroed(); > + sbuffer.read_exact(params.as_bytes_mut())?; > + while sbuffer.next().is_some() {} > + > + Ok(Self { params }) > + } > +} [Severity: Low] Why does RmControlReply::read() drain sbuffer after read_exact()? sbuffer.read_exact(params.as_bytes_mut()) already consumes the full size_of::

() reply payload. Draining any remaining bytes afterwards silently suppresses the "has unprocessed data" warning in CmdqInner::receive_msg() when a GSP_RM_CONTROL reply payload is larger than P. [ ... ] > +/// The reply from the GSP to [`RmFree`]. > +pub(super) struct RmFreeReply; > + > +impl MessageFromGsp for RmFreeReply { > + const FUNCTION: MsgFunction =3D MsgFunction::Free; > + type InitError =3D Error; > + type Message =3D fw::commands::GspRmFree; > + > + fn read( > + msg: &Self::Message, > + _sbuffer: &mut SBufferIter>, > + ) -> Result { > + msg.status().into_result()?; > + Ok(RmFreeReply) > + } > +} [Severity: Medium] Does GSP-RM report NV_VGPU_MSG_FUNCTION_FREE completion status in rpc_free_v03_00.params.status or in the outer rpc_message_header_v rpc_result field? Unlike GSP_RM_ALLOC and GSP_RM_CONTROL, nouveau's r535_gsp_rpc_rm_free() requests a zero-payload reply for FREE and checks rpc->rpc_result in the outer RPC header. In nova-core, CmdqInner::receive_msg() does not check header.inner.rpc.rpc_result, while RmFreeReply requires a 16-byte GspRmFree payload and checks params.status (which GspRmFree::new() initializes to 0): drivers/gpu/nova-core/gsp/cmdq.rs:CmdqInner::receive_msg() { ... // An early return here would leave the read pointer on this messag= e. let result =3D if matches!(function, Ok(f) if f =3D=3D M::FUNCTION)= { let (cmd, contents_1) =3D M::Message::from_bytes_prefix(message= .contents.0).ok_or(EIO)?; ... } As a result, RPC errors reported in rpc_result are missed, and if GSP-RM returns an empty reply payload for FREE (like UnloadingGuestDriverReply, which uses type Message =3D ()), GspRmFree::from_bytes_prefix() returns Err(EIO) before advance_cpu_read_ptr() is reached, leaving the command queue read pointer stuck on the unconsumed message. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202015357.1530= 58-1-agustin.pereira.ro@gmail.com?part=3D1