public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] gpu: nova: require little endian
@ 2026-04-07  3:59 Eliot Courtney
  2026-04-07  5:09 ` John Hubbard
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Eliot Courtney @ 2026-04-07  3:59 UTC (permalink / raw)
  To: Danilo Krummrich, Alexandre Courbot, Alice Ryhl, David Airlie,
	Simona Vetter
  Cc: John Hubbard, Alistair Popple, Joel Fernandes, Timur Tabi,
	rust-for-linux, dri-devel, linux-kernel, Eliot Courtney

The driver already assumes little endian in a lot of locations. For
example, all the code that reads RPCs out of the command queue just
directly interprets the bytes.

Make this explicit in Kconfig.

Signed-off-by: Eliot Courtney <ecourtney@nvidia.com>
---
The current code assumes little endian in a bunch of places. I think we
should either explicitly decide to be generic on endianness or explicitly
decide not to - having some handling sprinkled around in various
locations seems confusing to me.

I believe that currently e.g. `RUST` transitively depends on
!CPU_BIG_ENDIAN, so this is more about making the decision explicit for
nova-core rather than fixing any kind of hole.
---
Changes in v2:
- Also add to nova-drm (Thanks Danilo)
- Did not take Reviewed-by + Acked-by because commit changed
  substantively
- Link to v1: https://patch.msgid.link/20260406-fix-kconfig-v1-1-8f634499f7f0@nvidia.com
---
 drivers/gpu/drm/nova/Kconfig  | 1 +
 drivers/gpu/nova-core/Kconfig | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/nova/Kconfig b/drivers/gpu/drm/nova/Kconfig
index 3e637ad7b5ba..a2028b8539d7 100644
--- a/drivers/gpu/drm/nova/Kconfig
+++ b/drivers/gpu/drm/nova/Kconfig
@@ -4,6 +4,7 @@ config DRM_NOVA
 	depends on DRM=y
 	depends on PCI
 	depends on RUST
+	depends on !CPU_BIG_ENDIAN
 	select AUXILIARY_BUS
 	select NOVA_CORE
 	default n
diff --git a/drivers/gpu/nova-core/Kconfig b/drivers/gpu/nova-core/Kconfig
index a4f2380654e2..d8456f8eaa05 100644
--- a/drivers/gpu/nova-core/Kconfig
+++ b/drivers/gpu/nova-core/Kconfig
@@ -3,6 +3,7 @@ config NOVA_CORE
 	depends on 64BIT
 	depends on PCI
 	depends on RUST
+	depends on !CPU_BIG_ENDIAN
 	select AUXILIARY_BUS
 	select RUST_FW_LOADER_ABSTRACTIONS
 	default n

---
base-commit: a7a080bb4236ebe577b6776d940d1717912ff6dd
change-id: 20260406-fix-kconfig-3a059f622697

Best regards,
--  
Eliot Courtney <ecourtney@nvidia.com>


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] gpu: nova: require little endian
  2026-04-07  3:59 [PATCH v2] gpu: nova: require little endian Eliot Courtney
@ 2026-04-07  5:09 ` John Hubbard
  2026-04-07 11:57 ` Gary Guo
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: John Hubbard @ 2026-04-07  5:09 UTC (permalink / raw)
  To: Eliot Courtney, Danilo Krummrich, Alexandre Courbot, Alice Ryhl,
	David Airlie, Simona Vetter
  Cc: Alistair Popple, Joel Fernandes, Timur Tabi, rust-for-linux,
	dri-devel, linux-kernel

On 4/6/26 8:59 PM, Eliot Courtney wrote:
> The driver already assumes little endian in a lot of locations. For
> example, all the code that reads RPCs out of the command queue just
> directly interprets the bytes.
> 
> Make this explicit in Kconfig.
> 
> Signed-off-by: Eliot Courtney <ecourtney@nvidia.com>
> ---
> The current code assumes little endian in a bunch of places. I think we
> should either explicitly decide to be generic on endianness or explicitly
> decide not to - having some handling sprinkled around in various
> locations seems confusing to me.
> 
> I believe that currently e.g. `RUST` transitively depends on
> !CPU_BIG_ENDIAN, so this is more about making the decision explicit for
> nova-core rather than fixing any kind of hole.
> ---
> Changes in v2:
> - Also add to nova-drm (Thanks Danilo)
> - Did not take Reviewed-by + Acked-by because commit changed
>    substantively
> - Link to v1: https://patch.msgid.link/20260406-fix-kconfig-v1-1-8f634499f7f0@nvidia.com
> ---
>   drivers/gpu/drm/nova/Kconfig  | 1 +
>   drivers/gpu/nova-core/Kconfig | 1 +
>   2 files changed, 2 insertions(+)

Reviewed-by: John Hubbard <jhubbard@nvidia.com>

thanks,
-- 
John Hubbard

> 
> diff --git a/drivers/gpu/drm/nova/Kconfig b/drivers/gpu/drm/nova/Kconfig
> index 3e637ad7b5ba..a2028b8539d7 100644
> --- a/drivers/gpu/drm/nova/Kconfig
> +++ b/drivers/gpu/drm/nova/Kconfig
> @@ -4,6 +4,7 @@ config DRM_NOVA
>   	depends on DRM=y
>   	depends on PCI
>   	depends on RUST
> +	depends on !CPU_BIG_ENDIAN
>   	select AUXILIARY_BUS
>   	select NOVA_CORE
>   	default n
> diff --git a/drivers/gpu/nova-core/Kconfig b/drivers/gpu/nova-core/Kconfig
> index a4f2380654e2..d8456f8eaa05 100644
> --- a/drivers/gpu/nova-core/Kconfig
> +++ b/drivers/gpu/nova-core/Kconfig
> @@ -3,6 +3,7 @@ config NOVA_CORE
>   	depends on 64BIT
>   	depends on PCI
>   	depends on RUST
> +	depends on !CPU_BIG_ENDIAN
>   	select AUXILIARY_BUS
>   	select RUST_FW_LOADER_ABSTRACTIONS
>   	default n
> 
> ---
> base-commit: a7a080bb4236ebe577b6776d940d1717912ff6dd
> change-id: 20260406-fix-kconfig-3a059f622697
> 
> Best regards,
> --
> Eliot Courtney <ecourtney@nvidia.com>
> 




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] gpu: nova: require little endian
  2026-04-07  3:59 [PATCH v2] gpu: nova: require little endian Eliot Courtney
  2026-04-07  5:09 ` John Hubbard
