rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v8 0/3] rust: Add local_irq abstraction, SpinLockIrq
@ 2024-10-18 23:22 Lyude Paul
  2024-10-18 23:22 ` [PATCH v8 1/3] rust: Introduce local_irq module Lyude Paul
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Lyude Paul @ 2024-10-18 23:22 UTC (permalink / raw)
  To: rust-for-linux
  Cc: Danilo Krummrich, airlied, Ingo Molnar, Will Deacon, Waiman Long,
	Peter Zijlstra, Thomas Gleixner, linux-kernel, Miguel Ojeda,
	Alex Gaynor, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross

This adds a token for annotating contexts where IRQs may be disabled on
non-PREEMPT_RT kernels, a way to use these tokens with Lock types, and
introduces bindings for spin_lock_irqsave() and
spin_unlock_irqrestore().

This patch series depends on the NotThreadSafe type from Alice:

https://lore.kernel.org/rust-for-linux/20240808-alice-file-v9-1-2cb7b934e0e1@google.com/

(Please re-review, since there's been some changes here!)

Lyude Paul (3):
  rust: Introduce local_irq module
  rust: sync: Introduce lock::Backend::Context and
    lock::BackendWithContext
  rust: sync: Add SpinLockIrq

 rust/helpers/helpers.c            |   1 +
 rust/helpers/irq.c                |   8 ++
 rust/helpers/spinlock.c           |  14 +++
 rust/kernel/lib.rs                |   1 +
 rust/kernel/local_irq.rs          |  56 +++++++++++
 rust/kernel/sync.rs               |   2 +-
 rust/kernel/sync/lock.rs          | 118 ++++++++++++++++++++++-
 rust/kernel/sync/lock/mutex.rs    |   1 +
 rust/kernel/sync/lock/spinlock.rs | 150 ++++++++++++++++++++++++++++++
 9 files changed, 345 insertions(+), 6 deletions(-)
 create mode 100644 rust/helpers/irq.c
 create mode 100644 rust/kernel/local_irq.rs


base-commit: 6ce162a002657910104c7a07fb50017681bc476c
prerequisite-patch-id: 4e3cfb97c9dc94e99912e67f383497848ac6f81d
-- 
2.47.0


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

end of thread, other threads:[~2024-10-19  1:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-18 23:22 [PATCH v8 0/3] rust: Add local_irq abstraction, SpinLockIrq Lyude Paul
2024-10-18 23:22 ` [PATCH v8 1/3] rust: Introduce local_irq module Lyude Paul
2024-10-19  1:53   ` Boqun Feng
2024-10-18 23:22 ` [PATCH v8 2/3] rust: sync: Introduce lock::Backend::Context and lock::BackendWithContext Lyude Paul
2024-10-19  1:03   ` Boqun Feng
2024-10-18 23:22 ` [PATCH v8 3/3] rust: sync: Add SpinLockIrq Lyude Paul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).