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: <20250514105734.3898411-1-andrewjballance@gmail.com>
Date: Wed, 14 May 2025 05:57:28 -0500
From: Andrew Ballance <andrewjballance@...il.com>
To: dakr@...nel.org,
	a.hindborg@...nel.org,
	airlied@...il.com,
	akpm@...ux-foundation.org,
	alex.gaynor@...il.com,
	aliceryhl@...gle.com,
	andrewjballance@...il.com,
	andriy.shevchenko@...ux.intel.com,
	arnd@...db.de,
	benno.lossin@...ton.me,
	bhelgaas@...gle.com,
	bjorn3_gh@...tonmail.com,
	boqun.feng@...il.com,
	daniel.almeida@...labora.com,
	fujita.tomonori@...il.com,
	gary@...yguo.net,
	gregkh@...uxfoundation.org,
	kwilczynski@...nel.org,
	me@...enk.dev,
	ojeda@...nel.org,
	raag.jadav@...el.com,
	rafael@...nel.org,
	simona@...ll.ch,
	tmgross@...ch.edu
Cc: dri-devel@...ts.freedesktop.org,
	linux-kernel@...r.kernel.org,
	linux-pci@...r.kernel.org,
	nouveau@...ts.freedesktop.org,
	rust-for-linux@...r.kernel.org
Subject: [PATCH v2 0/6] rust: add support for port io

currently the rust `Io` type maps to the c read{b, w, l, q}/write{b, w, l, q}
functions and have no support for port io. this can be a problem for pci::Bar
because the pointer returned by pci_iomap can be either PIO or MMIO [0].

this patch series splits the `Io` type into `Io`, and `MMIo`. `Io` can be
used to access PIO or MMIO. `MMIo` can only access memory mapped IO but
might, depending on the arch, be faster than `Io`. and updates pci::Bar,
so that it is generic over Io and, a user can optionally give a compile
time hint about the type of io. 

Link: https://docs.kernel.org/6.11/driver-api/pci/pci.html#c.pci_iomap [0]

changes in v2:
  - remove `PortIo`
  - typo fixes
  - squash "fixup" patches so that patches will not introduce build fails
  - move some changes across patches so that build will not fail
  - changes macro define in rust/helpers/io.c to use full rust name
  - specialize `io_backend` for the x86 case
  - do not modify lib/iomap.c
  - rebased on v6.15-rc6

Link to v1: https://lore.kernel.org/rust-for-linux/20250509031524.2604087-1-andrewjballance@gmail.com/  

Andrew Ballance (3):
  rust: io: add new Io type
  rust: io: add from_raw_cookie functions
  rust: pci: make Bar generic over Io

Fiona Behrens (3):
  rust: helpers: io: use macro to generate io accessor functions
  rust: io: make Io use IoAccess trait
  rust: io: implement Debug for IoRaw and add some doctests

 drivers/gpu/nova-core/driver.rs |   4 +-
 drivers/gpu/nova-core/regs.rs   |   1 +
 rust/helpers/io.c               | 112 ++----
 rust/kernel/devres.rs           |   4 +-
 rust/kernel/io.rs               | 645 +++++++++++++++++++++++---------
 rust/kernel/pci.rs              | 101 +++--
 samples/rust/rust_driver_pci.rs |   6 +-
 7 files changed, 595 insertions(+), 278 deletions(-)


base-commit: 82f2b0b97b36ee3fcddf0f0780a9a0825d52fec3
-- 
2.49.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