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=1796444349; b=D5oSHpQtScB/kvJNuyGtlIabHdCt5bIVW6ktVITGEtMq5f3jC7EScASUfubBMUa3HR42 BxkNFJ12AkUUwuJmJLnb9GgL2KPnd8z/47gXu+PXK/64ecC+rF3mc94NpSHYRKp+5/IdX ZbqeT5mUerMkUDajyPScGV6LoSVmwDwgCW1cDE8mIUX1QvL9dekqdz3ObleheErUBpVcA pO0/00hGprnbeh40gyNGEyUbsMQPHf2N4RMXmfYr4S6qiSRDP7UujwPmOqiy/i22/pT6B /kfrp2pFy686CN2w2Rqis5FhmyxoW4bvetu0mck5EEVzTNor6RqTXgxp+QVil/BYU6g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796444349; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=ubHTIA9N/LVhQPbOV6G5tFcQIXFefjc4FKNbPaVmoP0=; b=1VLf9/yuLO829Gb4uVHgBu6VHamu3Hu0NgxNbFesZgFG5H42jid+xOAfEFA6SfXTuMY2 SkiJjVpzclTvVunCMNTM/yEstRcHzmVirDJS42pas/rTjUb2dPkehP3fgr+ckmBmJo/C1 jfDTOKthLH10WrIw7t2R2eK+nVRqsifUILLIu1y9v+COkbYIyG09ykgARBFBwG1yy7fFg Nnnnyphf7q/jvPch32c8pJj7k2Kxuw78H34XS78wdc/oAfj94w7tVZiWWjgluUsKVnvmT E3yrfve+QBZbcz26QIpxD+UOGKPVmMmTc5gbevEliLAye6uY9+FbuGSf9BWonuWZw/w== 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=AVJgmE86; 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 49591606A333; Sat, 5 Dec 2026 04:19:09 +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=AVJgmE86 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89D9E1F00936; Sat, 5 Dec 2026 04:19:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796444349; bh=ubHTIA9N/LVhQPbOV6G5tFcQIXFefjc4FKNbPaVmoP0=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=AVJgmE86hXL3r5cXw8qX2p9Ly5ly73La5Zr7qhMKtygnNOdtqWoQLSNFgNKdEAywx WJkdQqXIvWlueDIfKBCijd5RYvuvLRYG5XVIilNN6eDXzJ38WD69W8vOrOOjn82TaC 421+sunUd7mALzdFfsXT4epYUuZ7yJ1iFJXVmMYZokeCqmAAGls4P4X6YvGi23TQbg ruWVXMpTi9v7B4YJJ1mqhg2B/LbDeVKsy4jVi8kK60ctCAcBbnJ0oSPGT5NcRqBDgW y89rLEu5zWovhZK8WBwUQTo0cJ5s5VtXDEsCR3qJ+XvUCn43ieovIKblOLCKfaCu3b KruDuE/6dieeg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v5 4/4] rust: vfio: add PCI variant driver abstractions Reply-To: sashiko-reviews@lists.linux.dev To: "Simon Song" , dakr@kernel.org, acourbot@nvidia.com, kvm@vger.kernel.org, nova-gpu@lists.linux.dev, linux-pci@vger.kernel.org Cc: alex@shazbot.org, jgg@nvidia.com, yishaih@nvidia.com, skolothumtho@nvidia.com, kevin.tian@intel.com, airlied@gmail.com, simona@ffwll.ch, ojeda@kernel.org, alex.gaynor@gmail.com, boqun.feng@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org, a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu, jhubbard@nvidia.com, ecourtney@nvidia.com, cjia@nvidia.com, smitra@nvidia.com, kjaju@nvidia.com, alkumar@nvidia.com, ankita@nvidia.com, aniketa@nvidia.com, kwankhede@nvidia.com, targupta@nvidia.com, zhiwang@kernel.org, zhiw@nvidia.com, boqun@kernel.org, daniel.almeida@collabora.com, tamird@kernel.org, work@onurozkan.dev, jgg@ziepe.ca, bhelgaas@google.com, kwilczynski@kernel.org, dri-devel@lists.freedesktop.org, peter@colberg.org, "Liam R. Howlett" , linux-mm@kvack.org, "Lorenzo Stoakes" In-Reply-To: <20261204041727.4021092-5-xinmengs@nvidia.com> References: <20261204041727.4021092-1-xinmengs@nvidia.com> <20261204041727.4021092-5-xinmengs@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 04:19:07 +0000 X-Mailing-List: linux-pci@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 2 potential issues to consider: - [Low] rust: vfio: missing #[inline] on small and forwarding methods in vfio::pci - [Low] rust: vfio: build_ops!() duplicates as_char_ptr_in_const_context() -- commit fc553fbc4c9de5d8211c3a1d37c9e87f322da8bb Author: Danilo Krummrich rust: vfio: add PCI variant driver abstractions This commit adds Rust abstractions for VFIO PCI variant drivers in rust/kernel/vfio/pci.rs, along with PCI device and error-result helpers in rust/kernel/pci.rs. > diff --git a/rust/kernel/vfio/pci.rs b/rust/kernel/vfio/pci.rs > new file mode 100644 > index 0000000000000..728baf0c1ce93 > --- /dev/null > +++ b/rust/kernel/vfio/pci.rs > @@ -0,0 +1,880 @@ [ ... ] > + pub fn with_temporary( > + &mut self, > + operation: impl FnOnce(&mut Position<'_>) -> Result, > + ) -> Result { > + let mut next =3D *self.raw; > + let result =3D operation(&mut Position { raw: &mut next })?; > + *self.raw =3D next; > + Ok(result) > + } [Severity: Low] Should Position::with_temporary() and the other small or forwarding methods in vfio::pci be marked #[inline]? In the kernel crate, small helpers and thin wrappers around C bindings normally carry #[inline] (as Position::region_index() and Device::core_mmap() already do) so they can be inlined across crates into variant drivers. This also applies to Device::set_device_id(), Device::core_ioctl(), Device::core_read(), Device::core_write(), Device::core_get_region_info(), Registration::reset_prepare(), Registration::reset_done(), and Registration::error_detected(). [ ... ] > +macro_rules! build_ops { > + ($T:ty) =3D> { > + bindings::vfio_device_ops { > + #[allow(clippy::disallowed_methods)] > + name: <$T>::NAME.as_ptr().cast_mut().cast(), [Severity: Low] Can this use crate::str::as_char_ptr_in_const_context(<$T>::NAME).cast_mut() instead of duplicating the cast with #[allow(clippy::disallowed_methods)]? rust/kernel/str.rs already provides as_char_ptr_in_const_context() for const-context vtable initializers, as used by other subsystems in the kernel crate. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204041727.4021= 092-1-xinmengs@nvidia.com?part=3D4