| b6cfba43 | 06-Apr-2026 |
Miguel Ojeda <ojeda@kernel.org> |
rust: bump Clippy's MSRV and clean `incompatible_msrv` allows
Following the Rust compiler bump, we can now update Clippy's MSRV we set in the configuration, which will improve the diagnostics it gen
rust: bump Clippy's MSRV and clean `incompatible_msrv` allows
Following the Rust compiler bump, we can now update Clippy's MSRV we set in the configuration, which will improve the diagnostics it generates.
Thus do so and clean a few of the `allow`s that are not needed anymore.
Reviewed-by: Tamir Duberstein <tamird@kernel.org> Acked-by: Danilo Krummrich <dakr@kernel.org> Reviewed-by: Gary Guo <gary@garyguo.net> Link: https://patch.msgid.link/20260405235309.418950-7-ojeda@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
show more ...
|
| a7a080bb | 31-Mar-2026 |
David Carlier <devnexen@gmail.com> |
gpu: nova-core: fix missing colon in SEC2 boot debug message
The SEC2 mailbox debug output formats MBOX1 without a colon separator, producing "MBOX10xdead" instead of "MBOX1: 0xdead". The GSP debug
gpu: nova-core: fix missing colon in SEC2 boot debug message
The SEC2 mailbox debug output formats MBOX1 without a colon separator, producing "MBOX10xdead" instead of "MBOX1: 0xdead". The GSP debug message a few lines above uses the correct format.
Fixes: 5949d419c193 ("gpu: nova-core: gsp: Boot GSP") Signed-off-by: David Carlier <devnexen@gmail.com> Link: https://patch.msgid.link/20260331103744.605683-1-devnexen@gmail.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
show more ...
|
| 8e6c3478 | 04-Apr-2026 |
Alexandre Courbot <acourbot@nvidia.com> |
gpu: nova-core: gsp: fix undefined behavior in command queue code
`driver_read_area` and `driver_write_area` are internal methods that return slices containing the area of the command queue buffer t
gpu: nova-core: gsp: fix undefined behavior in command queue code
`driver_read_area` and `driver_write_area` are internal methods that return slices containing the area of the command queue buffer that the driver has exclusive read or write access, respectively.
While their returned value is correct and safe to use, internally they temporarily create a reference to the whole command-buffer slice, including GSP-owned regions. These regions can change without notice, and thus creating a slice to them, even if never accessed, is undefined behavior.
Fix this by making these methods create slices to valid regions only.
Fixes: 75f6b1de8133 ("gpu: nova-core: gsp: Add GSP command queue bindings and handling") Reported-by: Danilo Krummrich <dakr@kernel.org> Closes: https://lore.kernel.org/all/DH47AVPEKN06.3BERUSJIB4M1R@kernel.org/ Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-by: Gary Guo <gary@garyguo.net> Link: https://patch.msgid.link/20260404-cmdq-ub-fix-v5-1-53d21f4752f5@nvidia.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
show more ...
|
| 79738589 | 25-Mar-2026 |
Alexandre Courbot <acourbot@nvidia.com> |
gpu: nova-core: convert PFB registers to kernel register macro
Convert all PFB registers to use the kernel's register macro and update the code accordingly.
NV_PGSP_QUEUE_HEAD was somehow caught in
gpu: nova-core: convert PFB registers to kernel register macro
Convert all PFB registers to use the kernel's register macro and update the code accordingly.
NV_PGSP_QUEUE_HEAD was somehow caught in the PFB section, so move it to its own section and convert it as well.
Reviewed-by: Eliot Courtney <ecourtney@nvidia.com> Reviewed-by: Gary Guo <gary@garyguo.net> Acked-by: Danilo Krummrich <dakr@kernel.org> Link: https://patch.msgid.link/20260325-b4-nova-register-v4-4-bdf172f0f6ca@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
show more ...
|
| 651c27d6 | 19-Mar-2026 |
Alexandre Courbot <acourbot@nvidia.com> |
gpu: nova-core: gsp: move Cmdq's DMA handle to a struct member
The command-queue structure has a `dma_handle` method that returns the DMA handle to the memory segment shared with the GSP. This works
gpu: nova-core: gsp: move Cmdq's DMA handle to a struct member
The command-queue structure has a `dma_handle` method that returns the DMA handle to the memory segment shared with the GSP. This works, but is not ideal for the following reasons:
- That method is effectively only ever called once, and is technically an accessor method since the handle doesn't change over time, - It feels a bit out-of-place with the other methods of `Cmdq` which only deal with the sending or receiving of messages, - The method has `pub(crate)` visibility, allowing other driver code to access this highly-sensitive handle.
Address all these issues by turning `dma_handle` into a struct member with `pub(super)` visibility. This keeps the method space focused, and also ensures the member is not visible outside of the modules that need it.
Reviewed-by: Eliot Courtney <ecourtney@nvidia.com> Reviewed-by: Danilo Krummrich <dakr@kernel.org> Link: https://patch.msgid.link/20260319-b4-cmdq-dma-handle-v1-1-57840b4a4f90@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
show more ...
|
| 7f3e836e | 20-Mar-2026 |
Danilo Krummrich <dakr@kernel.org> |
gpu: nova-core: convert Gsp::new() to use CoherentBox
Convert libos (LibosMemoryRegionInitArgument) and rmargs (GspArgumentsPadded) to use CoherentBox / Coherent::init() and simplify the initializat
gpu: nova-core: convert Gsp::new() to use CoherentBox
Convert libos (LibosMemoryRegionInitArgument) and rmargs (GspArgumentsPadded) to use CoherentBox / Coherent::init() and simplify the initialization. This also avoids separate initialization on the stack.
Reviewed-by: Gary Guo <gary@garyguo.net> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Link: https://patch.msgid.link/20260320194626.36263-8-dakr@kernel.org Signed-off-by: Danilo Krummrich <dakr@kernel.org>
show more ...
|
| a1945795 | 18-Mar-2026 |
Eliot Courtney <ecourtney@nvidia.com> |
gpu: nova-core: gsp: add mutex locking to Cmdq
Wrap `Cmdq`'s mutable state in a new struct `CmdqInner` and wrap that in a Mutex. This lets `Cmdq` methods take &self instead of &mut self, which lets
gpu: nova-core: gsp: add mutex locking to Cmdq
Wrap `Cmdq`'s mutable state in a new struct `CmdqInner` and wrap that in a Mutex. This lets `Cmdq` methods take &self instead of &mut self, which lets required commands be sent e.g. while unloading the driver.
The mutex is held over both send and receive in `send_command` to make sure that it doesn't get the reply of some other command that could have been sent just beforehand.
Reviewed-by: Zhi Wang <zhiw@nvidia.com> Tested-by: Zhi Wang <zhiw@nvidia.com> Signed-off-by: Eliot Courtney <ecourtney@nvidia.com> Link: https://patch.msgid.link/20260318-cmdq-locking-v5-5-18b37e3f9069@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
show more ...
|
| 9b786c7f | 18-Mar-2026 |
Eliot Courtney <ecourtney@nvidia.com> |
gpu: nova-core: gsp: make `Cmdq` a pinned type
Make `Cmdq` a pinned type. This is needed to use Mutex, which is needed to add locking to `Cmdq`.
Reviewed-by: Zhi Wang <zhiw@nvidia.com> Tested-by: Z
gpu: nova-core: gsp: make `Cmdq` a pinned type
Make `Cmdq` a pinned type. This is needed to use Mutex, which is needed to add locking to `Cmdq`.
Reviewed-by: Zhi Wang <zhiw@nvidia.com> Tested-by: Zhi Wang <zhiw@nvidia.com> Signed-off-by: Eliot Courtney <ecourtney@nvidia.com> Link: https://patch.msgid.link/20260318-cmdq-locking-v5-4-18b37e3f9069@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
show more ...
|
| c3bd240f | 18-Mar-2026 |
Eliot Courtney <ecourtney@nvidia.com> |
gpu: nova-core: gsp: add reply/no-reply info to `CommandToGsp`
Add type infrastructure to know what reply is expected from each `CommandToGsp`. Uses a marker type `NoReply` which does not implement
gpu: nova-core: gsp: add reply/no-reply info to `CommandToGsp`
Add type infrastructure to know what reply is expected from each `CommandToGsp`. Uses a marker type `NoReply` which does not implement `MessageFromGsp` to mark commands which don't expect a response.
Update `send_command` to wait for a reply and add `send_command_no_wait` which sends a command that has no reply, without blocking.
This prepares for adding locking to the queue.
Tested-by: Zhi Wang <zhiw@nvidia.com> Reviewed-by: Gary Guo <gary@garyguo.net> Signed-off-by: Eliot Courtney <ecourtney@nvidia.com> Link: https://patch.msgid.link/20260318-cmdq-locking-v5-3-18b37e3f9069@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
show more ...
|
| 67d9ef2b | 18-Mar-2026 |
Eliot Courtney <ecourtney@nvidia.com> |
gpu: nova-core: gsp: add `RECEIVE_TIMEOUT` constant for command queue
Remove magic numbers and add a default timeout for callers to use.
Tested-by: Zhi Wang <zhiw@nvidia.com> Reviewed-by: Gary Guo
gpu: nova-core: gsp: add `RECEIVE_TIMEOUT` constant for command queue
Remove magic numbers and add a default timeout for callers to use.
Tested-by: Zhi Wang <zhiw@nvidia.com> Reviewed-by: Gary Guo <gary@garyguo.net> Signed-off-by: Eliot Courtney <ecourtney@nvidia.com> Link: https://patch.msgid.link/20260318-cmdq-locking-v5-2-18b37e3f9069@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
show more ...
|
| 0073a17b | 09-Mar-2026 |
Danilo Krummrich <dakr@kernel.org> |
gpu: nova-core: gsp: fix UB in DmaGspMem pointer accessors
The DmaGspMem pointer accessor methods (gsp_write_ptr, gsp_read_ptr, cpu_read_ptr, cpu_write_ptr, advance_cpu_read_ptr, advance_cpu_write_p
gpu: nova-core: gsp: fix UB in DmaGspMem pointer accessors
The DmaGspMem pointer accessor methods (gsp_write_ptr, gsp_read_ptr, cpu_read_ptr, cpu_write_ptr, advance_cpu_read_ptr, advance_cpu_write_ptr) dereference a raw pointer to DMA memory, creating an intermediate reference before calling volatile read/write methods.
This is undefined behavior since DMA memory can be concurrently modified by the device.
Fix this by moving the implementations into a gsp_mem module in fw.rs that uses the dma_read!() / dma_write!() macros, making the original methods on DmaGspMem thin forwarding wrappers.
An alternative approach would have been to wrap the shared memory in Opaque, but that would have required even more unsafe code.
Since the gsp_mem module lives in fw.rs (to access firmware-specific binding field names), GspMem, Msgq and their relevant fields are temporarily widened to pub(super). This will be reverted once IoView projections are available.
Cc: Gary Guo <gary@garyguo.net> Closes: https://lore.kernel.org/nouveau/DGUT14ILG35P.1UMNRKU93JUM1@kernel.org/ Fixes: 75f6b1de8133 ("gpu: nova-core: gsp: Add GSP command queue bindings and handling") Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Link: https://patch.msgid.link/20260309225408.27714-1-dakr@kernel.org [ Use pub(super) where possible; replace bitwise-and with modulo operator analogous to [1]. - Danilo ] Link: https://lore.kernel.org/all/20260129-nova-core-cmdq1-v3-1-2ede85493a27@nvidia.com/ [1] Signed-off-by: Danilo Krummrich <dakr@kernel.org>
show more ...
|
| c7940c8b | 09-Mar-2026 |
Tim Kovalenko <tim.kovalenko@proton.me> |
gpu: nova-core: fix stack overflow in GSP memory allocation
The `Cmdq::new` function was allocating a `PteArray` struct on the stack and was causing a stack overflow with 8216 bytes.
Modify the `Pt
gpu: nova-core: fix stack overflow in GSP memory allocation
The `Cmdq::new` function was allocating a `PteArray` struct on the stack and was causing a stack overflow with 8216 bytes.
Modify the `PteArray` to calculate and write the Page Table Entries directly into the coherent DMA buffer one-by-one. This reduces the stack usage quite a lot.
Reported-by: Gary Guo <gary@garyguo.net> Closes: https://rust-for-linux.zulipchat.com/#narrow/channel/509436-Nova/topic/.60Cmdq.3A.3Anew.60.20uses.20excessive.20stack.20size/near/570375549 Link: https://lore.kernel.org/rust-for-linux/CANiq72mAQxbRJZDnik3Qmd4phvFwPA01O2jwaaXRh_T+2=L-qA@mail.gmail.com/ Fixes: f38b4f105cfc ("gpu: nova-core: Create initial Gsp") Acked-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Tim Kovalenko <tim.kovalenko@proton.me> Link: https://patch.msgid.link/20260309-drm-rust-next-v4-4-4ef485b19a4c@proton.me [ * Use PteArray::entry() in LogBuffer::new(), * Add TODO comment to use IoView projections once available, * Add PTE_ARRAY_SIZE constant to avoid duplication.
- Danilo ] Signed-off-by: Danilo Krummrich <dakr@kernel.org>
show more ...
|
| a544873c | 10-Mar-2026 |
John Hubbard <jhubbard@nvidia.com> |
gpu: nova-core: apply the one "use" item per line policy to commands.rs
As per [1], we need one "use" item per line, in order to reduce merge conflicts. Furthermore, we need a trailing ", //" in ord
gpu: nova-core: apply the one "use" item per line policy to commands.rs
As per [1], we need one "use" item per line, in order to reduce merge conflicts. Furthermore, we need a trailing ", //" in order to tell rustfmt(1) to leave it alone.
This does that for commands.rs, which is the only file in nova-core that has any remaining instances of the old style.
[1] https://docs.kernel.org/rust/coding-guidelines.html#imports
Reviewed-by: Gary Guo <gary@garyguo.net> Signed-off-by: John Hubbard <jhubbard@nvidia.com> Link: https://patch.msgid.link/20260310021125.117855-7-jhubbard@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
show more ...
|
| a247f8a1 | 10-Mar-2026 |
John Hubbard <jhubbard@nvidia.com> |
gpu: nova-core: add FbRange.len() and use it in boot.rs
A tiny simplification: now that FbLayout uses its own specific FbRange type, add an FbRange.len() method, and use that to (very slightly) simp
gpu: nova-core: add FbRange.len() and use it in boot.rs
A tiny simplification: now that FbLayout uses its own specific FbRange type, add an FbRange.len() method, and use that to (very slightly) simplify the calculation of Frts::frts_size initialization.
Suggested-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-by: Gary Guo <gary@garyguo.net> Signed-off-by: John Hubbard <jhubbard@nvidia.com> Link: https://patch.msgid.link/20260310021125.117855-3-jhubbard@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
show more ...
|
| 0499a382 | 06-Mar-2026 |
Eliot Courtney <ecourtney@nvidia.com> |
gpu: nova-core: gsp: add tests for continuation records
Add tests for continuation record splitting. They cover boundary conditions at the split points to make sure the right number of continuation
gpu: nova-core: gsp: add tests for continuation records
Add tests for continuation record splitting. They cover boundary conditions at the split points to make sure the right number of continuation records are made. They also check that the data concatenated is correct.
Tested-by: Zhi Wang <zhiw@nvidia.com> Signed-off-by: Eliot Courtney <ecourtney@nvidia.com> Link: https://patch.msgid.link/20260306-cmdq-continuation-v6-9-cc7b629200ee@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
show more ...
|
| e8f4f9ae | 06-Mar-2026 |
Eliot Courtney <ecourtney@nvidia.com> |
gpu: nova-core: gsp: support large RPCs via continuation record
Splits large RPCs if necessary and sends the remaining parts using continuation records. RPCs that do not need continuation records co
gpu: nova-core: gsp: support large RPCs via continuation record
Splits large RPCs if necessary and sends the remaining parts using continuation records. RPCs that do not need continuation records continue to write directly into the command buffer. Ones that do write into a staging buffer first, so there is one copy.
Continuation record for receive is not necessary to support at the moment because those replies do not need to be read and are currently drained by retrying `receive_msg` on `ERANGE`.
Signed-off-by: Eliot Courtney <ecourtney@nvidia.com> Link: https://patch.msgid.link/20260306-cmdq-continuation-v6-8-cc7b629200ee@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
show more ...
|
| adcb40c5 | 06-Mar-2026 |
Eliot Courtney <ecourtney@nvidia.com> |
gpu: nova-core: gsp: add `size` helper to `CommandToGsp`
Add a default method to `CommandToGsp` which computes the size of a command.
Tested-by: Zhi Wang <zhiw@nvidia.com> Signed-off-by: Eliot Cour
gpu: nova-core: gsp: add `size` helper to `CommandToGsp`
Add a default method to `CommandToGsp` which computes the size of a command.
Tested-by: Zhi Wang <zhiw@nvidia.com> Signed-off-by: Eliot Courtney <ecourtney@nvidia.com> Link: https://patch.msgid.link/20260306-cmdq-continuation-v6-7-cc7b629200ee@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
show more ...
|