[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 05/26] rust: add bindings for interrupt sources
From: |
Zhao Liu |
Subject: |
Re: [PATCH 05/26] rust: add bindings for interrupt sources |
Date: |
Tue, 10 Dec 2024 15:25:42 +0800 |
On Mon, Dec 09, 2024 at 01:36:56PM +0100, Paolo Bonzini wrote:
> Date: Mon, 9 Dec 2024 13:36:56 +0100
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH 05/26] rust: add bindings for interrupt sources
> X-Mailer: git-send-email 2.47.1
>
> The InterruptSource bindings let us call qemu_set_irq() and sysbus_init_irq()
> as safe code.
>
> Interrupt sources, qemu_irq in C code, are pointers to IRQState objects.
> They are QOM link properties and can be written to outside the control
> of the device (i.e. from a shared reference); therefore they must be
> interior-mutable in Rust. Since thread-safety is provided by the BQL,
> what we want here is the newly-introduced BqlCell. A pointer to the
> contents of the BqlCell (an IRQState**, or equivalently qemu_irq*)
> is then passed to the C sysbus_init_irq function.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> rust/hw/char/pl011/src/device.rs | 22 ++++----
> rust/qemu-api/meson.build | 2 +
> rust/qemu-api/src/irq.rs | 91 ++++++++++++++++++++++++++++++++
> rust/qemu-api/src/lib.rs | 2 +
> rust/qemu-api/src/sysbus.rs | 27 ++++++++++
> 5 files changed, 134 insertions(+), 10 deletions(-)
> create mode 100644 rust/qemu-api/src/irq.rs
> create mode 100644 rust/qemu-api/src/sysbus.rs
>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
- [PATCH 00/26] rust: bundle of prerequisites for HPET implementation, Paolo Bonzini, 2024/12/09
- [PATCH 01/26] bql: check that the BQL is not dropped within marked sections, Paolo Bonzini, 2024/12/09
- [PATCH 02/26] rust: cell: add BQL-enforcing Cell variant, Paolo Bonzini, 2024/12/09
- [PATCH 03/26] rust: cell: add BQL-enforcing RefCell variant, Paolo Bonzini, 2024/12/09
- [PATCH 05/26] rust: add bindings for interrupt sources, Paolo Bonzini, 2024/12/09
- Re: [PATCH 05/26] rust: add bindings for interrupt sources,
Zhao Liu <=
- [PATCH 07/26] rust: qom: add default definitions for ObjectImpl, Paolo Bonzini, 2024/12/09
- [PATCH 04/26] rust: define prelude, Paolo Bonzini, 2024/12/09
- [PATCH 08/26] rust: qom: rename Class trait to ClassInitImpl, Paolo Bonzini, 2024/12/09
- [PATCH 06/26] rust: add a bit operation module, Paolo Bonzini, 2024/12/09
- [PATCH 10/26] rust: qom: move ClassInitImpl to the instance side, Paolo Bonzini, 2024/12/09