Re: [PATCH 10/10] rust: bindings for MemoryRegionOps

2025-02-10 Thread Philippe Mathieu-Daudé
On 6/2/25 11:19, Paolo Bonzini wrote: On 2/6/25 11:02, Philippe Mathieu-Daudé wrote: Could we always make .valid_sizes() explicit? Yes (for example build() could even fail to compile if you don't have impl_sizes/valid_sizes set), but why do you want that? I'm not even sure that all cases of .v

Re: [PATCH 10/10] rust: bindings for MemoryRegionOps

2025-02-06 Thread Philippe Mathieu-Daudé
On 6/2/25 09:46, Paolo Bonzini wrote: On Thu, Feb 6, 2025 at 9:40 AM Philippe Mathieu-Daudé wrote: Hi Paolo, On 17/1/25 20:40, Paolo Bonzini wrote: Signed-off-by: Paolo Bonzini --- rust/hw/char/pl011/src/device.rs | 43 +++--- rust/hw/char/pl011/src/lib.rs| 1 - rust/h

Re: [PATCH 10/10] rust: bindings for MemoryRegionOps

2025-02-06 Thread Paolo Bonzini
On 2/6/25 11:02, Philippe Mathieu-Daudé wrote: Could we always make .valid_sizes() explicit? Yes (for example build() could even fail to compile if you don't have impl_sizes/valid_sizes set), but why do you want that? I'm not even sure that all cases of .valid.max_access_size=4 are correct...

Re: [PATCH 10/10] rust: bindings for MemoryRegionOps

2025-02-06 Thread Paolo Bonzini
On 2/6/25 10:15, Zhao Liu wrote: Throughout the entire holiday, I couldn't think of a better way to express this. I find it particularly useful when wrapping multiple callbacks. In the future, I want to explore more use cases where this pattern can be applied. Thanks very much. Despite having

Re: [PATCH 10/10] rust: bindings for MemoryRegionOps

2025-02-06 Thread Zhao Liu
> > > +pub struct MemoryRegionOps( > > > +bindings::MemoryRegionOps, > > > +// Note: quite often you'll see PhantomData mentioned when > > > discussing > > > +// covariance and contravariance; you don't need any of those to > > > understand > > > +// this usage of PhantomData. Qu

Re: [PATCH 10/10] rust: bindings for MemoryRegionOps

2025-02-06 Thread Paolo Bonzini
On Thu, Feb 6, 2025 at 9:40 AM Philippe Mathieu-Daudé wrote: > > Hi Paolo, > > On 17/1/25 20:40, Paolo Bonzini wrote: > > Signed-off-by: Paolo Bonzini > > --- > > rust/hw/char/pl011/src/device.rs | 43 +++--- > > rust/hw/char/pl011/src/lib.rs| 1 - > > rust/hw/char/pl011/src/me

Re: [PATCH 10/10] rust: bindings for MemoryRegionOps

2025-02-06 Thread Philippe Mathieu-Daudé
Hi Paolo, On 17/1/25 20:40, Paolo Bonzini wrote: Signed-off-by: Paolo Bonzini --- rust/hw/char/pl011/src/device.rs | 43 +++--- rust/hw/char/pl011/src/lib.rs| 1 - rust/hw/char/pl011/src/memory_ops.rs | 36 - rust/qemu-api/meson.build| 1 + rust/qemu-api/

Re: [PATCH 10/10] rust: bindings for MemoryRegionOps

2025-01-27 Thread Paolo Bonzini
On Mon, Jan 27, 2025 at 12:53 PM Zhao Liu wrote: > > @@ -490,20 +490,24 @@ impl PL011State { > > /// location/instance. All its fields are expected to hold unitialized > > /// values with the sole exception of `parent_obj`. > > unsafe fn init(&mut self) { > > +static PL011_O

Re: [PATCH 10/10] rust: bindings for MemoryRegionOps

2025-01-27 Thread Zhao Liu
On Fri, Jan 17, 2025 at 08:40:03PM +0100, Paolo Bonzini wrote: > Date: Fri, 17 Jan 2025 20:40:03 +0100 > From: Paolo Bonzini > Subject: [PATCH 10/10] rust: bindings for MemoryRegionOps > X-Mailer: git-send-email 2.47.1 > > Signed-off-by: Paolo Bonzini > --- > rust/hw/

[PATCH 10/10] rust: bindings for MemoryRegionOps

2025-01-17 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- rust/hw/char/pl011/src/device.rs | 43 +++--- rust/hw/char/pl011/src/lib.rs| 1 - rust/hw/char/pl011/src/memory_ops.rs | 36 - rust/qemu-api/meson.build| 1 + rust/qemu-api/src/lib.rs | 1 + rust/qemu-api/src/memory.