Re: [PATCH v10 02/21] linux-user/riscv: set priv for qemu-user and defaults for *envcfg

2024-08-27 Thread Deepak Gupta
On Wed, Aug 28, 2024 at 10:10:44AM +1000, Alistair Francis wrote: On Wed, Aug 28, 2024 at 9:20 AM Deepak Gupta wrote: set priv to be PRV_U for qemu-user on riscv. And set default value for *envcfg CSR. Signed-off-by: Deepak Gupta You can probably just squash this with the previous patch

[PATCH] hw/arm/xilinx_zynq: Enable Security Extensions

2024-08-27 Thread Sebastian Huber
The system supports the Security Extensions (core and GIC). This change is necessary to run tests which pass on the real hardware. Signed-off-by: Sebastian Huber --- hw/arm/xilinx_zynq.c | 8 1 file changed, 8 deletions(-) diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c index

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

2024-08-27 Thread Manos Pitsidianakis
Hello everyone, This series adds: - build system support for the Rust compiler - a small Rust library, qemu-api, which includes bindings to QEMU's C interface generated with bindgen, and qemu-api-macros, a procedural macro library. - a proof of concept ARM PL011 device implementation in Rust,

[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 4/9] rust: add bindgen step as a meson dependency

2024-08-27 Thread Manos Pitsidianakis
Add bindings_rs target for generating rust bindings to target-independent qemu C APIs. The bindings need be created before any rust crate that uses them is compiled. The bindings.rs file will end up in BUILDDIR/bindings.rs and have the same name as a target: ninja bindings.rs Signed-off-by: P

