qemu-rust.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] rust: pl011: correctly use interior mutability
@ 2025-01-17  9:26 Paolo Bonzini
  2025-01-17  9:26 ` [PATCH 01/10] rust: pl011: remove unnecessary "extern crate" Paolo Bonzini
                   ` (9 more replies)
  0 siblings, 10 replies; 29+ messages in thread
From: Paolo Bonzini @ 2025-01-17  9:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-rust

QOM devices are aliased from the moment that they are added to the
QOM tree, and therefore must not use &mut.  This has been a known
issue since the beginning of the Rust in QEMU project, and since
then a solution was developed in the form of BqlCell and BqlRefCell.

This series moves the MMIO code and registers from PL011State to
a new struct PL011Registers, which is wrapped with BqlRefCell.
This also allows to remove device-specific code from the device's
MemoryRegionOps callbacks, paving the way for MemoryRegionOps
bindings.

I am making this series a prerequisite to the usage of Resettable,
because it allows reset to reset take a shared reference to the
device.  Thus the Resettable implementation will not have to
temporarily take a mut reference.

Paolo


Paolo Bonzini (10):
  rust: pl011: remove unnecessary "extern crate"
  rust: pl011: hide unnecessarily "pub" items from outside pl011::device
  rust: pl011: extract conversion to RegisterOffset
  rust: pl011: extract CharBackend receive logic into a separate function
  rust: pl011: pull interrupt updates out of read/write ops
  rust: pl011: extract PL011Registers
  rust: pl011: wrap registers with BqlRefCell
  rust: pl011: remove duplicate definitions
  rust: pl011: pull device-specific code out of MemoryRegionOps callbacks
  rust: qdev: make reset take a shared reference

 rust/hw/char/pl011/src/device.rs       | 458 ++++++++++++++-----------
 rust/hw/char/pl011/src/device_class.rs |  52 +--
 rust/hw/char/pl011/src/lib.rs          |  61 ++--
 rust/hw/char/pl011/src/memory_ops.rs   |  23 +-
 rust/qemu-api/src/qdev.rs              |   2 +-
 5 files changed, 314 insertions(+), 282 deletions(-)

-- 
2.47.1



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

end of thread, other threads:[~2025-01-23 11:39 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-17  9:26 [PATCH 00/10] rust: pl011: correctly use interior mutability Paolo Bonzini
2025-01-17  9:26 ` [PATCH 01/10] rust: pl011: remove unnecessary "extern crate" Paolo Bonzini
2025-01-22 13:37   ` Zhao Liu
2025-01-17  9:26 ` [PATCH 02/10] rust: pl011: hide unnecessarily "pub" items from outside pl011::device Paolo Bonzini
2025-01-22 13:39   ` Zhao Liu
2025-01-17  9:26 ` [PATCH 03/10] rust: pl011: extract conversion to RegisterOffset Paolo Bonzini
2025-01-22 14:34   ` Zhao Liu
2025-01-22 15:00     ` Paolo Bonzini
2025-01-22 17:00       ` Zhao Liu
2025-01-17  9:26 ` [PATCH 04/10] rust: pl011: extract CharBackend receive logic into a separate function Paolo Bonzini
2025-01-22 14:59   ` Zhao Liu
2025-01-22 15:04     ` Paolo Bonzini
2025-01-17  9:26 ` [PATCH 05/10] rust: pl011: pull interrupt updates out of read/write ops Paolo Bonzini
2025-01-22 16:50   ` Zhao Liu
2025-01-22 16:49     ` Paolo Bonzini
2025-01-17  9:26 ` [PATCH 06/10] rust: pl011: extract PL011Registers Paolo Bonzini
2025-01-23  3:44   ` Zhao Liu
2025-01-23  8:07     ` Paolo Bonzini
2025-01-17  9:26 ` [PATCH 07/10] rust: pl011: wrap registers with BqlRefCell Paolo Bonzini
2025-01-23  5:47   ` Zhao Liu
2025-01-23  8:05     ` Paolo Bonzini
2025-01-23  9:24       ` Zhao Liu
2025-01-23 11:39         ` Paolo Bonzini
2025-01-17  9:26 ` [PATCH 08/10] rust: pl011: remove duplicate definitions Paolo Bonzini
2025-01-23  6:12   ` Zhao Liu
2025-01-17  9:26 ` [PATCH 09/10] rust: pl011: pull device-specific code out of MemoryRegionOps callbacks Paolo Bonzini
2025-01-23  6:18   ` Zhao Liu
2025-01-17  9:26 ` [PATCH 10/10] rust: qdev: make reset take a shared reference Paolo Bonzini
2025-01-23  6:19   ` Zhao Liu

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