[PATCH v2] Add -build-info and -build-info-json CLI arguments

2024-09-22 Thread Manos Pitsidianakis
of QEMU and need a way to properly differentiate them. Because there's always the chance someone will want to consume an interface programmatically, also add a -json option that does the same but outputs a machine-readable JSON object. Signed-off-by: Manos Pitsidianakis --- Changes

[PATCH] Add -build-info and -build-info-json CLI arguments

2024-09-22 Thread Manos Pitsidianakis
of QEMU and need a way to properly differentiate them. Because there's always the chance someone will want to consume an interface programmatically, also add a -json option that does the same but outputs a machine-readable JSON object. Signed-off-by: Manos Pitsidianakis --- Notes: Sample o

Re: [PATCH v2] audio/pw: Report more accurate error when connecting to PipeWire fails

2024-09-18 Thread Manos Pitsidianakis
il_error: -error_setg(errp, "Failed to initialize PW context"); fail: if (pw->thread_loop) { pw_thread_loop_stop(pw->thread_loop); -- 2.44.2 Reviewed-by: Manos Pitsidianakis

Re: [PATCH v2] audio/pw: Report more accurate error when connecting to PipeWire fails

2024-09-18 Thread Manos Pitsidianakis
il_error: -error_setg(errp, "Failed to initialize PW context"); fail: if (pw->thread_loop) { pw_thread_loop_stop(pw->thread_loop); -- 2.44.2 Reviewed-by: Manos Pitsidianakis

[PATCH v10 5/9] .gitattributes: add Rust diff and merge attributes

2024-09-10 Thread Manos Pitsidianakis
Set rust source code to diff=rust (built-in with new git versions) and merge=binary for Cargo.lock files (they should not be merged but auto-generated by cargo) Reviewed-by: Alex Bennée Reviewed-by: Zhao Liu Signed-off-by: Manos Pitsidianakis --- .gitattributes | 3 +++ 1 file changed, 3

[PATCH v10 3/9] configure, meson: detect Rust toolchain

2024-09-10 Thread Manos Pitsidianakis
From: Paolo Bonzini Include the correct path and arguments to rustc in the native and cross files (native compilation is needed for procedural macros). Based on the host architecture and OS, the compiler and optionally the argument to --cpu, the Rust target triple can be detected automatically f

[PATCH v10 7/9] rust: add crate to expose bindings and interfaces

2024-09-10 Thread Manos Pitsidianakis
Add rust/qemu-api, which exposes rust-bindgen generated FFI bindings and provides some declaration macros for symbols visible to the rest of QEMU. Co-authored-by: Junjie Mao Co-authored-by: Paolo Bonzini Signed-off-by: Junjie Mao Signed-off-by: Paolo Bonzini Signed-off-by: Manos Pitsidianakis

[PATCH v10 9/9] rust: add PL011 device model

2024-09-10 Thread Manos Pitsidianakis
Co-authored-by: Paolo Bonzini Signed-off-by: Junjie Mao Signed-off-by: Paolo Bonzini Signed-off-by: Manos Pitsidianakis --- MAINTAINERS| 5 + meson.build| 24 + hw/arm/Kconfig

[PATCH v10 4/9] rust: add bindgen step as a meson dependency

2024-09-10 Thread Manos Pitsidianakis
: Paolo Bonzini Signed-off-by: Manos Pitsidianakis --- MAINTAINERS| 4 +++ configure | 7 meson.build| 41 ++ rust/wrapper.h | 47 ++ rust/.gitignore| 3 ++ rust/meson.build

[PATCH v10 8/9] rust: add utility procedural macro crate

2024-09-10 Thread Manos Pitsidianakis
macro is introduced in this patch, #[derive(Object)]. It generates a constructor to register a QOM TypeInfo on init and it must be used on types that implement qemu_api::definitions::ObjectImpl trait. Signed-off-by: Manos Pitsidianakis --- MAINTAINERS| 1

[PATCH v10 2/9] build-sys: Add rust feature option

2024-09-10 Thread Manos Pitsidianakis
Add rust feature in meson.build, configure, to prepare for adding Rust code in the followup commits. Signed-off-by: Manos Pitsidianakis Reviewed-by: Alex Bennée --- MAINTAINERS | 5 + meson.build | 22 +- Kconfig

[PATCH v10 0/9] Add Rust build support, ARM PL011 device impl

2024-09-10 Thread Manos Pitsidianakis
. The device is used in the arm virt machine if qemu is compiled with rust enabled (./configure --enable-rust [...]) Signed-off-by: Manos Pitsidianakis --- Changes in v10: - Removed unnecessary meson version check (thanks Alex) - Added warning in `configure` when Rust is not disabled about what to

[PATCH v10 6/9] meson.build: add HAVE_GLIB_WITH_ALIGNED_ALLOC flag

2024-09-10 Thread Manos Pitsidianakis
Rust crates, introduced from the next commit onwards, can optionally use the glib allocator API and need to know whether g_aligned_alloc etc are available. This commit adds a define in config_host_data that depends on glib version >= 2.72. Reviewed-by: Alex Bennée Signed-off-by: Ma

Re: Contributing to Qemu

2024-09-08 Thread Manos Pitsidianakis
On Sun, 08 Sep 2024 10:28, Joseph Kurape wrote: Hello, I'm new to open-source, but I've learned C and Python. I've read the 'Getting Started' guide, but aside from signing up for the mailing list and getting the source code, it doesn't provide much direction for beginners. I'm looking for som

Re: [PATCH RESEND v9 7/9] rust: add crate to expose bindings and interfaces

2024-09-05 Thread Manos Pitsidianakis
On Wed, 04 Sep 2024 14:01, Paolo Bonzini wrote: On Wed, Aug 28, 2024 at 6:12 AM Manos Pitsidianakis wrote: Add rust/qemu-api, which exposes rust-bindgen generated FFI bindings and provides some declaration macros for symbols visible to the rest of QEMU. The only comment I have is that I

Re: [PATCH RESEND v9 7/9] rust: add crate to expose bindings and interfaces

2024-08-31 Thread Manos Pitsidianakis
On Fri, 30 Aug 2024 14:03, Alex Bennée wrote: [.snip.] It is there: /usr/lib/llvm-14/lib/clang/14.0.6/include/stdatomic.h in the search path: clang -E -Wp,-v - clang -cc1 version 14.0.6 based upon LLVM 14.0.6 default target x86_64-pc-linux-gnu ignoring nonexistent directory "/usr/bin/.

Re: [PATCH RESEND v9 7/9] rust: add crate to expose bindings and interfaces

2024-08-29 Thread Manos Pitsidianakis
🎱 On Fri, 30 Aug 2024, 04:19 Junjie Mao, wrote: > On 8/28/2024 9:08 PM, Alex Bennée wrote: > > Manos Pitsidianakis writes: > > > >> Add rust/qemu-api, which exposes rust-bindgen generated FFI bindings and > >> provides some declaration macros for symbols

[PATCH RESEND v9 2/9] build-sys: Add rust feature option

2024-08-27 Thread Manos Pitsidianakis
Add rust feature in meson.build, configure, to prepare for adding Rust code in the followup commits. Signed-off-by: Manos Pitsidianakis --- MAINTAINERS | 5 + meson.build | 25 - Kconfig | 1 + Kconfig.host

[PATCH RESEND v9 5/9] .gitattributes: add Rust diff and merge attributes

2024-08-27 Thread Manos Pitsidianakis
Set rust source code to diff=rust (built-in with new git versions) and merge=binary for Cargo.lock files (they should not be merged but auto-generated by cargo) Reviewed-by: Alex Bennée Reviewed-by: Zhao Liu Signed-off-by: Manos Pitsidianakis --- .gitattributes | 3 +++ 1 file changed, 3

[PATCH RESEND v9 8/9] rust: add utility procedural macro crate

2024-08-27 Thread Manos Pitsidianakis
macro is introduced in this patch, #[derive(Object)]. It generates a constructor to register a QOM TypeInfo on init and it must be used on types that implement qemu_api::definitions::ObjectImpl trait. Signed-off-by: Manos Pitsidianakis --- MAINTAINERS | 1 + rust/meson.build

[PATCH RESEND v9 9/9] rust: add PL011 device model

2024-08-27 Thread Manos Pitsidianakis
Co-authored-by: Paolo Bonzini Signed-off-by: Junjie Mao Signed-off-by: Paolo Bonzini Signed-off-by: Manos Pitsidianakis --- MAINTAINERS| 5 + meson.build| 24 + hw/arm/Kconfig

[PATCH RESEND v9 3/9] configure, meson: detect Rust toolchain

2024-08-27 Thread Manos Pitsidianakis
From: Paolo Bonzini Include the correct path and arguments to rustc in the native and cross files (native compilation is needed for procedural macros). Signed-off-by: Paolo Bonzini --- configure | 50 -- meson.build | 8 +++- 2 files chang

[PATCH RESEND v9 6/9] meson.build: add HAVE_GLIB_WITH_ALIGNED_ALLOC flag

2024-08-27 Thread Manos Pitsidianakis
Rust crates, introduced from the next commit onwards, use the glib allocator API and need to know whether g_aligned_alloc etc are available. This commit adds a define in config_host_data that depends on glib version >= 2.72. Signed-off-by: Manos Pitsidianakis --- meson.build | 4 1 f

[PATCH RESEND v9 4/9] rust: add bindgen step as a meson dependency

2024-08-27 Thread Manos Pitsidianakis
: Paolo Bonzini Signed-off-by: Manos Pitsidianakis --- MAINTAINERS| 4 +++ meson.build| 34 +++ rust/wrapper.h | 39 + rust/.gitignore| 3 ++ rust/meson.build | 0 scripts/rust/rustc_args.py

[PATCH RESEND v9 7/9] rust: add crate to expose bindings and interfaces

2024-08-27 Thread Manos Pitsidianakis
Add rust/qemu-api, which exposes rust-bindgen generated FFI bindings and provides some declaration macros for symbols visible to the rest of QEMU. Co-authored-by: Junjie Mao Co-authored-by: Paolo Bonzini Signed-off-by: Junjie Mao Signed-off-by: Paolo Bonzini Signed-off-by: Manos Pitsidianakis

[PATCH RESEND v9 0/9] Add Rust build support, ARM PL011 device impl

2024-08-27 Thread Manos Pitsidianakis
Rust, chosen for its low complexity. The device is used in the arm virt machine if qemu is compiled with rust enabled (./configure --enable-rust [...]) Signed-off-by: Manos Pitsidianakis --- Changes in v9: - Addressed v8 review comment: removed rustfmt.toml symlink (Junjie Mao) - Address

[PATCH v9 7/9] rust: add crate to expose bindings and interfaces

2024-08-27 Thread Manos Pitsidianakis
Add rust/qemu-api, which exposes rust-bindgen generated FFI bindings and provides some declaration macros for symbols visible to the rest of QEMU. Co-authored-by: Junjie Mao Co-authored-by: Paolo Bonzini Signed-off-by: Junjie Mao Signed-off-by: Paolo Bonzini Signed-off-by: Manos Pitsidianakis

[PATCH v9 5/9] .gitattributes: add Rust diff and merge attributes

2024-08-27 Thread Manos Pitsidianakis
Set rust source code to diff=rust (built-in with new git versions) and merge=binary for Cargo.lock files (they should not be merged but auto-generated by cargo) Reviewed-by: Alex Bennée Reviewed-by: Zhao Liu Signed-off-by: Manos Pitsidianakis --- .gitattributes | 3 +++ 1 file changed, 3

[PATCH v9 4/9] rust: add bindgen step as a meson dependency

2024-08-27 Thread Manos Pitsidianakis
: Paolo Bonzini Signed-off-by: Manos Pitsidianakis --- MAINTAINERS| 4 +++ meson.build| 34 +++ rust/wrapper.h | 39 + rust/.gitignore| 3 ++ rust/meson.build | 0 scripts/rust/rustc_args.py

[PATCH v9 8/9] rust: add utility procedural macro crate

2024-08-27 Thread Manos Pitsidianakis
macro is introduced in this patch, #[derive(Object)]. It generates a constructor to register a QOM TypeInfo on init and it must be used on types that implement qemu_api::definitions::ObjectImpl trait. Signed-off-by: Manos Pitsidianakis --- MAINTAINERS | 1 + rust/meson.build

[PATCH v9 1/9] Require meson version 1.5.0

2024-08-27 Thread Manos Pitsidianakis
From: Paolo Bonzini This is needed for Rust support. Signed-off-by: Paolo Bonzini --- meson.build| 2 +- python/scripts/vendor.py | 4 ++-- python/wheels/meson-1.2.3-py3-none-any.whl | Bin 964928 -> 0 bytes python/wheels/meson-1.5.0-py3-no

[PATCH v9 2/9] build-sys: Add rust feature option

2024-08-27 Thread Manos Pitsidianakis
Add rust feature in meson.build, configure, to prepare for adding Rust code in the followup commits. Signed-off-by: Manos Pitsidianakis --- MAINTAINERS | 5 + meson.build | 25 - Kconfig | 1 + Kconfig.host

[PATCH v9 9/9] rust: add PL011 device model

2024-08-27 Thread Manos Pitsidianakis
Co-authored-by: Paolo Bonzini Signed-off-by: Junjie Mao Signed-off-by: Paolo Bonzini Signed-off-by: Manos Pitsidianakis --- MAINTAINERS| 5 + meson.build| 24 + hw/arm/Kconfig

[PATCH v9 0/9] Add Rust build support, ARM PL011 device impl

2024-08-27 Thread Manos Pitsidianakis
Rust, chosen for its low complexity. The device is used in the arm virt machine if qemu is compiled with rust enabled (./configure --enable-rust [...]) Signed-off-by: Manos Pitsidianakis --- Changes in v9: - Addressed v8 review comment: removed rustfmt.toml symlink (Junjie Mao) - Address

[PATCH v9 6/9] meson.build: add HAVE_GLIB_WITH_ALIGNED_ALLOC flag

2024-08-27 Thread Manos Pitsidianakis
Rust crates, introduced from the next commit onwards, use the glib allocator API and need to know whether g_aligned_alloc etc are available. This commit adds a define in config_host_data that depends on glib version >= 2.72. Signed-off-by: Manos Pitsidianakis --- meson.build | 4 1 f

[PATCH v9 3/9] configure, meson: detect Rust toolchain

2024-08-27 Thread Manos Pitsidianakis
From: Paolo Bonzini Include the correct path and arguments to rustc in the native and cross files (native compilation is needed for procedural macros). Signed-off-by: Paolo Bonzini --- configure | 50 -- meson.build | 8 +++- 2 files chang

Re: [PATCH v8 6/8] rust: add crate to expose bindings and interfaces

2024-08-26 Thread Manos Pitsidianakis
On Mon, 26 Aug 2024 11:24, Thomas Huth wrote: On 26/08/2024 08.41, Manos Pitsidianakis wrote: On Mon, 26 Aug 2024 08:31, Junjie Mao wrote: +unsafe impl GlobalAlloc for QemuAllocator { +    unsafe fn alloc(&self, layout: Layout) -> *mut u8 { +    if layout.align

Re: [PATCH v8 6/8] rust: add crate to expose bindings and interfaces

2024-08-25 Thread Manos Pitsidianakis
On Mon, 26 Aug 2024 08:31, Junjie Mao wrote: +unsafe impl GlobalAlloc for QemuAllocator { +unsafe fn alloc(&self, layout: Layout) -> *mut u8 { +if layout.align() == 0 { +g_malloc0(layout.size().try_into().unwrap()).cast::() +} else { +g_aligned_alloc0(

Re: [PATCH v8 6/8] rust: add crate to expose bindings and interfaces

2024-08-25 Thread Manos Pitsidianakis
On Mon, 26 Aug 2024 08:03, Junjie Mao wrote: Hi Manos, On 8/23/2024 4:11 PM, Manos Pitsidianakis wrote: Add rust/qemu-api, which exposes rust-bindgen generated FFI bindings and provides some declaration macros for symbols visible to the rest of QEMU. Co-authored-by: Junjie Mao Co-authored

Re: [PATCH v8 7/8] rust: add utility procedural macro crate

2024-08-25 Thread Manos Pitsidianakis
Hello Junjie, On Mon, 26 Aug 2024 08:15, Junjie Mao wrote: On 8/23/2024 4:11 PM, Manos Pitsidianakis wrote: This commit adds a helper crate library, qemu-api-macros for derive (and other procedural) macros to be used along qemu-api. It needs to be a separate library because in Rust

[PATCH v8 7/8] rust: add utility procedural macro crate

2024-08-23 Thread Manos Pitsidianakis
macro is introduced in this patch, #[derive(Object)]. It generates a constructor to register a QOM TypeInfo on init and it must be used on types that implement qemu_api::definitions::ObjectImpl trait. Signed-off-by: Manos Pitsidianakis --- MAINTAINERS| 1 + rust

[PATCH v8 6/8] rust: add crate to expose bindings and interfaces

2024-08-23 Thread Manos Pitsidianakis
Add rust/qemu-api, which exposes rust-bindgen generated FFI bindings and provides some declaration macros for symbols visible to the rest of QEMU. Co-authored-by: Junjie Mao Co-authored-by: Paolo Bonzini Signed-off-by: Junjie Mao Signed-off-by: Paolo Bonzini Signed-off-by: Manos Pitsidianakis

[PATCH v8 1/8] Require meson version 1.5.0

2024-08-23 Thread Manos Pitsidianakis
From: Paolo Bonzini This is needed for Rust support. Signed-off-by: Paolo Bonzini --- meson.build| 2 +- python/scripts/vendor.py | 4 ++-- python/wheels/meson-1.2.3-py3-none-any.whl | Bin 964928 -> 0 bytes python/wheels/meson-1.5.0-py3-no

[PATCH v8 8/8] rust: add PL011 device model

2024-08-23 Thread Manos Pitsidianakis
Co-authored-by: Paolo Bonzini Signed-off-by: Junjie Mao Signed-off-by: Paolo Bonzini Signed-off-by: Manos Pitsidianakis --- MAINTAINERS| 5 + meson.build| 24 + hw/arm/Kconfig

[PATCH v8 2/8] build-sys: Add rust feature option

2024-08-23 Thread Manos Pitsidianakis
Add rust feature in meson.build, configure, to prepare for adding Rust code in the followup commits. Signed-off-by: Manos Pitsidianakis --- MAINTAINERS | 5 + meson.build | 25 - Kconfig | 1 + Kconfig.host

[PATCH v8 5/8] .gitattributes: add Rust diff and merge attributes

2024-08-23 Thread Manos Pitsidianakis
Set rust source code to diff=rust (built-in with new git versions) and merge=binary for Cargo.lock files (they should not be merged but auto-generated by cargo) Reviewed-by: Alex Bennée Reviewed-by: Zhao Liu Signed-off-by: Manos Pitsidianakis --- .gitattributes | 3 +++ 1 file changed, 3

[PATCH v8 4/8] rust: add bindgen step as a meson dependency

2024-08-23 Thread Manos Pitsidianakis
: Paolo Bonzini Signed-off-by: Manos Pitsidianakis --- MAINTAINERS| 4 +++ meson.build| 34 +++ rust/wrapper.h | 39 + rust/.gitignore| 3 ++ rust/meson.build | 0 scripts/rust/rustc_args.py

[PATCH v8 0/8] Add Rust build support, ARM PL011 device impl

2024-08-23 Thread Manos Pitsidianakis
Rust, chosen for its low complexity. The device is used in the arm virt machine if qemu is compiled with rust enabled (./configure --enable-rust [...]) Signed-off-by: Manos Pitsidianakis --- Changes in v8: - Allow for compilation of more than one Rust-based component in Meson by compilin

[PATCH v8 3/8] configure, meson: detect Rust toolchain

2024-08-23 Thread Manos Pitsidianakis
From: Paolo Bonzini Include the correct path and arguments to rustc in the native and cross files (native compilation is needed for procedural macros). Signed-off-by: Paolo Bonzini --- configure | 50 -- meson.build | 8 +++- 2 files chang

Re: [PATCH v7 6/7] rust: add crate to expose bindings and interfaces

2024-08-21 Thread Manos Pitsidianakis
On Fri, 16 Aug 2024 11:34, Philippe Mathieu-Daudé wrote: On 15/8/24 17:06, Daniel P. Berrangé wrote: On Thu, Aug 15, 2024 at 04:01:17PM +0200, Philippe Mathieu-Daudé wrote: Hi Manos, On 15/8/24 13:42, Manos Pitsidianakis wrote: Add rust/qemu-api, which exposes rust-bindgen generated FFI

Re: [PATCH v7 0/7] Add Rust build support, ARM PL011 device impl

2024-08-16 Thread Manos Pitsidianakis
On Fri, 16 Aug 2024, 11:06 Junjie Mao, wrote: > On 8/15/2024 7:42 PM, Manos Pitsidianakis wrote: > > Outstanding issues > > == > > > > Outstanding issues that are not blocking for merge are: > > > > - Cross-compilation for aarch64 is not po

Re: [PATCH v7 6/7] rust: add crate to expose bindings and interfaces

2024-08-15 Thread Manos Pitsidianakis
On Thu, 15 Aug 2024 17:01, Philippe Mathieu-Daudé wrote: Hi Manos, On 15/8/24 13:42, Manos Pitsidianakis wrote: Add rust/qemu-api, which exposes rust-bindgen generated FFI bindings and provides some declaration macros for symbols visible to the rest of QEMU. Co-authored-by: Junjie Mao Co

[PATCH v7 0/7] Add Rust build support, ARM PL011 device impl

2024-08-15 Thread Manos Pitsidianakis
ts low complexity. The device is used in the arm virt machine if qemu is compiled with rust enabled (./configure --enable-rust [...]) Signed-off-by: Manos Pitsidianakis --- Manos Pitsidianakis (5): build-sys: Add rust feature option rust: add bindgen step as a meson dependency

[PATCH v7 4/7] rust: add bindgen step as a meson dependency

2024-08-15 Thread Manos Pitsidianakis
: Paolo Bonzini Signed-off-by: Manos Pitsidianakis --- MAINTAINERS | 4 +++ meson.build | 52 +++ rust/wrapper.h| 39 rust/.gitignore | 3 ++ rust/meson.build | 0 scripts/rustc_args.py | 84

[PATCH v7 5/7] .gitattributes: add Rust diff and merge attributes

2024-08-15 Thread Manos Pitsidianakis
Set rust source code to diff=rust (built-in with new git versions) and merge=binary for Cargo.lock files (they should not be merged but auto-generated by cargo) Reviewed-by: Alex Bennée Reviewed-by: Zhao Liu Signed-off-by: Manos Pitsidianakis --- .gitattributes | 3 +++ 1 file changed, 3

[PATCH v7 1/7] Require meson version 1.5.0

2024-08-15 Thread Manos Pitsidianakis
From: Paolo Bonzini This is needed for Rust support. Signed-off-by: Paolo Bonzini --- meson.build| 2 +- python/scripts/vendor.py | 4 ++-- python/wheels/meson-1.2.3-py3-none-any.whl | Bin 964928 -> 0 bytes python/wheels/meson-1.5.0-py3-no

[PATCH v7 2/7] build-sys: Add rust feature option

2024-08-15 Thread Manos Pitsidianakis
Add rust feature in meson.build, configure, to prepare for adding Rust code in the followup commits. Signed-off-by: Manos Pitsidianakis --- MAINTAINERS | 5 + meson.build | 25 - Kconfig | 1 + Kconfig.host

[PATCH v7 3/7] configure, meson: detect Rust toolchain

2024-08-15 Thread Manos Pitsidianakis
From: Paolo Bonzini Include the correct path and arguments to rustc in the native and cross files (native compilation is needed for procedural macros). Signed-off-by: Paolo Bonzini --- configure | 50 -- meson.build | 8 +++- 2 files chang

[PATCH v7 6/7] rust: add crate to expose bindings and interfaces

2024-08-15 Thread Manos Pitsidianakis
Add rust/qemu-api, which exposes rust-bindgen generated FFI bindings and provides some declaration macros for symbols visible to the rest of QEMU. Co-authored-by: Junjie Mao Co-authored-by: Paolo Bonzini Signed-off-by: Junjie Mao Signed-off-by: Paolo Bonzini Signed-off-by: Manos Pitsidianakis

[PATCH v7 7/7] rust: add PL011 device model

2024-08-15 Thread Manos Pitsidianakis
Co-authored-by: Paolo Bonzini Signed-off-by: Junjie Mao Signed-off-by: Paolo Bonzini Signed-off-by: Manos Pitsidianakis --- MAINTAINERS| 5 + hw/arm/Kconfig | 33 +- rust/Kconfig

Re: [RFC PATCH 0/2] meson: Specify Rust edition by rust_std=20XX

2024-08-14 Thread Manos Pitsidianakis
On Wed, 14 Aug 2024 12:08, Junjie Mao wrote: The official way to specify Rust edition in meson is the rust_std build option [1]. It is used for generating --edition rustc options and filling rust-project.json which provides project layout information to rust-analyzer. Specifying Rust edition by

Re: [RFC PATCH v6 0/5] rust-pl011-rfc-v6

2024-08-08 Thread Manos Pitsidianakis
On Thu, 08 Aug 2024 09:10, Paolo Bonzini wrote: On 8/4/24 23:04, Manos Pitsidianakis wrote: Changes === - Setting MSRV to 1.77.0: * cstr crate MSRV is 1.64, which is more recent than Debian bookworm (1.63.0) <https://github.com/upsuper/cstr/blob/master/Cargo.toml> * p

[RFC PATCH v6 4/5] rust: add crate to expose bindings and interfaces

2024-08-04 Thread Manos Pitsidianakis
Add rust/qemu-api, which exposes rust-bindgen generated FFI bindings and provides some declaration macros for symbols visible to the rest of QEMU. Signed-off-by: Manos Pitsidianakis --- MAINTAINERS | 6 ++ rust/meson.build | 13 +++ rust/qemu-api

[RFC PATCH v6 1/5] build-sys: Add rust feature option

2024-08-04 Thread Manos Pitsidianakis
Add rust feature in meson.build, configure, to prepare for adding Rust code in the followup commits. Signed-off-by: Manos Pitsidianakis --- MAINTAINERS | 5 + configure | 2 ++ meson.build | 25 - Kconfig

[RFC PATCH v6 2/5] rust: add bindgen step as a meson dependency

2024-08-04 Thread Manos Pitsidianakis
: Manos Pitsidianakis --- MAINTAINERS | 4 +++ meson.build | 52 +++ rust/wrapper.h| 39 rust/.gitignore | 3 ++ rust/meson.build | 0 scripts/rustc_args.py | 84 +++ 6

[RFC PATCH v6 5/5] rust: add PL011 device model

2024-08-04 Thread Manos Pitsidianakis
diff --git a/MAINTAINERS b/MAINTAINERS index 018f3a9420..2b3d96fa2f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1188,6 +1188,11 @@ F: include/hw/*/microbit*.h F: tests/qtest/microbit-test.c F: docs/system/arm/nrf.rst +ARM PL011 Rust device +M: Manos Pitsidianakis +S: Maintained +F: rust/hw

[RFC PATCH v6 0/5] rust-pl011-rfc-v6

2024-08-04 Thread Manos Pitsidianakis
ches. - Dropped vendored dependencies in favor of meson subprojects. - Added a qom ObjectImpl trait and declaration macros - Added # SAFETY comments. - Changed configure flag to --{enable,disable}-rust Manos Pitsidianakis (5): build-sys: Add rust feature option rust: add bindgen step as a

[RFC PATCH v6 3/5] .gitattributes: add Rust diff and merge attributes

2024-08-04 Thread Manos Pitsidianakis
Set rust source code to diff=rust (built-in with new git versions) and merge=binary for Cargo.lock files (they should not be merged but auto-generated by cargo) Reviewed-by: Alex Bennée Reviewed-by: Zhao Liu Signed-off-by: Manos Pitsidianakis --- .gitattributes | 3 +++ 1 file changed, 3

Re: [PULL v2 17/61] virtio-snd: check for invalid param shift operands

2024-08-02 Thread Manos Pitsidianakis
On Fri, 02 Aug 2024 08:03, Volker Rümelin wrote: Am 01.08.24 um 10:22 schrieb Michael S. Tsirkin: On Sat, Jul 27, 2024 at 08:55:10AM +0200, Volker Rümelin wrote: Hi Manos, this patch doesn't work as intended. I guess you wanted to write     if (params->format >= sizeof(supported_formats

Re: [PATCH] hw/audio/virtio-snd: fix invalid param check

2024-08-02 Thread Manos Pitsidianakis
ot;); return cpu_to_le32(VIRTIO_SND_S_NOT_SUPP); -- 2.35.3 Thanks for the fix Volker :) Reviewed-by: Manos Pitsidianakis

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.

Re: [PATCH v2] scripts/qcow2-to-stdout.py: Add script to write qcow2 images to stdout

2024-07-26 Thread Manos Pitsidianakis
3], +) +args = parser.parse_args() + +if not os.path.isfile(args.input_file): +sys.exit(f"[Error] {args.input_file} does not exist or is not a regular file.") + +if args.refcount_bits != 16 and args.qcow2_version != 3: +sys.exit(f"[Error] refcount_bits={args.refcount_bits} is only supported with qcow2_version=3.") + +if sys.stdout.isatty(): +sys.exit("[Error] Refusing to write to a tty. Try redirecting stdout.") + +with get_input_as_raw_file(args.input_file, args.input_format) as raw_file: +create_qcow2_file( +raw_file, +args.cluster_size, +args.refcount_bits, +args.qcow2_version, +) -- 2.39.2 Reviewed-by: Manos Pitsidianakis

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 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

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.

Re: [PATCH 0/2] gitlab: expose installed package info in build logs

2024-07-25 Thread Manos Pitsidianakis
On Thu, 25 Jul 2024 12:56, Thomas Huth wrote: On 25/07/2024 11.42, Manos Pitsidianakis wrote: Hello Daniel, On Wed, 24 Jul 2024 12:55, "Daniel P. Berrangé" wrote: Many times we see a build job start failing, we wonder if the installed packages have changed since the last passing

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

Re: [PATCH 0/2] gitlab: expose installed package info in build logs

2024-07-25 Thread Manos Pitsidianakis
Hello Daniel, On Wed, 24 Jul 2024 12:55, "Daniel P. Berrangé" wrote: Many times we see a build job start failing, we wonder if the installed packages have changed since the last passing build. We can rarely diagnose this, however, since we only have the new container image, not the old one.

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 ch

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 reque

Re: [RFC PATCH v5 3/8] CI: Add build-system-rust-debian job

2024-07-23 Thread Manos Pitsidianakis
On Tue, 23 Jul 2024 13:11, "Daniel P. Berrangé" wrote: On Tue, Jul 23, 2024 at 01:06:20PM +0300, Manos Pitsidianakis wrote: On Tue, 23 Jul 2024 11:39, "Daniel P. Berrangé" wrote: > On Mon, Jul 22, 2024 at 02:43:33PM +0300, Manos Pitsidianakis wrote: > > Add job

Re: [RFC PATCH v5 8/8] rust/pl011: vendor dependencies

2024-07-23 Thread Manos Pitsidianakis
On Tue, 23 Jul 2024 11:37, Zhao Liu wrote: Hi Manos, (This patch contains too many codes so that mail list rejects to display it at https://lore.kernel.org/qemu-devel) Please correct me if I'm wrong... Is the reason for not using git submodules here because v5 abandoned compilation through Ca

Re: [RFC PATCH v5 1/8] build-sys: Add rust feature option

2024-07-23 Thread Manos Pitsidianakis
On Tue, 23 Jul 2024 09:37, Zhao Liu wrote: Hi Manos, On Mon, Jul 22, 2024 at 02:43:31PM +0300, Manos Pitsidianakis wrote: Date: Mon, 22 Jul 2024 14:43:31 +0300 From: Manos Pitsidianakis Subject: [RFC PATCH v5 1/8] build-sys: Add rust feature option X-Mailer: git-send-email 2.44.0 Add rust

Re: [RFC PATCH v5 2/8] build deps: update lcitool to include rust bits

2024-07-23 Thread Manos Pitsidianakis
Hello Richard, On Tue, 23 Jul 2024 11:31, Richard Henderson wrote: On 7/22/24 21:43, Manos Pitsidianakis wrote: From: Alex Bennée For rust development we need cargo, rustc and bindgen in our various development environments. Update the libvirt-ci project to (!495) and regenerate the

Re: [RFC PATCH v5 3/8] CI: Add build-system-rust-debian job

2024-07-23 Thread Manos Pitsidianakis
On Tue, 23 Jul 2024 11:39, "Daniel P. Berrangé" wrote: On Mon, Jul 22, 2024 at 02:43:33PM +0300, Manos Pitsidianakis wrote: Add job that builds with rust support enabled on debian. Signed-off-by: Manos Pitsidianakis --- .gitlab-ci.d/buildtest.yml | 11 +++ 1 file c

[RFC PATCH v5 7/8] rust: add PL011 device model

2024-07-22 Thread Manos Pitsidianakis
/MAINTAINERS b/MAINTAINERS index 1789bcfd9b..0af4ef58ed 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1187,6 +1187,11 @@ F: include/hw/*/microbit*.h F: tests/qtest/microbit-test.c F: docs/system/arm/nrf.rst +ARM PL011 Rust device +M: Manos Pitsidianakis +S: Maintained +F: rust/hw/char/pl011/ + AVR

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

2024-07-22 Thread Manos Pitsidianakis
nnée (1): build deps: update lcitool to include rust bits Manos Pitsidianakis (7): build-sys: Add rust feature option CI: Add build-system-rust-debian job rust: add bindgen step as a meson dependency .gitattributes: add Rust diff and merge attributes rust: add crate to expose bindings and

[RFC PATCH v5 2/8] build deps: update lcitool to include rust bits

2024-07-22 Thread Manos Pitsidianakis
Mathieu-Daudé Signed-off-by: Manos Pitsidianakis --- .gitlab-ci.d/cirrus/freebsd-13.vars | 2 +- .gitlab-ci.d/cirrus/macos-13.vars | 2 +- .gitlab-ci.d/cirrus/macos-14.vars | 2 +- scripts/ci/setup/ubuntu/ubuntu-2204-aarch64.yaml | 3

[RFC PATCH v5 5/8] .gitattributes: add Rust diff and merge attributes

2024-07-22 Thread Manos Pitsidianakis
Set rust source code to diff=rust (built-in with new git versions) and merge=binary for Cargo.lock files (they should not be merged but auto-generated by cargo) Reviewed-by: Alex Bennée Signed-off-by: Manos Pitsidianakis --- .gitattributes | 3 +++ 1 file changed, 3 insertions(+) diff --git a

[RFC PATCH v5 4/8] rust: add bindgen step as a meson dependency

2024-07-22 Thread Manos Pitsidianakis
: Manos Pitsidianakis --- MAINTAINERS | 4 +++ meson.build | 56 + rust/wrapper.h| 39 rust/.gitignore | 3 ++ rust/meson.build | 0 scripts/rustc_args.py | 84 +++ 6

[RFC PATCH v5 1/8] build-sys: Add rust feature option

2024-07-22 Thread Manos Pitsidianakis
Add rust feature in meson.build, configure, to prepare for adding Rust code in the followup commits. Signed-off-by: Manos Pitsidianakis --- MAINTAINERS | 5 + configure | 12 meson.build | 17 - Kconfig

[RFC PATCH v5 6/8] rust: add crate to expose bindings and interfaces

2024-07-22 Thread Manos Pitsidianakis
Add rust/qemu-api, which exposes rust-bindgen generated FFI bindings and provides some declaration macros for symbols visible to the rest of QEMU. Signed-off-by: Manos Pitsidianakis --- MAINTAINERS | 6 ++ rust/meson.build | 13 +++ rust/qemu-api

[RFC PATCH v5 3/8] CI: Add build-system-rust-debian job

2024-07-22 Thread Manos Pitsidianakis
Add job that builds with rust support enabled on debian. Signed-off-by: Manos Pitsidianakis --- .gitlab-ci.d/buildtest.yml | 11 +++ 1 file changed, 11 insertions(+) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index e3a0758bd9..e025e2cbf6 100644 --- a/.gitlab

Re: [RFC PATCH] build deps: update lcitool to include rust bits

2024-07-12 Thread Manos Pitsidianakis
Hi Daniel, Alex, I will pick this patch up with all the reviewed-by trailers for my next Rust RFC series if that's alright with you, Manos On Fri, 12 Jul 2024 at 13:12, Daniel P. Berrangé wrote: > > On Wed, Jul 10, 2024 at 04:43:35PM +0100, Alex Bennée wrote: > > For rust development we need ca

Re: [RFC PATCH v4 2/7] rust: add bindgen step as a meson dependency

2024-07-11 Thread Manos Pitsidianakis
On Fri, 12 Jul 2024 00:23, Pierrick Bouvier wrote: On 7/9/24 06:00, Daniel P. Berrangé wrote: On Tue, Jul 09, 2024 at 02:28:38PM +0200, Paolo Bonzini wrote: On Tue, Jul 9, 2024 at 2:09 PM Peter Maydell wrote: * what is the actual baseline requirement? We definitely want to support "usi

[PATCH v1] virtio-snd: check for invalid param shift operands

2024-07-11 Thread Manos Pitsidianakis
bits in supported_formats/supported_rates, we must report an error. Previously, this ended up triggering the not reached assertions later when converting to internal QEMU values. Reported-by: Zheyu Ma Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2416 Signed-off-by: Manos Pitsidianakis

Re: [PATCH 2/2] block/graph-lock: Make WITH_GRAPH_RDLOCK_GUARD() fully checked

2024-07-10 Thread Manos Pitsidianakis
quot;mutex"))) mutex {}; > +void lock(struct mutex *m) __attribute__((acquire_capability(m))); > +void unlock(struct mutex *m) __attribute__((release_capability(m))); > + > +void test(void) { > + struct mutex __attribute__((cleanup(unlock))) m; > + lock(&m); > +} > + ''', args: ['-Wthread-safety', '-Werror']) > + if tsa_has_cleanup > +warn_flags += ['-Wthread-safety'] > + endif > endif > > # Set up C++ compiler flags > -- > 2.45.2 > Reviewed-by: Manos Pitsidianakis -- Manos Pitsidianakis Emulation and Virtualization Engineer at Linaro Ltd

Re: [RFC PATCH v2 3/5] rust: add PL011 device model

2024-07-10 Thread Manos Pitsidianakis
Hey Zhao, On Thu, 11 Jul 2024 at 07:05, Zhao Liu wrote: > > Hi Manos and all, > > On Tue, Jun 11, 2024 at 01:33:32PM +0300, Manos Pitsidianakis wrote: > > diff --git a/rust/rustfmt.toml b/rust/rustfmt.toml > > new file mode 100644 > > index 00..ebecb99fe0 &g

Re: [PATCH v1 1/1] virtio-snd: add max size bounds check in input cb

2024-07-09 Thread Manos Pitsidianakis
On Tue, 09 Jul 2024 17:16, Matias Ezequiel Vara Larsen wrote: Thanks Manos for sending this, On Mon, Jul 08, 2024 at 10:09:49AM +0300, Manos Pitsidianakis wrote: When reading input audio in the virtio-snd input callback, virtio_snd_pcm_in_cb(), we do not check whether the iov can actually

Re: [RFC PATCH v4 0/7] Add Rust support, implement ARM PL011

2024-07-09 Thread Manos Pitsidianakis
On Mon, 8 Jul 2024 at 21:39, Manos Pitsidianakis wrote: > > > > On Mon, 8 Jul 2024, 21:34 Paolo Bonzini, wrote: >> >> >> >> Il lun 8 lug 2024, 19:12 Daniel P. Berrangé ha scritto: >>> >>> That's exactly why I suggest its a pre-requi

  1   2   3   4   5   6   7   8   >