public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: "Benno Lossin" <lossin@kernel.org>
To: "Janne Grunau" <j@jannau.net>
Cc: "Gary Guo" <gary@garyguo.net>, "Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	asahi@lists.linux.dev, rust-for-linux@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] rust: pin-init: internal: init: remove `#[disable_initialized_field_access]`
Date: Mon, 02 Mar 2026 15:11:19 +0100	[thread overview]
Message-ID: <DGSCVEZTZG4C.1IO3JGXYEHW7@kernel.org> (raw)
In-Reply-To: <20260301171222.GA22561@robin.jannau.net>

On Sun Mar 1, 2026 at 6:12 PM CET, Janne Grunau wrote:
> On Sat, Feb 28, 2026 at 12:37:04PM +0100, Benno Lossin wrote:
>> @asahi folks, let me know if I should prioritize a solution for packed
>> structs. Otherwise I'd like not support it at the moment, as that
>> requires some deeper changes to the internals of pin-init. I'm tracking
>> the status of packed structs in:
>
> I have worked around this in the downstream AOP audio driver now. I did
> not do that initially since it looked more involved and we were planning
> to bring support back.
> These structs describe messages for communication with a coprocessor via
> shared memory. They are derived by observing messages by tracing. So
> there is only limited understanding how the messages are formated. Their
> layout has for obvious reason match exactly so `#[repr(C, packed)]` is
> the obvious choice.
> One of the structs had a size of N * 4 - 1 which results in a alignment
> of 1. Fortunately the struct could be padded to multiple of 4.
> Nevertheless it was required to replace a few u32 with an unaligned
> version.
>
> I'm not sure if there is a need to support unaligned fields in pin-init.
> The workarounds in the asahi GPU and AOP audio drivers are acceptable
> and could stay indefinitely.

Thanks for the quick work! Yeah that sounds like a good solution for the
problem. Adding unaligned pointer support to initialization is quite a
pain. If it comes up we can still do it of course (but I'd only do it if
we can't find a workaround).

Cheers,
Benno

      reply	other threads:[~2026-03-02 14:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-28 11:37 [PATCH 1/2] rust: pin-init: internal: init: remove `#[disable_initialized_field_access]` Benno Lossin
2026-02-28 11:37 ` [PATCH 2/2] rust: pin-init: internal: init: document load-bearing fact of field accessors Benno Lossin
2026-02-28 11:55   ` Gary Guo
2026-02-28 14:56     ` Benno Lossin
2026-02-28 14:11   ` Miguel Ojeda
2026-02-28 14:49     ` Benno Lossin
2026-02-28 12:03 ` [PATCH 1/2] rust: pin-init: internal: init: remove `#[disable_initialized_field_access]` Gary Guo
2026-02-28 14:09 ` Miguel Ojeda
2026-03-01 17:12 ` Janne Grunau
2026-03-02 14:11   ` Benno Lossin [this message]

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=DGSCVEZTZG4C.1IO3JGXYEHW7@kernel.org \
    --to=lossin@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=asahi@lists.linux.dev \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=j@jannau.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox