Re: [RFC PATCH v5 0/8] Add Rust support, implement ARM PL011

2024-07-31 Thread Paolo Bonzini
On Wed, Jul 31, 2024 at 11:50 AM Manos Pitsidianakis wrote: > > On Fri, 26 Jul 2024 12:26, Manos Pitsidianakis > wrote: > >On Fri, 26 Jul 2024 at 11:19, Paolo Bonzini wrote: > >> As I said, I don't see the point in discussing this more, and I'm not > >> going to unless you provide a clear point

Re: [RFC PATCH v5 0/8] Add Rust support, implement ARM PL011

2024-07-31 Thread Manos Pitsidianakis
On Fri, 26 Jul 2024 12:26, Manos Pitsidianakis wrote: On Fri, 26 Jul 2024 at 11:19, Paolo Bonzini wrote: As I said, I don't see the point in discussing this more, and I'm not going to unless you provide a clear pointer to documentation that states the opposite. Same here. Next patch serie

Re: [RFC PATCH v5 0/8] Add Rust support, implement ARM PL011

2024-07-26 Thread Manos Pitsidianakis
On Fri, 26 Jul 2024 at 11:19, Paolo Bonzini wrote: > As I said, I don't see the point in discussing this more, and I'm not > going to unless you provide a clear pointer to documentation that > states the opposite. Same here.

Re: [RFC PATCH v5 0/8] Add Rust support, implement ARM PL011

2024-07-26 Thread Paolo Bonzini
On Fri, Jul 26, 2024 at 9:26 AM Manos Pitsidianakis wrote: > > On Thu, 25 Jul 2024 18:15, Paolo Bonzini wrote: > >On Thu, Jul 25, 2024 at 4:48 PM Manos Pitsidianakis > > wrote: > >> > pl011_receive (called by qemu_chr_fe_accept_input) creates a mutable > >> > reference that *overlaps* the lifetim

Re: [RFC PATCH v5 0/8] Add Rust support, implement ARM PL011

2024-07-26 Thread Manos Pitsidianakis
On Thu, 25 Jul 2024 18:15, Paolo Bonzini wrote: On Thu, Jul 25, 2024 at 4:48 PM Manos Pitsidianakis wrote: > pl011_receive (called by qemu_chr_fe_accept_input) creates a mutable > reference that *overlaps* the lifetime of the outer reference created > by pl011_read. This is undefined behavior.

Re: [RFC PATCH v5 0/8] Add Rust support, implement ARM PL011

2024-07-25 Thread Paolo Bonzini
On Thu, Jul 25, 2024 at 4:48 PM Manos Pitsidianakis wrote: > > pl011_receive (called by qemu_chr_fe_accept_input) creates a mutable > > reference that *overlaps* the lifetime of the outer reference created > > by pl011_read. This is undefined behavior. You're effectively writing: > > There is no o

Re: [RFC PATCH v5 0/8] Add Rust support, implement ARM PL011

2024-07-25 Thread Manos Pitsidianakis
On Thu, 25 Jul 2024 at 14:19, Paolo Bonzini wrote: > > On Thu, Jul 25, 2024 at 12:14 PM Manos Pitsidianakis > wrote: > > >Unfortunately that's a *mut, not a &mut. A &mut must be unique, so the cast > > >in pl011_read() is undefined behavior. > > > > Actually it's: > > > > unsafe { qemu_chr_fe_a

Re: [RFC PATCH v5 0/8] Add Rust support, implement ARM PL011

2024-07-25 Thread Paolo Bonzini
On Thu, Jul 25, 2024 at 12:14 PM Manos Pitsidianakis wrote: > >Unfortunately that's a *mut, not a &mut. A &mut must be unique, so the cast > >in pl011_read() is undefined behavior. > > Actually it's: > > unsafe { qemu_chr_fe_accept_input(&mut self.char_backend) }; > > And you can ensure there's

Re: [RFC PATCH v5 0/8] Add Rust support, implement ARM PL011

2024-07-25 Thread Manos Pitsidianakis
On Thu, 25 Jul 2024 12:50, Paolo Bonzini wrote: Il gio 25 lug 2024, 08:19 Manos Pitsidianakis < manos.pitsidiana...@linaro.org> ha scritto: >(before the call to qemu_chr_fe_accept_input): >// TODO: this causes a callback that creates another "&mut self". >// This is forbidden by Rust aliasing

Re: [RFC PATCH v5 0/8] Add Rust support, implement ARM PL011

2024-07-25 Thread Paolo Bonzini
Il gio 25 lug 2024, 08:19 Manos Pitsidianakis < manos.pitsidiana...@linaro.org> ha scritto: > >(before the call to qemu_chr_fe_accept_input): > >// TODO: this causes a callback that creates another "&mut self". > >// This is forbidden by Rust aliasing rules and has to be fixed > >// using interior

Re: [RFC PATCH v5 0/8] Add Rust support, implement ARM PL011

2024-07-24 Thread Manos Pitsidianakis
On Wed, 24 Jul 2024 13:34, Paolo Bonzini wrote: On Wed, Jul 24, 2024 at 11:58 AM Manos Pitsidianakis wrote: >In my opinion we should start with cargo workspaces as the >known-imperfect (but good enough) solution, so that it could be evolved >later. It is important that any change that deviate

Re: [RFC PATCH v5 0/8] Add Rust support, implement ARM PL011

2024-07-24 Thread Paolo Bonzini
On Wed, Jul 24, 2024 at 11:58 AM Manos Pitsidianakis wrote: > > Hello Paolo, thank you for the thorough response, > > On Tue, 23 Jul 2024 18:07, Paolo Bonzini wrote: > >On 7/22/24 13:43, Manos Pitsidianakis wrote: > >> Changes from v4->v5: > >> - Added CI patch from Alex Benee > >> - Removed all

Re: [RFC PATCH v5 0/8] Add Rust support, implement ARM PL011

2024-07-24 Thread Manos Pitsidianakis
Hello Paolo, thank you for the thorough response, On Tue, 23 Jul 2024 18:07, Paolo Bonzini wrote: On 7/22/24 13:43, Manos Pitsidianakis wrote: Changes from v4->v5: - Added CI patch from Alex Benee - Removed all cargo use, use meson rust support - Added Kconfig logic The following requests fr

Re: [RFC PATCH v5 0/8] Add Rust support, implement ARM PL011

2024-07-23 Thread Paolo Bonzini
On 7/22/24 13:43, Manos Pitsidianakis wrote: Changes from v4->v5: - Added CI patch from Alex Benee - Removed all cargo use, use meson rust support - Added Kconfig logic The following requests from the v4 review have also been evaluated (good!): ✅ module structure should resemble the C part of

[RFC PATCH v5 0/8] Add Rust support, implement ARM PL011

2024-07-22 Thread Manos Pitsidianakis
Changes from v4->v5: - Added CI patch from Alex Benee - Removed all cargo use, use meson rust support - Added Kconfig logic Changes from v3->v4: - Add rust-specific files to .gitattributes - Added help text to scripts/cargo_wrapper.py arguments (thanks Stephan) - Split bindings separate crate - Ad