mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] radix3 and ELF cleanup, pre-r000
@ 2026-09-13 19:54 John Hubbard
  2026-09-13 19:54 ` [PATCH 1/3] gpu: nova-core: extract radix3 page table into its own module John Hubbard
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: John Hubbard @ 2026-09-13 19:54 UTC (permalink / raw)
  To: Danilo Krummrich, Alexandre Courbot
  Cc: Timur Tabi, Alistair Popple, Eliot Courtney, Zhi Wang,
	David Airlie, Simona Vetter, Bjorn Helgaas, Miguel Ojeda,
	Alex Gaynor, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	nova-gpu, LKML, John Hubbard

I split these three cleanup patches out of the r000 series [1] in order
to shrink it slightly. r000 will still build on top of these, but
because I have some patch re-ordering and cleanup to do there, let's get
this easier small set posted and hopefully merged in the meantime.

This is based on drm-rust-next at commit d669686f8170 ("gpu: nova-core:
mm: Add BAR1 memory management self-tests"). No other dependencies.

In order to boot the GSP, nova-core loads the GSP firmware image into
system memory, and the GPU copies it into the framebuffer, the GPU's own
memory. The GPU finds the GSP firmware image's pages via "radix3", a
three-level page table of 4 KiB pages that the driver builds. Today the
table exists as fields within the GSP firmware wrapper, which is fine
because there is only one radix3 consumer.

The larger r000 series, however, introduces a second radix3 caller: the
ucodes firmware image. That is because the GSP has been changed, so that
it automatically fetches the subset of ucodes that it requires, thus
reducing the size of the GSP image. This is a helpful change for the
firmware situation overall, but it does require nova-core to load and
provide ucodes, in much the same way that it was loading and providing
the GSP firmware image.

So the first patch splits out radix3 so that it can be called by the two
separate code paths. The other two patches fix problems I found in the
same code.

* Patch 1 moves the radix3 table into a type of its own that maps any
  buffer, and makes the GSP firmware wrapper hold one. No functional
  change.

* Patch 2 allocates each level of the table as a whole number of 4 KiB
  pages and zeroes the whole level. The booter, the firmware stage that
  copies the image on Turing, Ampere and Ada GPUs, reads each level a
  whole page at a time, so today it reads stale kernel memory from the
  unused rest of a level's last page.

* Patch 3 renames the field for the framebuffer range that holds the GSP
  firmware image, from elf to fw_image. After this,

      $ cd drivers/gpu/nova-core
      $ grep -iw ELF

  comes up empty. :)

[1] https://lore.kernel.org/all/20260822015448.238214-1-jhubbard@nvidia.com/

John Hubbard (3):
  gpu: nova-core: extract radix3 page table into its own module
  gpu: nova-core: zero-pad radix3 page table levels to page boundary
  gpu: nova-core: rename the FbRanges elf field to fw_image

 drivers/gpu/nova-core/fb.rs              |  18 +--
 drivers/gpu/nova-core/firmware.rs        |   1 +
 drivers/gpu/nova-core/firmware/gsp.rs    | 107 ++---------------
 drivers/gpu/nova-core/firmware/radix3.rs | 140 +++++++++++++++++++++++
 drivers/gpu/nova-core/gsp/fw.rs          |   6 +-
 5 files changed, 164 insertions(+), 108 deletions(-)
 create mode 100644 drivers/gpu/nova-core/firmware/radix3.rs


base-commit: d669686f8170c234edf12212fac9180ea18b1448
-- 
2.55.0


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

end of thread, other threads:[~2026-09-14  0:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-13 19:54 [PATCH 0/3] radix3 and ELF cleanup, pre-r000 John Hubbard
2026-09-13 19:54 ` [PATCH 1/3] gpu: nova-core: extract radix3 page table into its own module John Hubbard
2026-09-13 20:36   ` Gary Guo
2026-09-13 20:56     ` John Hubbard
2026-09-14  0:44       ` Alexandre Courbot
2026-09-13 19:54 ` [PATCH 2/3] gpu: nova-core: zero-pad radix3 page table levels to page boundary John Hubbard
2026-09-13 19:54 ` [PATCH 3/3] gpu: nova-core: rename the FbRanges elf field to fw_image John Hubbard

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

all inboxes | Powered by JetHome®