Skip to contentSkip to conversation

gpu: nova: require little endian

PATCH Applied Eliot Courtney 6 participants 8 messages Apr 7 – Apr 29

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 gpu: nova: require little endian

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.

---
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/[email protected]

---
 drivers/gpu/drm/nova/Kconfig  | 1 +
 drivers/gpu/nova-core/Kconfig | 1 +
 2 files changed, 2 insertions(+)
drivers/gpu/drm/nova/Kconfig +1 -0
index 3e637ad7b5ba..a2028b8539d7 100644
@@ -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
drivers/gpu/nova-core/Kconfig +1 -0
index a4f2380654e2..d8456f8eaa05 100644
@@ -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,

Signature · 1 line
Eliot Courtney <[email protected]>
Reviewed-by on v2 1/1
#1 lore raw
Quoted 22 lines · 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.

---
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/[email protected]

Quoted 4 lines
---
  drivers/gpu/drm/nova/Kconfig  | 1 +
  drivers/gpu/nova-core/Kconfig | 1 +
  2 files changed, 2 insertions(+)

thanks,

Signature · 1 line
John Hubbard
Quoted 34 lines
drivers/gpu/drm/nova/Kconfig +1 -0
index 3e637ad7b5ba..a2028b8539d7 100644
@@ -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
drivers/gpu/nova-core/Kconfig +1 -1
index a4f2380654e2..d8456f8eaa05 100644
@@ -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 <[email protected]>

reviewer Reviewed-by on v2 1/1
#2 lore raw
In reply to Eliot Courtney
Quoted 7 lines · 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.

Quoted 19 lines

---
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/[email protected]

---
 drivers/gpu/drm/nova/Kconfig  | 1 +
 drivers/gpu/nova-core/Kconfig | 1 +
 2 files changed, 2 insertions(+)
maintainer
#4 lore raw
In reply to Eliot Courtney
Quoted 13 lines · 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.

---
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.

Quoted 9 lines

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/[email protected]

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/[email protected]/

#5 lore raw
Quoted 24 lines · Danilo Krummrich
Quoted 13 lines · 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.

---
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.

Quoted 9 lines

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/[email protected]

Quoted 4 lines

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/[email protected]/

Thanks. I think others have answered the question (Thanks Timur and Joel) so hopefully all good.

maintainer Applied
#7 lore raw
In reply to Eliot Courtney
Quoted 1 line · Eliot Courtney

[PATCH v2] gpu: nova: require little endian

Applied, thanks!

Branch: drm-rust-next
Tree: https://gitlab.freedesktop.org/drm/rust/kernel.git

[1/1] gpu: nova: require little endian

      commit: d39e22cf87b6

The patch will appear in the next linux-next integration (typically within 24 hours on weekdays).

The patch is queued up for the upcoming merge window for the next major kernel release.