[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 file ch

[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 8/9] rust: add utility procedural macro crate

2024-08-27 Thread Manos Pitsidianakis
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, procedural macros, or macros that can generate arbitrary code, need to be special separate compilation units. Only one ma

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

2024-08-27 Thread Manos Pitsidianakis
This commit adds a re-implementation of hw/char/pl011.c in Rust. How to build: 1. Configure a QEMU build with: --enable-system --target-list=aarch64-softmmu --enable-rust 2. Launching a VM with qemu-system-aarch64 should use the Rust version of the pl011 device Co-authored-by: Junjie Mao

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

[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 1/2] chardev: Fix record/replay error path NULL deref in device creation

2024-08-27 Thread Nicholas Piggin
qemu_chardev_set_replay() was being called in chardev creation to set up replay parameters even if the chardev is NULL. A segfault can be reproduced by specifying '-serial chardev:bad' with an rr=record mode. Fix this with a NULL pointer check. Reported-by: Peter Maydell Resolves: Coverity CID

[PATCH 2/2] chardev: Remove __-prefixed names

2024-08-27 Thread Nicholas Piggin
Peter points out double underscore prefix names tend to be reserved for the system. Clean these up. Suggested-by: Peter Maydell Signed-off-by: Nicholas Piggin --- chardev/char.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/chardev/char.c b/chardev/ch

[PATCH 0/2] chardev: fixes for recent record/replay on muxed

2024-08-27 Thread Nicholas Piggin
Fix a couple of issues that Peter found with recent record/replay fix for muxed device. Thanks, Nick Nicholas Piggin (2): chardev: Fix record/replay error path NULL deref in device creation chardev: Remove __-prefixed names chardev/char.c | 22 -- 1 file changed, 12 inse

Re: [PATCH v4 2/2] kvm: refactor core virtual machine creation into its own function

2024-08-27 Thread Markus Armbruster
Ani Sinha writes: > On Tue, 27 Aug, 2024, 8:59 pm Peter Maydell, > wrote: > >> On Tue, 27 Aug 2024 at 16:11, Ani Sinha wrote: >> > >> > Refactoring the core logic around KVM_CREATE_VM into its own separate >> function >> > so that it can be called from other functions in subsequent patches. >>

Re: [PATCH v4 6/7] memory: Do not create circular reference with subregion

2024-08-27 Thread Akihiko Odaki
On 2024/08/28 1:11, Peter Xu wrote: On Tue, Aug 27, 2024 at 01:14:51PM +0900, Akihiko Odaki wrote: On 2024/08/27 4:42, Peter Xu wrote: On Mon, Aug 26, 2024 at 06:10:25PM +0100, Peter Maydell wrote: On Mon, 26 Aug 2024 at 16:22, Peter Xu wrote: On Fri, Aug 23, 2024 at 03:13:11PM +0900, Akihi

Re: [External] Re: [PATCH v9 09/10] hw/nvme: add reservation protocal command

2024-08-27 Thread Klaus Jensen
On Jul 26 05:54, 卢长奇 wrote: > Hi; > > You can test it in spdk. > First start spdk and execute the following command. > > ``` > dd if=/dev/zero of=test.img bs=1G count=10 > RPC=/root/source/spdk/spdk/scripts/rpc.py > FILE=/root/test.img > > $RPC bdev_aio_create $FILE aio0 512 > $RPC iscsi_create_

Re: [PATCH v9 09/10] hw/nvme: add reservation protocal command

2024-08-27 Thread Klaus Jensen
On Jul 12 10:36, Changqi Lu wrote: > Add reservation acquire, reservation register, > reservation release and reservation report commands > in the nvme device layer. > > By introducing these commands, this enables the nvme > device to perform reservation-related tasks, including > querying keys, q

Re: [PATCH v4 1/2] kvm: replace fprintf with error_report/printf() in kvm_init()

2024-08-27 Thread Markus Armbruster
Ani Sinha writes: > error_report() is more appropriate for error situations. Replace fprintf with > error_report. Cosmetic. No functional change. > > CC: qemu-triv...@nongnu.org > CC: zhao1@intel.com > CC: arm...@redhat.com > Reviewed-by: Zhao Liu > Signed-off-by: Ani Sinha > --- > accel/k

Re: [External] Re: [PATCH v9 09/10] hw/nvme: add reservation protocal command

2024-08-27 Thread 卢长奇
Hi, Thanks for your advice. Previously, g_malloc0 was used, but a segmentation fault occurred during testing. Later, debugging revealed that a field in struct NvmeReservationStatusExt, struct NvmeRegisteredCtrlExt regctl_eds[], was a variable-length array. Therefore, g_malloc was used to apply aft

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

2024-08-27 Thread Rowan Hart
This patch adds a single API function which allows reading from a guest CPU physical address. I don't know of a good way to add a self-contained test for this feature to tests/tcg/plugins, but I did come up with a small test case to demonstrate the functionality using peiyuanix/riscv-os: First, g

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

Re: [PATCH 0/2] chardev: fixes for recent record/replay on muxed

2024-08-27 Thread Marc-André Lureau
Hi On Wed, Aug 28, 2024 at 8:34 AM Nicholas Piggin wrote: > Fix a couple of issues that Peter found with recent record/replay > fix for muxed device. > > Thanks, > Nick > > Nicholas Piggin (2): > chardev: Fix record/replay error path NULL deref in device creation > chardev: Remove __-prefixe

Re: [PATCH v9 09/10] hw/nvme: add reservation protocal command

2024-08-27 Thread Klaus Jensen
On Jul 12 10:36, Changqi Lu wrote: > Add reservation acquire, reservation register, > reservation release and reservation report commands > in the nvme device layer. > > By introducing these commands, this enables the nvme > device to perform reservation-related tasks, including > querying keys, q

Re: [PATCH] virtio/vhost-user: fix qemu crash when hotunplug vhost-user-net device

2024-08-27 Thread Zhenguo Yao
I am very sorry that my previous description was not accurate. Below I will describe the steps to reproduce this problem and my analysis in detail.The conditions for reproducing this problem are quite demanding. First, let me introduce my environment. I use DPDK vdpa to drive DPU to implement a vho

<    1   2   3