[PATCH v3 0/2] rust: transmute: implement FromBytes and AsBytes for inhabited ZSTs

Alexandre Courbot posted 2 patches 1 week, 3 days ago
There is a newer version of this series
drivers/gpu/nova-core/gsp/commands.rs | 6 +++---
rust/kernel/transmute.rs              | 8 ++++++++
2 files changed, 11 insertions(+), 3 deletions(-)
[PATCH v3 0/2] rust: transmute: implement FromBytes and AsBytes for inhabited ZSTs
Posted by Alexandre Courbot 1 week, 3 days ago
This is useful in Nova's GSP message handling, as some messages are
empty and we currently need to explicitly use an empty structure for
them.

If accepted, I would like to merge it through `drm-rust-next` so Nova
code can start using this feature quickly.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
Changes in v3:
- Use better safety statement. (thanks Gary!)
- Also add `PhantomData`. (thanks Gary!)
- Link to v2: https://patch.msgid.link/20251208-transmute_unit-v2-0-aa17a6848afb@nvidia.com

Changes in v2:
- Make use of new feature in Nova.
- Link to v1: https://patch.msgid.link/20251208-transmute_unit-v1-1-680c7386b5d9@nvidia.com

---
Alexandre Courbot (2):
      rust: transmute: implement FromBytes and AsBytes for inhabited ZSTs
      gpu: nova-core: gsp: use () as message type for GspInitDone message

 drivers/gpu/nova-core/gsp/commands.rs | 6 +++---
 rust/kernel/transmute.rs              | 8 ++++++++
 2 files changed, 11 insertions(+), 3 deletions(-)
---
base-commit: ba65a4e7120a616d9c592750d9147f6dcafedffa
change-id: 20251208-transmute_unit-78ab58ba9e6e

Best regards,
-- 
Alexandre Courbot <acourbot@nvidia.com>
Re: [PATCH v3 0/2] rust: transmute: implement FromBytes and AsBytes for inhabited ZSTs
Posted by Gary Guo 1 week, 2 days ago
On Tue, 09 Dec 2025 11:57:58 +0900
Alexandre Courbot <acourbot@nvidia.com> wrote:

> This is useful in Nova's GSP message handling, as some messages are
> empty and we currently need to explicitly use an empty structure for
> them.
> 
> If accepted, I would like to merge it through `drm-rust-next` so Nova
> code can start using this feature quickly.
> 
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>

Reviewed-by: Gary Guo <gary@garyguo.net>

> ---
> Changes in v3:
> - Use better safety statement. (thanks Gary!)
> - Also add `PhantomData`. (thanks Gary!)
> - Link to v2: https://patch.msgid.link/20251208-transmute_unit-v2-0-aa17a6848afb@nvidia.com
> 
> Changes in v2:
> - Make use of new feature in Nova.
> - Link to v1: https://patch.msgid.link/20251208-transmute_unit-v1-1-680c7386b5d9@nvidia.com
> 
> ---
> Alexandre Courbot (2):
>       rust: transmute: implement FromBytes and AsBytes for inhabited ZSTs
>       gpu: nova-core: gsp: use () as message type for GspInitDone message
> 
>  drivers/gpu/nova-core/gsp/commands.rs | 6 +++---
>  rust/kernel/transmute.rs              | 8 ++++++++
>  2 files changed, 11 insertions(+), 3 deletions(-)
> ---
> base-commit: ba65a4e7120a616d9c592750d9147f6dcafedffa
> change-id: 20251208-transmute_unit-78ab58ba9e6e
> 
> Best regards,