qemu/rust
Zhao Liu aef4e4637d rust/hpet: Borrow BqlRefCell<HPETRegisters> at top level
Lockless IO requires to lock the registers during MMIO access. So it's
necessary to get (or borrow) registers data at top level, and not to
borrow again in child function calls.

Change the argument types from BqlRefCell<HPETRegisters> to
&HPETRegisters/&mut HPETRegisters in child methods, and do borrow the
data once at top level.

This allows BqlRefCell<HPETRegisters> to be directly replaced with
Mutex<HPETRegisters> in subsequent steps without causing lock reentrancy
issues.

Note, passing reference instead of BqlRef/BqlRefMut because BqlRefMut
cannot be re-borrowed as BqlRef, though BqlRef/BqlRefMut themselves play
as the "guard". Passing reference is directly and the extra
bql::is_locked check could help to consolidate safety guarantee.

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20251113051937.4017675-19-zhao1.liu@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-27 10:11:10 +01:00
..
bits rust: remove unnecessary repetitive options 2025-12-27 10:11:09 +01:00
bql rust/bql: Ensure BQL locked early at BqlRefCell borrowing 2025-12-27 10:11:10 +01:00
chardev bql: add prelude 2025-12-27 10:11:10 +01:00
common common: add prelude 2025-12-27 10:11:09 +01:00
hw rust/hpet: Borrow BqlRefCell<HPETRegisters> at top level 2025-12-27 10:11:10 +01:00
migration rust/migration: Check name field in VMStateDescriptionBuilder 2025-12-27 10:11:10 +01:00
qemu-macros rust: remove unnecessary repetitive options 2025-12-27 10:11:09 +01:00
qom qom: add more to the prelude 2025-12-27 10:11:10 +01:00
system system: add prelude 2025-12-27 10:11:10 +01:00
tests bql: add prelude 2025-12-27 10:11:10 +01:00
trace rust: remove unnecessary repetitive options 2025-12-27 10:11:09 +01:00
util util: add prelude 2025-12-27 10:11:09 +01:00
.gitignore rust: add bindgen step as a meson dependency 2024-10-11 12:32:17 +02:00
Cargo.lock rust/hpet: add trace events 2025-12-27 10:11:10 +01:00
Cargo.toml rust: only leave leaf crates as workspace members 2025-10-28 13:02:26 +01:00
Kconfig rust: add PL011 device model 2024-11-05 14:18:15 +01:00
meson.build rust: move VMState from bql to migration 2025-10-14 11:04:00 +02:00
rustfmt.toml rust: add crate to expose bindings and interfaces 2024-10-11 12:32:17 +02:00