All of lore.kernel.org
 help / color / mirror / Atom feed
From: Deborah Brouwer <deborah.brouwer@collabora.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: "Gary Guo" <gary@garyguo.net>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Onur Özkan" <work@onurozkan.dev>,
	dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] rust: uapi: add zerocopy/zerocopy_derive
Date: Mon, 5 Oct 2026 15:49:42 -0700	[thread overview]
Message-ID: <asQphgGWe9KmQa5r@um790> (raw)
In-Reply-To: <CANiq72kvkAWmJEgOathMVwuXFzUURK1dVN=OWmczykVWpSTv6A@mail.gmail.com>

On Sun, Sep 27, 2026 at 02:08:36AM +0200, Miguel Ojeda wrote:
> On Sun, Sep 27, 2026 at 1:49 AM Gary Guo <gary@garyguo.net> wrote:
> >
> > I think the skip-on-error default was added in a version newer than what we've
> > vendored.
> 
> I was going to update, so that shouldn't be a big problem.
> 

The skip_on_error() method is available in the kernel’s vendored copy of zerocopy-derive
v0.8.54 and it doesn’t change in the latest version so I don’t think that updating to
0.8.59 would help us here if that's what you mean?

The problem is that skip_on_error() has a small scope; it only skips errors when
generating the implementation blocks for these traits. (For example if it’s a binding
for an unsupported representation type.) Otherwise, zerocopy-derive will generate impl
blocks with trait bound requirements (e.g. on struct fields) which only fail later at
compile-time type checking.

For example, when I tried deriving most_traits for all of the generated structs I got
about 300 compile errors due to unions inside structs that did not implement KnownLayout
When I derived most_traits for unions as well, I got an error that deriving IntoBytes
for unions needs a special cfg to enable because its soundness is still under discussion.
  error: requires --cfg zerocopy_derive_union_into_bytes;
  please let us know you use this feature: https://github.com/google/zerocopy/discussions/1802

Also, I get about 200 compile errors complaining that KnownLayout can’t currently be
implemented for bindgen’s incomplete array field helper.

So I do think it’s reasonable to implement these traits using zerocopy-derive on a
case-by-case basis.

> Cheers,
> Miguel

  reply	other threads:[~2026-10-05 22:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-26  0:26 [PATCH v3 0/2] drm/tyr: safely write GpuInfo to userspace Deborah Brouwer
2026-09-26  0:26 ` [PATCH v3 1/2] rust: uapi: add zerocopy/zerocopy_derive Deborah Brouwer
2026-09-26 15:50   ` Gary Guo
2026-09-26 16:26     ` Danilo Krummrich
2026-09-26 20:59       ` Gary Guo
2026-09-26 21:38         ` Danilo Krummrich
2026-09-26 23:49           ` Gary Guo
2026-09-27  0:08             ` Miguel Ojeda
2026-10-05 22:49               ` Deborah Brouwer [this message]
2026-10-05 22:47     ` Deborah Brouwer
2026-09-26  0:26 ` [PATCH v3 2/2] drm/tyr: safely write GpuInfo to userspace Deborah Brouwer
2026-09-26  2:44   ` Daniel Almeida
2026-09-26 16:48   ` Danilo Krummrich
2026-10-05 22:50     ` Deborah Brouwer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=asQphgGWe9KmQa5r@um790 \
    --to=deborah.brouwer@collabora.com \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=work@onurozkan.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.