lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250304-nova_timer-v2-0-8fb13f3f8cff@nvidia.com>
Date: Tue, 04 Mar 2025 22:53:56 +0900
From: Alexandre Courbot <acourbot@...dia.com>
To: Danilo Krummrich <dakr@...nel.org>, David Airlie <airlied@...il.com>, 
 John Hubbard <jhubbard@...dia.com>, Ben Skeggs <bskeggs@...dia.com>, 
 Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>, 
 Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>, 
 Björn Roy Baron <bjorn3_gh@...tonmail.com>, 
 Benno Lossin <benno.lossin@...ton.me>, 
 Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>, 
 Trevor Gross <tmgross@...ch.edu>, Simona Vetter <simona@...ll.ch>
Cc: linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org, 
 nouveau@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org, 
 Alexandre Courbot <acourbot@...dia.com>
Subject: [RFC PATCH v2 0/5] gpu: nova-core: register definitions and basic
 timer and falcon devices

Hi everyone,

This RFC is based on top of Danilo's initial driver stub series
v4 [1] and adds very basic support for the Timer and Falcon devices, in
order to see and "feel" the proposed register access abstractions and
discuss them before moving forward with GSP initialization.

It is kept simple and short on purpose, to avoid bumping into a wall
with much more device code because my assumptions were incorrect.

The main addition is the nv_reg!() register definition macro, which aims
at providing safe and convenient access to all useful registers and
their fields. I elaborate on its definition in the patch that introduces
it ; it is also probably better to look at all the register definitions
to understand how it can be used, and the services it provides. Right
now it provides accessors and builders for all the fields of a register.
It will probably need to be extended with more operations as we deem
them useful.

The timer device has not changed much from v1, with the exception of
having its own Timestamp type to easily obtain Durations between two
samples.

The falcon implementation is still super incomplete, and just designed
to illustrate how the register macros can be used. I have more progress
in a private branch, but want to keep the focus on the nv_reg!() macro
for this review since the rest will ultimately depend on it.

It would be charitable to say that my Rust macro skills are lacking ; so
please point out any deficiency in its definition. I am also not
entirely sure about the syntax for register definition - I would like to
keep things simple and close to OpenRM (notably for the mask
definitions) to make it easier to port definition from it into Nova.

[1] https://lore.kernel.org/nouveau/20250226175552.29381-1-dakr@kernel.org/T/

Signed-off-by: Alexandre Courbot <acourbot@...dia.com>
---
Changes in v2:
- Don't hold the Bar guard in methods that can sleep.
- Added a Timestamp type for Timer to safely and easily get durations
  between two measurements.
- Added a macro to make register definitions easier.
- Added a very basic falcon implementation to define more registers and
  exercise the register definition macro.
- Link to v1: https://lore.kernel.org/r/20250217-nova_timer-v1-0-78c5ace2d987@nvidia.com

---
Alexandre Courbot (5):
      rust: add useful ops for u64
      rust: make ETIMEDOUT error available
      gpu: nova-core: add register definition macro
      gpu: nova-core: add basic timer device
      gpu: nova-core: add falcon register definitions and probe code

 drivers/gpu/nova-core/driver.rs    |   4 +-
 drivers/gpu/nova-core/falcon.rs    | 124 +++++++++++++++
 drivers/gpu/nova-core/gpu.rs       |  70 ++++++++-
 drivers/gpu/nova-core/nova_core.rs |   2 +
 drivers/gpu/nova-core/regs.rs      | 311 ++++++++++++++++++++++++++++++++-----
 drivers/gpu/nova-core/timer.rs     | 124 +++++++++++++++
 rust/kernel/error.rs               |   1 +
 rust/kernel/lib.rs                 |   1 +
 rust/kernel/num.rs                 |  43 +++++
 9 files changed, 639 insertions(+), 41 deletions(-)
---
base-commit: 3ac10b625b709d59556cd2c1bf8a009c2bfdbefc
change-id: 20250216-nova_timer-c69430184f54

Best regards,
-- 
Alexandre Courbot <acourbot@...dia.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