@ 2026-04-07 11:57 ` Gary Guo
  2026-04-07 14:11 ` Joel Fernandes
  2026-04-07 14:22 ` Danilo Krummrich
  3 siblings, 0 replies; 5+ messages in thread
From: Gary Guo @ 2026-04-07 11:57 UTC (permalink / raw)
  To: Eliot Courtney, Danilo Krummrich, Alexandre Courbot, Alice Ryhl,
	David Airlie, Simona Vetter
  Cc: John Hubbard, Alistair Popple, Joel Fernandes, Timur Tabi,
	rust-for-linux, dri-devel, linux-kernel

On Tue Apr 7, 2026 at 4:59 AM BST, Eliot Courtney wrote:
> The driver already assumes little endian in a lot of locations. For
> example, all the code that reads RPCs out of the command queue just
> directly interprets the bytes.
> 
> Make this explicit in Kconfig.
> 
> Signed-off-by: Eliot Courtney <ecourtney@nvidia.com>

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

> ---
> The current code assumes little endian in a bunch of places. I think we
> should either explicitly decide to be generic on endianness or explicitly
> decide not to - having some handling sprinkled around in various
> locations seems confusing to me.
> 
> I believe that currently e.g. `RUST` transitively depends on
> !CPU_BIG_ENDIAN, so this is more about making the decision explicit for
> nova-core rather than fixing any kind of hole.
> ---
> Changes in v2:
> - Also add to nova-drm (Thanks Danilo)
> - Did not take Reviewed-by + Acked-by because commit changed
>   substantively
> - Link to v1: https://patch.msgid.link/20260406-fix-kconfig-v1-1-8f634499f7f0@nvidia.com
> ---
>  drivers/gpu/drm/nova/Kconfig  | 1 +
>  drivers/gpu/nova-core/Kconfig | 1 +
>  2 files changed, 2 insertions(+)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] gpu: nova: require little endian
  2026-04-07  3:59 [PATCH v2] gpu: nova: require little endian Eliot Courtney
  2026-04-07  5:09 ` John Hubbard
  2026-04-07 11:57 ` Gary Guo
@ 2026-04-07 14:11 ` Joel Fernandes
  2026-04-07 14:22 ` Danilo Krummrich
  3 siblings, 0 replies; 5+ messages in thread
From: Joel Fernandes @ 2026-04-07 14:11 UTC (permalink / raw)
  To: Eliot Courtney, Danilo Krummrich, Alexandre Courbot, Alice Ryhl,
	David Airlie, Simona Vetter
  Cc: John Hubbard, Alistair Popple, Timur Tabi, rust-for-linux,
	dri-devel, linux-kernel



On 4/6/2026 11:59 PM, Eliot Courtney wrote:
> The driver already assumes little endian in a lot of locations. For
> example, all the code that reads RPCs out of the command queue just
> directly interprets the bytes.
> 
> Make this explicit in Kconfig.
> 
> Signed-off-by: Eliot Courtney <ecourtney@nvidia.com>

Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>

thanks,

--
Joel Fernandes


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] gpu: nova: require little endian
  2026-04-07  3:59 [PATCH v2] gpu: nova: require little endian Eliot Courtney
                   ` (2 preceding siblings ...)
  2026-04-07 14:11 ` Joel Fernandes
@ 2026-04-07 14:22 ` Danilo Krummrich
  3 siblings, 0 replies; 5+ messages in thread
