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

2024-07-22 Thread Manos Pitsidianakis
a/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
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 interfaces

[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

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

2024-07-22 Thread Manos Pitsidianakis
-by: 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

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

2024-07-12 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

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

2024-07-11 Thread Manos Pitsidianakis
of 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-11 Thread Manos Pitsidianakis
id 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(); > +} > + ''', 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-requisite

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:49, Paolo Bonzini wrote: > > > > Il lun 8 lug 2024, 20:39 Manos Pitsidianakis > ha scritto: >> >> >> >> On Mon, 8 Jul 2024, 21:34 Paolo Bonzini, wrote: >>> >>> >>> >>> Il lun 8 lug 2024, 19:12

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

2024-07-08 Thread Manos Pitsidianakis
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-requisite for merging >> this. Unless we're able to demonstrate that we can enable >> Rust on all our CI platforms, the benefits of Rust

Re: QEMU Community Call Agenda Items (July 8th, 2024)

2024-07-08 Thread Manos Pitsidianakis
Hello Alex, I thought It was tomorrow? QEMU Project Calendar says " Tuesday, July 9⋅4:00 – 5:00pm Every 2 weeks on Tuesday " On Mon, 8 Jul 2024 at 17:58, Alex Bennée wrote: > > > Hi, > > The KVM/QEMU community call is at: > > https://meet.jit.si/kvmcallmeeting > @ > 8/7/2024 14:00 UTC > >

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

2024-07-08 Thread Manos Pitsidianakis
Thanks for the review Philippe, On Mon, 08 Jul 2024 11:28, Philippe Mathieu-Daudé wrote: +max_size = iov_size(buffer->elem->in_sg, buffer->elem->in_num); for (;;) { +if (buffer->size >= max_size) { +

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

2024-07-08 Thread Manos Pitsidianakis
ect/qemu/-/issues/2427 Signed-off-by: Manos Pitsidianakis --- hw/audio/virtio-snd.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/audio/virtio-snd.c b/hw/audio/virtio-snd.c index 5993f4f040..e6432ac959 100644 --- a/hw/audio/virtio-snd.c +++ b/hw/audio/virtio-sn

Re: [PATCH v2 22/40] test/plugins: preserve the instruction record over translations

2024-07-05 Thread Manos Pitsidianakis
->match == m) { > +g_string_printf(out, > +" %"PRIx64": %s (hits %"PRId64")\n", > + record->vaddr, > +record->disas, > +record->hits); > +qemu_plugin_outs(out->str); > +} > +} > + > g_free(m->match_string); > qemu_plugin_scoreboard_free(m->counts); > } > + > +g_mutex_unlock(_hash_lock); > + > g_array_free(matches, TRUE); > g_array_free(sizes, TRUE); > } > -- > 2.39.2 Reviewed-by: Manos Pitsidianakis

Re: [PATCH v2 37/40] gdbstub: Pass CPU context to command handler

2024-07-05 Thread Manos Pitsidianakis
ext) { > +user_ctx = (void *)gdbserver_state.g_cpu; > +} > + > gdbserver_state.allow_stop_reply = cmd->allow_stop_reply; > -cmd->handler(params, NULL); > +cmd->handler(params, user_ctx); > return true; > } > > -- > 2.39.2 > Reviewed-by: Manos Pitsidianakis

Re: [PATCH v2 35/40] target/arm: Factor out code for setting MTE TCF0 field

2024-07-05 Thread Manos Pitsidianakis
F_SYNC(1UL << PR_MTE_TCF_SHIFT) > -# define PR_MTE_TCF_ASYNC (2UL << PR_MTE_TCF_SHIFT) > -# define PR_MTE_TCF_MASK(3UL << PR_MTE_TCF_SHIFT) > -# define PR_MTE_TAG_SHIFT 3 > -# define PR_MTE_TAG_MASK(0xUL << PR_MTE_TAG_SHIFT) > -#endif > #ifndef PR_SET_IO_FLUSHER > # define PR_SET_IO_FLUSHER 57 > # define PR_GET_IO_FLUSHER 58 > diff --git a/linux-user/aarch64/meson.build b/linux-user/aarch64/meson.build > index 248c578d15..f75bb3cd75 100644 > --- a/linux-user/aarch64/meson.build > +++ b/linux-user/aarch64/meson.build > @@ -9,3 +9,5 @@ vdso_le_inc = gen_vdso.process('vdso-le.so', > extra_args: ['-r', '__kernel_rt_sigreturn']) > > linux_user_ss.add(when: 'TARGET_AARCH64', if_true: [vdso_be_inc, > vdso_le_inc]) > + > +linux_user_ss.add(when: 'TARGET_AARCH64', if_true: > [files('mte_user_helper.c')]) > -- > 2.39.2 > Reviewed-by: Manos Pitsidianakis

Re: [PATCH v2 25/40] plugins/lockstep: mention the one-insn-per-tb option

2024-07-05 Thread Manos Pitsidianakis
e-insn-per-tb=on > * > * This code is not thread safe! > * > -- > 2.39.2 > Reviewed-by: Manos Pitsidianakis

Re: [PATCH v2 38/40] gdbstub: Use true to set cmd_startswith

2024-07-05 Thread Manos Pitsidianakis
remove_bp_cmd_desc = { > .handler = handle_remove_bp, > .cmd = "z", > -.cmd_startswith = 1, > +.cmd_startswith = true, > .schema = "l?L?L0" > }; > cmd_parser = _bp

Re: [PATCH v2 21/40] test/plugin: make insn plugin less noisy by default

2024-07-05 Thread Manos Pitsidianakis
; > static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) > @@ -216,6 +217,11 @@ QEMU_PLUGIN_EXPORT int > qemu_plugin_install(qemu_plugin_id_t id, > } > } else if (g_strcmp0(tokens[0], "match") == 0) { > parse_match(tokens[1]); > +} else if (g_strcmp0(tokens[0], "trace") == 0) { > +if (!qemu_plugin_bool_parse(tokens[0], tokens[1], _trace)) { > +fprintf(stderr, "boolean argument parsing failed: %s\n", > opt); > +return -1; > +} > } else { > fprintf(stderr, "option parsing failed: %s\n", opt); > return -1; > -- > 2.39.2 > > Reviewed-by: Manos Pitsidianakis

Re: [PATCH v2 23/40] plugins/lockstep: preserve sock_path

2024-07-05 Thread Manos Pitsidianakis
return -1; > } > } else if (g_strcmp0(tokens[0], "sockpath") == 0) { > -sock_path = tokens[1]; > +sock_path = strdup(tokens[1]); s/strdup/g_strdup ? Otherwise, Reviewed-by: Manos Pitsidianakis > } else { >

Re: [PATCH v2 04/40] hw/core: ensure kernel_end never gets used undefined

2024-07-05 Thread Manos Pitsidianakis
_end; > +hwaddr kernel_end = 0; > int ret; > > itb = load_device_tree(filename, _size); > -- > 2.39.2 > Reviewed-by: Manos Pitsidianakis

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

2024-07-04 Thread Manos Pitsidianakis
erated.rs target names would clash. - Add more descriptive commit messages - Update MAINTAINERS - Cleanup patch order for better review, hopefully Manos Pitsidianakis (7): build-sys: Add rust feature option rust: add bindgen step as a meson dependency rust: add crate to expose bindings and i

[RFC PATCH v4 7/7] DO NOT MERGE: replace TYPE_PL011 with x-pl011-rust in arm virt machine

2024-07-04 Thread Manos Pitsidianakis
Convenience patch for testing the rust device. Signed-off-by: Manos Pitsidianakis --- hw/arm/virt.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index b0c68d66a3..49dd0b815e 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -929,7 +929,11 @@ static void

[RFC PATCH v4 3/7] rust: add crate to expose bindings and interfaces

2024-07-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 | 7 ++ rust/.cargo/config.toml | 2 + rust/qemu-api

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

2024-07-04 Thread Manos Pitsidianakis
. This way meson sets up the dependency tree properly. 5. After compiling each rust crate with the cargo_wrapper.py script, its static library artifact is linked as a `whole-archive` with the final binary. Signed-off-by: Manos Pitsidianakis --- MAINTAINERS | 3 ++ meson.build

[RFC PATCH v4 4/7] rust: add PL011 device model

2024-07-04 Thread Manos Pitsidianakis
-aarch64 should use the Rust version of the pl011 device (unless it is not set up so in hw/arm/virt.c; the type of the UART device is hardcoded). To confirm, inspect `info qom-tree` in the monitor and look for an `x-pl011-rust` device. Signed-off-by: Manos Pitsidianakis

[RFC PATCH v4 6/7] DO NOT MERGE: add rustdoc build for gitlab pages

2024-07-04 Thread Manos Pitsidianakis
Deploy the generated rustdocs for my personal rust qemu fork on gitlab. The URL is: https://rust-for-qemu-epilys-aebb06ca9f9adfe6584811c14ae44156501d935ba4.gitlab.io/pl011/index.html Signed-off-by: Manos Pitsidianakis --- .gitlab-ci.d/buildtest.yml | 64

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

2024-07-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) Signed-off-by: Manos Pitsidianakis --- .gitattributes | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitattributes b

[RFC PATCH v4 1/7] build-sys: Add rust feature option

2024-07-04 Thread Manos Pitsidianakis
Lureau from 2021. https://patchew.org/QEMU/20210907121943.3498701-1-marcandre.lur...@redhat.com/ Signed-off-by: Marc-André Lureau Signed-off-by: Manos Pitsidianakis --- MAINTAINERS | 5 + configure | 11 ++ meson.build | 11

Re: [PATCH v45 3/3] hw/sd/sdcard: Do not store vendor data on block drive (CMD56)

2024-07-03 Thread Manos Pitsidianakis
On Wed, 03 Jul 2024 11:59, Philippe Mathieu-Daudé wrote: "General command" (GEN_CMD, CMD56) is described as: GEN_CMD is the same as the single block read or write commands (CMD24 or CMD17). The difference is that [...] the data block is not a memory payload data but has a vendor specific

Re: [PATCH v45 1/3] hw/sd/sdcard: Remove leftover comment about removed 'spi' Property

2024-07-03 Thread Manos Pitsidianakis
DEFINE_PROP_END_OF_LIST() }; -- 2.41.0 Reviewed-by: Manos Pitsidianakis

Re: [PATCH v2 18/22] qga: don't disable fsfreeze commands if vss_init fails

2024-07-03 Thread Manos Pitsidianakis
ic GAState *initialize_agent(GAConfig *config, int socket_activation) " '%s': %s", config->state_dir, strerror(errno)); return NULL; } + +if (!vss_init(true)) { +g_debug("vss_init failed, vss commands will not function"); +} #endif if (ga_is_frozen(s)) { -- 2.45.1 Otherwise LGTM: Reviewed-by: Manos Pitsidianakis

Re: [PATCH v2 22/22] qga: centralize logic for disabling/enabling commands

2024-07-03 Thread Manos Pitsidianakis
Hello Daniel, This cleanup seems like a good idea, On Thu, 13 Jun 2024 18:44, "Daniel P. Berrangé" wrote: It is confusing having many different pieces of code enabling and disabling commands, and it is not clear that they all have the same semantics, especially wrt prioritization of the

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

2024-07-02 Thread Manos Pitsidianakis
Hi Daniel, I missed one of your questions and I just re-read the thread today, On Mon, 24 Jun 2024 19:52, "Daniel P. Berrangé" wrote: On Wed, Jun 19, 2024 at 11:13:58PM +0300, Manos Pitsidianakis wrote: Add options for Rust in meson_options.txt, meson.build, configure to prepare

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

2024-07-02 Thread Manos Pitsidianakis
ith like this: ``` ./qemu-system-aarch64 -M virt \ -machine virtualization=true -machine virt,gic-version=3 \ -cpu max,pauth-impdef=on -smp 2 -m 4096 \ [.. drive and img arguments ..] \ -nographic ``` Thanks, Pierrick On 6/29/24 01:06, Manos Pitsidianakis wrote: On Fri, 28 Jun 2024 22:12, Pierrick

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

2024-07-01 Thread Manos Pitsidianakis
Hi Berto :) On Mon, 1 Jul 2024 at 11:56, Alberto Garcia wrote: > > On Wed 12 Jun 2024 02:00:19 PM +03, Manos Pitsidianakis wrote: > > Hi, thanks for the review and sorry for taking so long to reply, I was > on vacation. > > >> scrip

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

2024-06-29 Thread Manos Pitsidianakis
On Fri, 28 Jun 2024 22:12, Pierrick Bouvier wrote: I've been able to build rust device on windows, with a few tweaks needed. - specificy the target for libclang (used by bindgen), which targets MSVC by default (so different set of headers) - additional headers (libclang searches its own

Re: [PATCH] include: move typeof_strip_qual to compiler.h, use it in QAPI_LIST_LENGTH()

2024-06-27 Thread Manos Pitsidianakis
On Thu, 27 Jun 2024 11:48, Paolo Bonzini wrote: because if anyone ended up using [..] C++ [..] the error message would be very very long. I thought that comes with the territory 

Re: [PATCH] include: move typeof_strip_qual to compiler.h, use it in QAPI_LIST_LENGTH()

2024-06-27 Thread Manos Pitsidianakis
On Thu, 27 Jun 2024 00:32, Paolo Bonzini wrote: On Tue, Jun 25, 2024 at 9:17 PM Manos Pitsidianakis wrote: >Move the macro to compiler.h and, while at it, move it under #ifndef >__cplusplus to emphasize that it uses C-only constructs. A C++ version >of typeof_strip_qual() using ty

Re: [RFC PATCH v3 5/5] DO NOT MERGE: replace TYPE_PL011 with x-pl011-rust in arm virt machine

2024-06-25 Thread Manos Pitsidianakis
On Tue, 25 Jun 2024 19:18, Zhao Liu wrote: Hi Manos, On Wed, Jun 19, 2024 at 11:14:02PM +0300, Manos Pitsidianakis wrote: Date: Wed, 19 Jun 2024 23:14:02 +0300 From: Manos Pitsidianakis Subject: [RFC PATCH v3 5/5] DO NOT MERGE: replace TYPE_PL011 with x-pl011-rust in arm virt machine X

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

2024-06-25 Thread Manos Pitsidianakis
On Mon, 24 Jun 2024 20:14, Paolo Bonzini wrote: Yes, I agree. However, considering we haven't even checked the situation with what language features are required by any idiomatic bindings vs the 1.63 version that we need to support for Debian, I think it's a bit premature to make it mandatory.

Re: [PATCH] include: move typeof_strip_qual to compiler.h, use it in QAPI_LIST_LENGTH()

2024-06-25 Thread Manos Pitsidianakis
d? -#endif +#else /* __cpluplus */ +#define typeof_strip_qual typeof +#endif /* __cplusplus */ + #endif /* COMPILER_H */ -- 2.45.2 With that comment addressed, Tested-by: Manos Pitsidianakis Reviewed-by: Manos Pitsidianakis

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

2024-06-25 Thread Manos Pitsidianakis
On Tue, 25 Jun 2024 19:00, Zhao Liu wrote: [snip] This is for future-proofing the Rust integration in general. I haven't been able to compile under macos yet because bindgen cannot find the system clang header. I also don't have a windows pc to test it on. But it should work theoretically

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

2024-06-24 Thread Manos Pitsidianakis
Hello Zhao! On Mon, 24 Jun 2024 13:12, Zhao Liu wrote: Hi Manos, Thanks for your patch. I have a few comments below: diff --git a/meson.build b/meson.build index 3533889852..2b305e745a 100644 --- a/meson.build +++ b/meson.build @@ -3876,6 +3876,62 @@ foreach target : target_dirs

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

2024-06-20 Thread Manos Pitsidianakis
On Thu, 20 Jun 2024 17:01, Richard Henderson wrote: On 6/19/24 13:13, Manos Pitsidianakis wrote: +# FIXME: These are the latest stable versions, refine to actual minimum ones. +msrv = { + 'rustc': '1.79.0', + 'cargo': '1.79.0', + 'bindgen': '0.69.4', +} A note for other rust newbies

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

2024-06-20 Thread Manos Pitsidianakis
On Thu, 20 Jun 2024 15:32, Alex Bennée wrote: Manos Pitsidianakis writes: Add mechanism to generate rust hw targets that depend on a custom bindgen target for rust bindings to C. This way bindings will be created before the rust crate is compiled. The bindings will end up in BUILDDIR

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

2024-06-20 Thread Manos Pitsidianakis
On Thu, 20 Jun 2024 15:34, Paolo Bonzini wrote: On Thu, Jun 20, 2024 at 1:10 PM Alex Bennée wrote: > +# FIXME: These are the latest stable versions, refine to actual minimum ones. > +msrv = { > + 'rustc': '1.79.0', > + 'cargo': '1.79.0', > + 'bindgen': '0.69.4', > +} So for Debian

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

2024-06-20 Thread Manos Pitsidianakis
On Thu, 20 Jun 2024 16:41, Alex Bennée wrote: +summary_info += {'Rust support': with_rust} +if with_rust and get_option('with_rust_target_triple') != '' + summary_info += {'Rust target': get_option('with_rust_target_triple')} +endif I wonder if we should display the auto-probed

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

2024-06-20 Thread Manos Pitsidianakis
On Thu, 20 Jun 2024 16:21, Paolo Bonzini wrote: On 6/19/24 22:13, Manos Pitsidianakis wrote: Add options for Rust in meson_options.txt, meson.build, configure to prepare for adding Rust code in the followup commits. `rust` is a reserved meson name, so we have to use an alternative. `with_rust

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

2024-06-19 Thread Manos Pitsidianakis
`info qom-tree` in the monitor and look for an `x-pl011-rust` device. Signed-off-by: Manos Pitsidianakis --- MAINTAINERS| 7 + meson.build| 4 + rust/.cargo/config.toml| 2 + rust/meson.build | 2 + rust/pl011/.gitignore

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

2024-06-19 Thread Manos Pitsidianakis
. This way meson sets up the dependency tree properly. 5. After compiling each rust crate with the cargo_wrapper.py script, its static library artifact is linked as a `whole-archive` with the final binary. Signed-off-by: Manos Pitsidianakis --- MAINTAINERS | 3 + meson.build

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

2024-06-19 Thread Manos Pitsidianakis
Lureau from 2021. https://patchew.org/QEMU/20210907121943.3498701-1-marcandre.lur...@redhat.com/ Signed-off-by: Marc-André Lureau Signed-off-by: Manos Pitsidianakis --- MAINTAINERS | 5 + configure | 11 ++ meson.build | 11

[RFC PATCH v3 4/5] DO NOT MERGE: add rustdoc build for gitlab pages

2024-06-19 Thread Manos Pitsidianakis
Deploy the generated rustdocs for my personal rust qemu fork on gitlab. The URL is: https://rust-for-qemu-epilys-aebb06ca9f9adfe6584811c14ae44156501d935ba4.gitlab.io/pl011/index.html Signed-off-by: Manos Pitsidianakis --- .gitlab-ci.d/buildtest.yml | 64

[RFC PATCH v3 5/5] DO NOT MERGE: replace TYPE_PL011 with x-pl011-rust in arm virt machine

2024-06-19 Thread Manos Pitsidianakis
Convenience patch for testing the rust device. Signed-off-by: Manos Pitsidianakis --- hw/arm/virt.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 3c93c0c0a6..f33b58ae0d 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -912,7 +912,11 @@ static void

[RFC PATCH v3 0/5] Implement ARM PL011 in Rust

2024-06-19 Thread Manos Pitsidianakis
es can be found online at https://gitlab.com/epilys/rust-for-qemu/-/tags Tag/refs: - rust-pl011-rfc-v3 - rust-pl011-rfc-v2 - rust-pl011-rfc-v1 Manos Pitsidianakis (5): build-sys: Add rust feature option rust: add bindgen step as a meson dependency rust: add PL011 device model DO NOT MERG

Re: [RFC PATCH v2 0/5] Implement ARM PL011 in Rust

2024-06-19 Thread Manos Pitsidianakis
On Wed, 19 Jun 2024 06:31, Richard Henderson wrote: On 6/11/24 03:33, Manos Pitsidianakis wrote: If `cargo` and `bindgen` is installed in your system, you should be able to build qemu-system-aarch64 with configure flag --enable-rust and launch an arm virt VM. One of the patches hardcodes

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

2024-06-19 Thread Manos Pitsidianakis
On Wed, 19 Jun 2024 19:52, Richard Henderson wrote: On 6/11/24 03:33, Manos Pitsidianakis wrote: +++ b/scripts/cargo_wrapper.py @@ -0,0 +1,211 @@ +#!/usr/bin/env python3 +# Copyright (c) 2020 Red Hat, Inc. +# Copyright (c) 2023 Linaro Ltd. +# +# Authors: +# Manos Pitsidianakis +# Marc-André

Re: [PATCH] hw/virtio: Fix the de-initialization of vhost-user devices

2024-06-18 Thread Manos Pitsidianakis
n this central place there without any risk to change the behavior of other code. Fixes: 9f6bcfd99f ("hw/virtio: move vm_running check to virtio_device_started") Buglink: https://issues.redhat.com/browse/RHEL-40708 Signed-off-by: Thomas Huth --- Reviewed-by: Manos Pitsidianakis

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

2024-06-17 Thread Manos Pitsidianakis
On Mon, 17 Jun 2024 17:32, Paolo Bonzini wrote: On Mon, Jun 17, 2024 at 4:04 PM Manos Pitsidianakis wrote: I respectfully disagree and recommend taking another look at the code. The device actually performs all logic in non-unsafe methods and is typed instead of operating on raw integers

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

2024-06-17 Thread Manos Pitsidianakis
On Mon, 17 Jun 2024 14:32, Paolo Bonzini wrote: Il lun 17 giu 2024, 10:59 Manos Pitsidianakis < manos.pitsidiana...@linaro.org> ha scritto: >qdev_define_type!(c"test-device", TestDevice); >impl ObjectImpl for TestDevice {} >impl DeviceImpl for TestDevice {}

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

2024-06-17 Thread Manos Pitsidianakis
On Fri, 14 Jun 2024 20:50, Paolo Bonzini wrote: On Fri, Jun 14, 2024 at 9:04 AM Manos Pitsidianakis wrote: On Thu, 13 Jun 2024 23:57, Paolo Bonzini wrote: >On Thu, Jun 13, 2024 at 11:16 AM Daniel P. Berrangé wrote: >> I guess there's a balance to be had somewhere on the spectru

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

2024-06-14 Thread Manos Pitsidianakis
On Thu, 13 Jun 2024 23:57, Paolo Bonzini wrote: On Thu, Jun 13, 2024 at 11:16 AM Daniel P. Berrangé wrote: I guess there's a balance to be had somewhere on the spectrum between doing everything against the raw C binding, vs everything against a perfectly idiomatic Rust API wrapping the C

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

2024-06-13 Thread Manos Pitsidianakis
On Thu, 13 Jun 2024 11:53, "Daniel P. Berrangé" wrote: On Thu, Jun 13, 2024 at 11:41:38AM +0300, Manos Pitsidianakis wrote: > > diff --git a/rust/rustfmt.toml b/rust/rustfmt.toml > > new file mode 100644 > > index 00..ebecb99fe0 > > --- /dev/null >

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

2024-06-13 Thread Manos Pitsidianakis
On Thu, 13 Jun 2024 10:56, Paolo Bonzini wrote: Il gio 13 giu 2024, 09:13 Daniel P. Berrangé ha scritto: On Wed, Jun 12, 2024 at 11:27:04PM +0200, Paolo Bonzini wrote: > Il mer 12 giu 2024, 22:58 Manos Pitsidianakis < > manos.pitsidiana...@linaro.org> ha scritto: > > > I

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

2024-06-13 Thread Manos Pitsidianakis
Hello Zhao :) On Thu, 13 Jun 2024 11:30, Zhao Liu wrote: On Tue, Jun 11, 2024 at 01:33:32PM +0300, Manos Pitsidianakis wrote: Date: Tue, 11 Jun 2024 13:33:32 +0300 From: Manos Pitsidianakis Subject: [RFC PATCH v2 3/5] rust: add PL011 device model X-Mailer: git-send-email 2.44.0 This commit

[PATCH v1 2/3] util/readline.c: add C-n, C-p shortcuts

2024-06-13 Thread Manos Pitsidianakis
C-n and C-p are the default bindings for readline's next-history and previous-history respectively. They have the same functionality as the Down and Up arrow keys. Signed-off-by: Manos Pitsidianakis --- util/readline.c | 8 1 file changed, 8 insertions(+) diff --git a/util/readline.c

[PATCH v1 0/3] util/readline.c: Add common but missing shortcuts

2024-06-13 Thread Manos Pitsidianakis
Some commonly used readline shortcuts are missing from our implementation. This series adds: - Control-n next line, same as Down arrow key - Control-p previous line, same as Up arrow key - Control-u erase line starting from cursor Manos Pitsidianakis (3): util/readline.c:fix lints

[PATCH v1 3/3] util/readline.c: add C-u shortcut

2024-06-13 Thread Manos Pitsidianakis
Add support for the unix-line-discard readline action, which erases from the cursor position up to the beginning of the line. The default binding, C-u, was chosen. This is useful to quickly erase command input while working on the monitor interface. Signed-off-by: Manos Pitsidianakis --- util

[PATCH v1 1/3] util/readline.c:fix lints for readline_handle_byte

2024-06-13 Thread Manos Pitsidianakis
. Signed-off-by: Manos Pitsidianakis --- util/readline.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/util/readline.c b/util/readline.c index 494a3d924e..ded31b04b7 100644 --- a/util/readline.c +++ b/util/readline.c @@ -405,7 +405,7 @@ void

[PATCH v2] virtio-iommu: add error check before assert

2024-06-12 Thread Manos Pitsidianakis
02 0x1 0x10 write 0x19 0x1 0x04 write 0x1c 0x1 0x01 write 0x100018 0x1 0x04 write 0x10001c 0x1 0x02 write 0x101003 0x1 0x01 write 0xe0007001 0x1 0x00 EOF Reported-by: Zheyu Ma Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2359 Signed-off-by: Manos Pitsidianakis --- Range-diff agai

Re: [PATCH v1] virtio-iommu: add error check before assert

2024-06-12 Thread Manos Pitsidianakis
On Wed, 12 Jun 2024 11:56, Alex Bennée wrote: Manos Pitsidianakis writes: On Tue, 11 Jun 2024 at 18:01, Philippe Mathieu-Daudé wrote: On 11/6/24 14:23, Manos Pitsidianakis wrote: > A fuzzer case discovered by Zheyu Ma causes an assert failure. > > Add a check before t

Re: [PATCH v1] virtio-iommu: add error check before assert

2024-06-12 Thread Manos Pitsidianakis
On Wed, 12 Jun 2024 12:46, Alex Bennée wrote: Manos Pitsidianakis writes: A fuzzer case discovered by Zheyu Ma causes an assert failure. Add a check before the assert, and respond with an error before moving on to the next queue element. To reproduce the failure: cat << EOF |

Re: [RFC PATCH v2 0/5] Implement ARM PL011 in Rust

2024-06-12 Thread Manos Pitsidianakis
Good morning Daniel, On Wed, 12 Jun 2024 11:37, "Daniel P. Berrangé" wrote: On Tue, Jun 11, 2024 at 01:33:29PM +0300, Manos Pitsidianakis wrote: .gitignore | 2 + .gitlab-ci.d/buildtest.yml | 64 ++-- MAINTAINERS| 13 +

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

2024-06-12 Thread Manos Pitsidianakis
Good morning Paolo, On Thu, 13 Jun 2024 00:27, Paolo Bonzini wrote: Il mer 12 giu 2024, 22:58 Manos Pitsidianakis < manos.pitsidiana...@linaro.org> ha scritto: In any case, it is out of scope for this RFC. Introducing wrappers would be a gradual process. Sure, how would you feel

Re: Qemu License question

2024-06-12 Thread Manos Pitsidianakis
On Thu, 13 Jun 2024 06:26, Peng Fan wrote: Hi All, The following files are marked as GPL-3.0-or-later. Will these Conflict with Qemu LICENSE? Should we update the files to GPL-2.0? ./tests/tcg/aarch64/semicall.h:7: * SPDX-License-Identifier: GPL-3.0-or-later

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

2024-06-12 Thread Manos Pitsidianakis
On Wed, 12 Jun 2024 19:06, "Daniel P. Berrangé" wrote: On Wed, Jun 12, 2024 at 05:14:56PM +0300, Manos Pitsidianakis wrote: On Wed, 12 Jun 2024 15:29, Paolo Bonzini wrote: > I think this is extremely useful to show where we could go in the task > of creating more id

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

2024-06-12 Thread Manos Pitsidianakis
On Wed, 12 Jun 2024 15:29, Paolo Bonzini wrote: I think this is extremely useful to show where we could go in the task of creating more idiomatic bindings. On Tue, Jun 11, 2024 at 12:34 PM Manos Pitsidianakis wrote: +fn main() { +println!("cargo::rerun-if-env-changed=MESON_BUIL

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

2024-06-12 Thread Manos Pitsidianakis
On Wed, 12 Jun 2024 12:21, Alberto Garcia wrote: On Wed 12 Jun 2024 09:01:01 AM +03, Manos Pitsidianakis wrote: Hello Alberto, Hello Manos! > This is equivalent to using qemu-img to convert a file to qcow2 and > then writing the result to stdout, with the difference that this >

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

2024-06-12 Thread Manos Pitsidianakis
On Mon, 10 Jun 2024 17:47, Alberto Garcia wrote: This tool converts a disk image to qcow2, writing the result directly to stdout. This can be used for example to send the generated file over the network. This is equivalent to using qemu-img to convert a file to qcow2 and then writing the

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

2024-06-12 Thread Manos Pitsidianakis
Hello Alberto, On Mon, 10 Jun 2024 17:47, Alberto Garcia wrote: This tool converts a disk image to qcow2, writing the result directly to stdout. This can be used for example to send the generated file over the network. This is equivalent to using qemu-img to convert a file to qcow2 and then

Re: [PATCH] accel/tcg: Fix typo causing tb->page_addr[1] to not be recorded

2024-06-11 Thread Manos Pitsidianakis
-by: Manos Pitsidianakis

Re: [PATCH 00/26] hw/ppc: Prefer HumanReadableText over Monitor

2024-06-11 Thread Manos Pitsidianakis
| 11 +++- hw/ppc/spapr_irq.c | 4 +- 23 files changed, 256 insertions(+), 254 deletions(-) -- 2.41.0 For the series: Reviewed-by: Manos Pitsidianakis

Re: [RFC PATCH v1 1/6] build-sys: Add rust feature option

2024-06-11 Thread Manos Pitsidianakis
On Tue, 11 Jun 2024 at 17:05, Stefan Hajnoczi wrote: > > On Mon, Jun 10, 2024 at 09:22:36PM +0300, Manos Pitsidianakis wrote: > > Add options for Rust in meson_options.txt, meson.build, configure to > > prepare for adding Rust code in the followup commits. > > > > `

Re: [PATCH v1] virtio-iommu: add error check before assert

2024-06-11 Thread Manos Pitsidianakis
On Tue, 11 Jun 2024 at 18:01, Philippe Mathieu-Daudé wrote: > > On 11/6/24 14:23, Manos Pitsidianakis wrote: > > A fuzzer case discovered by Zheyu Ma causes an assert failure. > > > > Add a check before the assert, and respond with an error before moving > >

Re: [RFC PATCH v1 0/6] Implement ARM PL011 in Rust

2024-06-11 Thread Manos Pitsidianakis
Hello Antonio! On Tue, 11 Jun 2024 15:45, Antonio Caggiano wrote: Hi there :) On 11/06/2024 12:58, Manos Pitsidianakis wrote: On Tue, 11 Jun 2024 13:57, "Daniel P. Berrangé" wrote: On Mon, Jun 10, 2024 at 11:29:36PM +0300, Manos Pitsidianakis wrote: On Mon, 10 Jun 2024 22:37

[PATCH v1] virtio-iommu: add error check before assert

2024-06-11 Thread Manos Pitsidianakis
02 0x1 0x10 write 0x19 0x1 0x04 write 0x1c 0x1 0x01 write 0x100018 0x1 0x04 write 0x10001c 0x1 0x02 write 0x101003 0x1 0x01 write 0xe0007001 0x1 0x00 EOF Reported-by: Zheyu Ma Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2359 Signed-off-by: Manos Pitsidianakis --- hw/virtio/

Re: [RFC PATCH v1 0/6] Implement ARM PL011 in Rust

2024-06-11 Thread Manos Pitsidianakis
On Tue, 11 Jun 2024 14:09, "Daniel P. Berrangé" wrote: On Tue, Jun 11, 2024 at 01:58:10PM +0300, Manos Pitsidianakis wrote: On Tue, 11 Jun 2024 13:57, "Daniel P. Berrangé" wrote: > On Mon, Jun 10, 2024 at 11:29:36PM +0300, Manos Pitsidianakis wrote: > > On Mon

Re: [RFC PATCH v1 0/6] Implement ARM PL011 in Rust

2024-06-11 Thread Manos Pitsidianakis
On Tue, 11 Jun 2024 13:57, "Daniel P. Berrangé" wrote: On Mon, Jun 10, 2024 at 11:29:36PM +0300, Manos Pitsidianakis wrote: On Mon, 10 Jun 2024 22:37, Pierrick Bouvier wrote: > Hello Manos, > > On 6/10/24 11:22, Manos Pitsidianakis wrote: > > Hello everyone, > &

Re: [RFC PATCH v1 0/6] Implement ARM PL011 in Rust

2024-06-11 Thread Manos Pitsidianakis
On Tue, 11 Jun 2024 11:18, "Daniel P. Berrangé" wrote: On Mon, Jun 10, 2024 at 09:22:35PM +0300, Manos Pitsidianakis wrote: What are the issues with not using the compiler, rustc, directly? - [whataretheissueswith] Ba

Re: [RFC PATCH v1 0/6] Implement ARM PL011 in Rust

2024-06-11 Thread Manos Pitsidianakis
On Tue, 11 Jun 2024 12:45, Zhao Liu wrote: On Tue, Jun 11, 2024 at 09:22:44AM +0100, Daniel P. Berrangé wrote: On Mon, Jun 10, 2024 at 09:22:35PM +0300, Manos Pitsidianakis wrote: > Hello everyone, > > This is an early draft of my work on implementing a very simple device, >

Re: [RFC PATCH v1 0/6] Implement ARM PL011 in Rust

2024-06-11 Thread Manos Pitsidianakis
On Tue, 11 Jun 2024 11:22, "Daniel P. Berrangé" wrote: On Mon, Jun 10, 2024 at 09:22:35PM +0300, Manos Pitsidianakis wrote: Hello everyone, This is an early draft of my work on implementing a very simple device, in this case the ARM PL011 (which in C code resides in hw/ch

[RFC PATCH v2 5/5] DO NOT MERGE: replace TYPE_PL011 with x-pl011-rust in arm virt machine

2024-06-11 Thread Manos Pitsidianakis
Convenience patch for testing the rust device. Signed-off-by: Manos Pitsidianakis --- hw/arm/virt.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 3c93c0c0a6..f33b58ae0d 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -912,7 +912,11 @@ static void

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

2024-06-11 Thread Manos Pitsidianakis
. This way meson sets up the dependency tree properly. 5. After compiling each rust crate with the cargo_wrapper.py script, its static library artifact is linked as a `whole-archive` with the final binary. Signed-off-by: Manos Pitsidianakis --- MAINTAINERS | 2 + meson.build

  1   2   3   4   5   6   7   >