rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v8 0/2] Add dma coherent allocator abstraction
@ 2025-01-08 12:27 Abdiel Janulgue
  2025-01-08 12:27 ` [PATCH v8 1/2] rust: error: Add EOVERFLOW Abdiel Janulgue
                   ` (2 more replies)
  0 siblings, 3 replies; 92+ messages in thread
From: Abdiel Janulgue @ 2025-01-08 12:27 UTC (permalink / raw)
  To: daniel.almeida, aliceryhl, robin.murphy, rust-for-linux
  Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Trevor Gross, Danilo Krummrich, Valentin Obst, open list,
	Christoph Hellwig, Marek Szyprowski, airlied,
	open list:DMA MAPPING HELPERS, Abdiel Janulgue

Changes since v7:
- Remove cpu_buf() and cpu_buf_mut() as exporting a r/w interface via
  a slice is undefined behaviour due to slice's requirement that the
  underlying pointer should not be modified (Alice Ryhl, Robin Murphy).
- Reintroduce r/w helpers instead which includes proper safety
  invariants (Daniel Almeida).
- Link to v7: https://lore.kernel.org/lkml/20241210221603.3174929-1-abdiel.janulgue@gmail.com/

Changes since v6:
- Include the dma_attrs in the constructor, use alloc::Flags as inpiration

Changes since v5:
- Remove unnecessary lifetime annotation when returning the CPU buffer.

Changes since v4:
- Documentation and example fixes, use Markdown formatting (Miguel Ojeda).
- Discard read()/write() helpers to remove bound on Copy and fix overhead
  (Daniel Almeida).
- Improve error-handling in the constructor block (Andreas Hindborg).

Changes since v3:
- Reject ZST types by checking the type size in the constructor in
  addition to requiring FromBytes/AsBytes traits for the type (Alice Ryhl).

Changes since v2:
- Fixed missing header for generating the bindings.

Changes since v1:
- Fix missing info in commit log where EOVERFLOW is used.
- Restrict the dma coherent allocator to numeric types for now for valid
  behaviour (Daniel Almeida).
- Build slice dynamically.

Abdiel Janulgue (2):
  rust: error: Add EOVERFLOW
  rust: add dma coherent allocator abstraction.

 rust/bindings/bindings_helper.h |   1 +
 rust/kernel/dma.rs              | 271 ++++++++++++++++++++++++++++++++
 rust/kernel/error.rs            |   1 +
 rust/kernel/lib.rs              |   1 +
 4 files changed, 274 insertions(+)
 create mode 100644 rust/kernel/dma.rs


base-commit: 0c5928deada15a8d075516e6e0d9ee19011bb000
-- 
2.43.0


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

end of thread, other threads:[~2025-02-20 16:52 UTC | newest]