From: Danilo Krummrich @ 2026-04-07 14:22 UTC (permalink / raw)
  To: Eliot Courtney
  Cc: Alexandre Courbot, Alice Ryhl, David Airlie, Simona Vetter,
	John Hubbard, Alistair Popple, Joel Fernandes, Timur Tabi,
	rust-for-linux, dri-devel, linux-kernel

On Tue Apr 7, 2026 at 5:59 AM CEST, Eliot Courtney wrote:
> The driver already assumes little endian in a lot of locations. For
> example, all the code that reads RPCs out of the command queue just
> directly interprets the bytes.
>
> Make this explicit in Kconfig.
>
> Signed-off-by: Eliot Courtney <ecourtney@nvidia.com>
> ---
> The current code assumes little endian in a bunch of places. I think we
> should either explicitly decide to be generic on endianness or explicitly
> decide not to - having some handling sprinkled around in various
> locations seems confusing to me.
>
> I believe that currently e.g. `RUST` transitively depends on
> !CPU_BIG_ENDIAN, so this is more about making the decision explicit for
> nova-core rather than fixing any kind of hole.
> ---
> Changes in v2:
> - Also add to nova-drm (Thanks Danilo)
> - Did not take Reviewed-by + Acked-by because commit changed
>   substantively
> - Link to v1: https://patch.msgid.link/20260406-fix-kconfig-v1-1-8f634499f7f0@nvidia.com

Thanks for the new version -- I have one additional question in [1]. Otherwise,
going to pick up once -rc1 is out.

[1] https://lore.kernel.org/all/DHMVA3S2MZWV.1JN7WUBZLRWLV@kernel.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-04-07 14:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-07  3:59 [PATCH v2] gpu: nova: require little endian Eliot Courtney
2026-04-07  5:09 ` John Hubbard
2026-04-07 11:57 ` Gary Guo
2026-04-07 14:11 ` Joel Fernandes
2026-04-07 14:22 ` Danilo Krummrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox