QEMU Rust Crates + Plugins in Rust

2022-11-09 Thread Rowan Hart
Hi all, this is my first post to the mailing list! I've spent the last couple weeks building QEMU Rust crates to enable a couple goals: - Install QEMU binaries using cargo, the Rust package manager - Use git-latest QEMU binaries in Rust projects as a dependency - Write QEMU TCG plugins entirely in

[PATCH] plugins: add plugin API to read guest memory

2024-08-21 Thread Rowan Hart
Signed-off-by: Rowan Hart --- docs/about/emulation.rst | 16 - include/qemu/qemu-plugin.h | 24 +++- plugins/api.c| 21 +++ plugins/qemu-plugins.symbols | 1 + tests/tcg/plugins/mem.c | 37 +++- tests/tcg/plugins/syscall.c | 113

Re: [PATCH] plugins: add plugin API to read guest memory

2024-08-26 Thread Rowan Hart
Alex & Pierrick, Thank you for the feedback! This is my first contribution to QEMU, so I'm glad it at least passes the initial smell test :) > I'll make my comments in this patch, but for v2, please split those individual > commits, and a cover letter, describing your changes (https://github.com/

Re: [PATCH] plugins: add plugin API to read guest memory

2024-08-26 Thread Rowan Hart
Alex, Thanks for the additional information. >> >> A key aspect of what you propose here, is that the memory may have >> changed during the write time, and when you read it, while what we >> propose guarantees to track every change correctly. >> >> It's not a bad thing, and both API are definitel

[PATCH v2 1/2] plugins: add plugin API to read guest memory

2024-08-26 Thread Rowan Hart
Signed-off-by: Rowan Hart --- include/qemu/qemu-plugin.h | 32 +++- plugins/api.c| 20 plugins/qemu-plugins.symbols | 1 + 3 files changed, 52 insertions(+), 1 deletion(-) diff --git a/include/qemu/qemu-plugin.h b/include/qemu

[PATCH v2 0/2] plugins: add plugin API to read guest memory

2024-08-26 Thread Rowan Hart
) * Accurate and easier execution trace extraction * Debugging and logging tools An example of its use is added to the existing syscalls plugin, which now has an option to hexdump the buf argument to any write(2) syscalls which occur. Rowan Hart (2): plugins: add plugin API to read guest memory

[PATCH v2 2/2] plugins: add option to dump write argument to syscall plugin

2024-08-26 Thread Rowan Hart
Signed-off-by: Rowan Hart --- docs/about/emulation.rst| 14 - tests/tcg/plugins/syscall.c | 117 2 files changed, 130 insertions(+), 1 deletion(-) diff --git a/docs/about/emulation.rst b/docs/about/emulation.rst index eea1261baa..e85d494ff0 100644

[PATCH v3 1/2] plugins: add plugin API to read guest memory

2024-08-27 Thread Rowan Hart
Signed-off-by: Rowan Hart Reviewed-by: Pierrick Bouvier --- include/qemu/qemu-plugin.h | 32 +++- plugins/api.c| 20 plugins/qemu-plugins.symbols | 1 + 3 files changed, 52 insertions(+), 1 deletion(-) diff --git a/include

[PATCH v3 0/2] plugins: add plugin API to read guest memory

2024-08-27 Thread Rowan Hart
doc build issue. Rowan Hart (2): plugins: add plugin API to read guest memory plugins: add option to dump write argument to syscall plugin docs/about/emulation.rst | 14 - include/qemu/qemu-plugin.h | 32 +- plugins/api.c| 20 ++ plugins/qemu-plugi

[PATCH v3 2/2] plugins: add option to dump write argument to syscall plugin

2024-08-27 Thread Rowan Hart
Signed-off-by: Rowan Hart Reviewed-by: Pierrick Bouvier Tested-by: Pierrick Bouvier --- docs/about/emulation.rst| 14 - tests/tcg/plugins/syscall.c | 117 2 files changed, 130 insertions(+), 1 deletion(-) diff --git a/docs/about/emulation.rst b

[PATCH 0/1] plugins: add API to read guest CPU memory from hwaddr

2024-08-27 Thread Rowan Hart
00 00 00 00 00 00 00 00 00 00 00 00 00 | Hello, RISC-V! Rowan Hart (1): plugins: add API to read guest CPU memory from hwaddr include/qemu/qemu-plugin.h | 22 ++ plugins/api.c| 17 + plugins/qemu-plugins.symbols | 2 ++ 3

[PATCH 1/1] plugins: add API to read guest CPU memory from hwaddr

2024-08-27 Thread Rowan Hart
Signed-off-by: Rowan Hart --- include/qemu/qemu-plugin.h | 22 ++ plugins/api.c| 17 + plugins/qemu-plugins.symbols | 2 ++ 3 files changed, 41 insertions(+) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index

Re: [PATCH 1/1] plugins: add API to read guest CPU memory from hwaddr

2024-08-28 Thread Rowan Hart
> + qemu_plugin_read_cpu_memory_hwaddr; > + qemu_plugin_read_io_memory_hwaddr; This second symbol name should be removed, I initially wanted to implement for IO as well but there is no good generic way I can see to access a list of IO AddressSpace to read from.

[PATCH v2 1/1] plugins: add API to read guest CPU memory from hwaddr

2024-08-29 Thread Rowan Hart
Signed-off-by: Rowan Hart --- include/qemu/qemu-plugin.h | 22 ++ plugins/api.c| 17 + plugins/qemu-plugins.symbols | 1 + 3 files changed, 40 insertions(+) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index

[PATCH v2 0/1] plugins: add API to read guest CPU memory from hwaddr

2024-08-29 Thread Rowan Hart
00 00 00 00 00 00 00 00 00 00 00 00 00 | Hello, RISC-V! For v2, removes a symbol left in qemu-plugins.symbols accidentally. Rowan Hart (1): plugins: add API to read guest CPU memory from hwaddr include/qemu/qemu-plugin.h | 22 ++ plugins/

Re: [PATCH 0/1] plugins: add API to read guest CPU memory from hwaddr

2024-09-17 Thread Rowan Hart
> > See: > > tests/tcg/i386/system/boot.S > tests/tcg/alpha/system/boot.S > tests/tcg/loongarch64/system/boot.S > tests/tcg/aarch64/system/boot.S > tests/tcg/x86_64/system/boot.S > tests/tcg/arm/system/boot.S > > for what is needed (basically a MMU-enabled flat memory map and some >

[PATCH v2 2/3] Add plugin API functions for register R/W, hwaddr R/W, vaddr W

2024-12-06 Thread Rowan Hart
From: novafacing --- include/qemu/qemu-plugin.h | 116 + plugins/api.c | 66 - 2 files changed, 168 insertions(+), 14 deletions(-) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 0fba36ae02..b812593

[PATCH v2 0/3] Add additional plugin API functions to read and write memory and registers

2024-12-06 Thread Rowan Hart
This patch set follows a previous patch which added the qemu_plugin_read_memory_vaddr function and adds a set of similar functions to read and write registers, virtual memory, and physical memory. The use case I have in mind is for use of QEMU for program analysis and testing. For example, a fuzze

[PATCH v2 3/3] Add inject plugin and x86_64 target for the inject plugin

2024-12-06 Thread Rowan Hart
tests/tcg/plugins/inject.c create mode 100644 tests/tcg/x86_64/inject-target.c diff --git a/tests/tcg/plugins/inject.c b/tests/tcg/plugins/inject.c new file mode 100644 index 00..9edc2cd34e --- /dev/null +++ b/tests/tcg/plugins/inject.c @@ -0,0 +1,206 @@ +/* + * Copyright (C) 2024, Rowan

[PATCH v2 1/3] Expose gdb_write_register function to consumers of gdbstub

2024-12-06 Thread Rowan Hart
From: novafacing --- gdbstub/gdbstub.c | 2 +- include/exec/gdbstub.h | 14 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index b1def7e71d..7d87a3324c 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -536,7 +536

[PATCH 0/2] Add additional plugin API functions to read and write memory and registers

2024-12-06 Thread Rowan Hart
This patch set follows a previous patch which added the qemu_plugin_read_memory_vaddr function and adds a set of similar functions to read and write registers, virtual memory, and physical memory. The use case I have in mind is for use of QEMU for program analysis and testing. For example, a fuzze

[PATCH 1/2] Expose gdb_write_register function to consumers of gdbstub

2024-12-06 Thread Rowan Hart
From: novafacing --- gdbstub/gdbstub.c | 2 +- include/exec/gdbstub.h | 14 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index b1def7e71d..7d87a3324c 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -536,7 +536

[PATCH 2/2] Add plugin API functions for register R/W, hwaddr R/W, vaddr W

2024-12-06 Thread Rowan Hart
From: novafacing --- include/qemu/qemu-plugin.h | 116 + plugins/api.c | 66 - 2 files changed, 168 insertions(+), 14 deletions(-) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 0fba36ae02..b812593

Re: [PATCH v2 3/3] Add inject plugin and x86_64 target for the inject plugin

2024-12-06 Thread Rowan Hart
>> +++ b/tests/tcg/plugins/inject.c > > Could we find a better name? For sure, maybe "hypercalls.c" since that's really what it's mostly about. >> @@ -0,0 +1,206 @@ >> +/* >> + * Copyright (C) 2024, Rowan Hart >> + * >> + * Licen

Re: [PATCH v2 0/3] Add additional plugin API functions to read and write memory and registers

2024-12-06 Thread Rowan Hart
> I am personally in favor to adding such features in upstream QEMU, but we > should discuss it with the maintainers, because it would allow to change the > state of execution, which is something qemu plugins actively didn't try to > do. It's a real paradigm shift for plugins. > > By writing to