Thread overview: 92+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-08 12:27 [PATCH v8 0/2] Add dma coherent allocator abstraction Abdiel Janulgue
2025-01-08 12:27 ` [PATCH v8 1/2] rust: error: Add EOVERFLOW Abdiel Janulgue
2025-01-08 12:27 ` [PATCH v8 2/2] rust: add dma coherent allocator abstraction Abdiel Janulgue
2025-01-08 13:59   ` Christoph Hellwig
2025-01-08 15:16     ` Miguel Ojeda
2025-01-08 15:18       ` Christoph Hellwig
2025-01-08 15:21         ` Danilo Krummrich
2025-01-09  8:08           ` Christoph Hellwig
2025-01-09  8:49             ` Danilo Krummrich
2025-01-10  8:39               ` Christoph Hellwig
2025-01-10 10:41                 ` Danilo Krummrich
2025-01-16 13:17                   ` Danilo Krummrich
2025-01-16 13:57                     ` Robin Murphy
2025-01-16 15:57                       ` Danilo Krummrich
2025-01-17 13:56                         ` Simona Vetter
2025-01-17 19:10                           ` Abdiel Janulgue
2025-01-28 10:14                             ` Daniel Almeida
2025-01-28  9:23                     ` Christoph Hellwig
2025-01-29 21:33                       ` Danilo Krummrich
2025-01-31  7:57                         ` Christoph Hellwig
2025-02-03  8:17                           ` Abdiel Janulgue
2025-02-04  5:29                             ` Christoph Hellwig
2025-01-30 13:19                       ` Philipp Stanner
2025-01-30 13:35                         ` Daniel Almeida
2025-01-30 13:43                           ` Philipp Stanner
2025-01-30 15:46                         ` Jason Gunthorpe
2025-01-30 16:11                           ` Greg KH
2025-01-30 17:24                             ` Jason Gunthorpe
2025-01-31  7:47                               ` Greg KH
2025-01-31 13:54                                 ` Jason Gunthorpe
2025-02-03 18:46                                   ` Hector Martin
2025-02-03 19:16                                     ` Jason Gunthorpe
2025-02-03 23:41                                       ` Hector Martin
2025-02-03 19:22                                     ` Paolo Bonzini
2025-02-03 23:05                                       ` Hector Martin
2025-02-05 18:52                                     ` On community influencing (was Re: [PATCH v8 2/2] rust: add dma coherent allocator abstraction.) Simona Vetter
2025-02-05 20:36                                       ` Dave Airlie
2025-02-06  9:19                                         ` Hector Martin
2025-02-06 17:58                                           ` Linus Torvalds
2025-02-07 12:16                                             ` Dr. Greg
2025-02-08  4:26                                               ` Steven Rostedt
2025-02-08  4:32                                                 ` Steven Rostedt
2025-02-08  8:31                                                 ` Hector Martin
2025-02-10  9:41                                                   ` Icenowy Zheng
2025-02-10 10:24                                                     ` Danilo Krummrich
2025-02-13  3:49                                                       ` Icenowy Zheng
2025-02-13  6:41                                                         ` Abdiel Janulgue
2025-02-13  9:50                                                           ` Icenowy Zheng
2025-02-13 11:34                                                         ` Danilo Krummrich
2025-02-08 20:44                                               ` Theodore Ts'o
2025-02-09  0:47                                                 ` Danilo Krummrich
2025-02-09  3:42                                                 ` comex
2025-02-13 10:20                                                 ` David Airlie
2025-02-20 16:24                                                   ` Simona Vetter
2025-02-20 16:37                                                     ` Jason Gunthorpe
2025-02-20 16:52                                                       ` Jarkko Sakkinen
2025-02-13 19:52                                                 ` Ronja Meyer
2025-02-13 19:22                                             ` 33KK
2025-02-06 19:37                                           ` Danilo Krummrich
2025-02-06 20:16                                             ` Hector Martin
2025-02-07 17:14                                               ` Konstantin Ryabitsev
2025-02-07 18:02                                                 ` Hector Martin
2025-02-07 18:16                                                   ` Konstantin Ryabitsev
2025-02-09  8:25                                                     ` Neal Gompa
2025-02-10 17:28                                                       ` Mark Brown
2025-02-14  7:10                                                         ` Neal Gompa
2025-02-14 19:49                                                           ` Al Viro
2025-02-19 15:03                                                           ` Mark Brown
2025-02-07 18:33                                                   ` Linus Torvalds
2025-02-07 19:18                                                     ` Hector Martin
2025-02-07 18:53                                                   ` Dr. David Alan Gilbert
2025-02-07  9:41                                       ` Hector Martin
2025-02-07 10:20                                         ` Hector Martin
2025-02-07 10:51                                           ` Greg KH
2025-02-07 13:49                                           ` Simona Vetter
2025-02-07 14:54                                             ` Hector Martin
2025-02-10  7:52                                             ` Simona Vetter
2025-02-08 23:55       ` [PATCH v8 2/2] rust: add dma coherent allocator abstraction Carlos Bilbao
2025-02-09  6:44         ` David Airlie
2025-02-09 16:19           ` Carlos Bilbao
2025-02-09 16:28             ` Carlos Bilbao
2025-01-08 18:08   ` Daniel Sedlak
2025-01-08 19:09     ` Daniel Almeida
2025-01-09 11:14       ` Abdiel Janulgue
2025-01-09 11:19         ` Miguel Ojeda
2025-01-09 11:32         ` Miguel Ojeda
2025-01-10  8:07           ` Abdiel Janulgue
2025-01-12  0:41   ` kernel test robot
2025-02-04 16:54   ` Thomas Hampton
2025-02-05  2:41     ` Thomas Hampton
2025-02-10  8:54 ` [PATCH v8 0/2] Add " Pyrex
2025-02-10  9:09   ` Danilo Krummrich

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