[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 00/10] rust: pl011: correctly use interior mutability
From: |
Paolo Bonzini |
Subject: |
[PATCH 00/10] rust: pl011: correctly use interior mutability |
Date: |
Fri, 17 Jan 2025 10:26:47 +0100 |
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
- [PATCH 00/10] rust: pl011: correctly use interior mutability,
Paolo Bonzini <=
- [PATCH 01/10] rust: pl011: remove unnecessary "extern crate", Paolo Bonzini, 2025/01/17
- [PATCH 02/10] rust: pl011: hide unnecessarily "pub" items from outside pl011::device, Paolo Bonzini, 2025/01/17
- [PATCH 03/10] rust: pl011: extract conversion to RegisterOffset, Paolo Bonzini, 2025/01/17
- [PATCH 04/10] rust: pl011: extract CharBackend receive logic into a separate function, Paolo Bonzini, 2025/01/17
- [PATCH 06/10] rust: pl011: extract PL011Registers, Paolo Bonzini, 2025/01/17
- [PATCH 05/10] rust: pl011: pull interrupt updates out of read/write ops, Paolo Bonzini, 2025/01/17
- [PATCH 07/10] rust: pl011: wrap registers with BqlRefCell, Paolo Bonzini, 2025/01/17
- [PATCH 10/10] rust: qdev: make reset take a shared reference, Paolo Bonzini, 2025/01/17
- [PATCH 08/10] rust: pl011: remove duplicate definitions, Paolo Bonzini, 2025/01/17
- [PATCH 09/10] rust: pl011: pull device-specific code out of MemoryRegionOps callbacks, Paolo Bonzini, 2025/01/17