Re: [PATCH v2] gpu: nova-core: parse structs via zerocopy

"Alexandre Courbot" <[email protected]> Tue, 30 Jun 2026 23:03:40 +0900
Newsgroups dev.linux.lists.linux-kernel-mentees,dev.linux.lists.nova-gpu,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel,org.kernel.vger.rust-for-linux
Message-ID <[email protected]>
On Mon Jun 29, 2026 at 11:20 PM JST, Nicolás Antinori wrote:
> Replace the unsafe `kernel::transmute::FromBytes` trait implementation
> for the `FalconUCodeDescV3`, `PcirStruct`, `BitHeader`, `BitToken`,
> `NpdeStruct`, `PciRomHeader`, `PmuLookupTableEntry` and
> `PmuLookupTableHeader` structs with the derivable `zerocopy::FromBytes`
> trait.
>
> This change eliminates the manual unsafe implementations in favor of a
> derivable trait. When this trait is derived, validity checks are
> performed at compile time to ensure that the type can safely implement
> `FromBytes`.
>
> Link: https://github.com/Rust-for-Linux/linux/issues/1241
> Suggested-by: Miguel Ojeda <[email protected]>
> Signed-off-by: Nicolás Antinori <[email protected]>

Pushed to `drm-rust-next`, thanks!

  [acourbot: add `vbios:` prefix to commit title.]