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

Re: [PATCH v4 15/16] migration/multifd: Register nocomp ops dynamically

2024-08-25 Thread Philippe Mathieu-Daudé
On 23/8/24 19:39, Fabiano Rosas wrote: Prior to moving the ram code into multifd-nocomp.c, change the code to register the nocomp ops dynamically so we don't need to have the ops structure defined in multifd.c. While here, move the ops struct initialization to the end of the file to make the nex

Re: [PATCH v4 10/16] migration/multifd: Isolate ram pages packet data

2024-08-25 Thread Philippe Mathieu-Daudé
On 23/8/24 19:39, Fabiano Rosas wrote: While we cannot yet disentangle the multifd packet from page data, we can make the code a bit cleaner by setting the page-related fields in a separate function. Signed-off-by: Fabiano Rosas --- migration/multifd.c| 99 +---

Re: [PATCH] MAINTAINERS: Add myself as a reviewer of VT-d

2024-08-25 Thread Jason Wang
On Tue, Aug 20, 2024 at 6:36 PM Philippe Mathieu-Daudé wrote: > > On 20/8/24 11:51, CLEMENT MATHIEU--DRIF wrote: > > Signed-off-by: Clément Mathieu--Drif > > --- > > MAINTAINERS | 1 + > > 1 file changed, 1 insertion(+) > > Reviewed-by: Philippe Mathieu-Daudé Acked-by: Jason Wang Thanks >

Re: [PATCH v3 4/4] tests/tcg/aarch64: Extend MTE gdbstub tests to system mode

2024-08-25 Thread Philippe Mathieu-Daudé
Hi Gustavo, On 25/8/24 16:52, Gustavo Romero wrote: Extend MTE gdbstub tests to also run in system mode (share tests between user mode and system mode). The tests will only run if a version of GDB that supports MTE on baremetal is available in the test environment and if available compiler suppo

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

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

2024-08-25 Thread Junjie Mao
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-by: Paolo Bonzini Signed-off-by: Junjie Mao Signed-off-by:

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

2024-08-25 Thread Junjie Mao
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, procedural macros, or macros that can generate arbitrary code, need to

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

2024-08-25 Thread Junjie Mao
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-by: Paolo Bonzini Signed-off-by: Junjie Mao Sig

RE: [PATCH RESEND v4 3/3] tests/qtest/bios-tables-test: Update virt SPCR golden reference for RISC-V

2024-08-25 Thread JeeHeng Sia
> -Original Message- > From: Sunil V L > Sent: Friday, August 23, 2024 9:20 PM > To: JeeHeng Sia > Cc: qemu-...@nongnu.org; qemu-devel@nongnu.org; qemu-ri...@nongnu.org; > m...@redhat.com; imamm...@redhat.com; > anisi...@redhat.com; peter.mayd...@linaro.org; shannon.zha...@gmail.com;

RE: [PATCH RESEND v4 2/3] hw/acpi: Upgrade ACPI SPCR table to support SPCR table revision 4 format

2024-08-25 Thread JeeHeng Sia
> -Original Message- > From: Sunil V L > Sent: Friday, August 23, 2024 9:15 PM > To: JeeHeng Sia > Cc: qemu-...@nongnu.org; qemu-devel@nongnu.org; qemu-ri...@nongnu.org; > m...@redhat.com; imamm...@redhat.com; > anisi...@redhat.com; peter.mayd...@linaro.org; shannon.zha...@gmail.com;

Re: [PATCH v9 11/12] target/arm: add an experimental mpidr arm cpu property object

2024-08-25 Thread Mauro Carvalho Chehab
Em Sun, 25 Aug 2024 12:34:14 +0100 Peter Maydell escreveu: > On Sun, 25 Aug 2024 at 04:46, Mauro Carvalho Chehab > wrote: > > > > Accurately injecting an ARM Processor error ACPI/APEI GHES > > error record requires the value of the ARM Multiprocessor > > Affinity Register (mpidr). > > > > While

[PATCH v4 0/2] RISC-V: Add preliminary textra trigger CSR functions

2024-08-25 Thread Alvin Chang via
According to RISC-V Debug specification, the optional textra32 and textra64 trigger CSRs can be used to configure additional matching conditions for the triggers. This series support to write MHVALUE and MHSELECT fields into textra32 and textra64 trigger CSRs. Besides, the additional matching cond

[PATCH v4 1/2] target/riscv: Preliminary textra trigger CSR writting support

2024-08-25 Thread Alvin Chang via
This commit allows program to write textra trigger CSR for type 2, 3, 6 triggers. In this preliminary patch, the textra.MHVALUE and the textra.MHSELECT fields are allowed to be configured. Other fields, such as textra.SBYTEMASK, textra.SVALUE, and textra.SSELECT, are hardwired to zero for now. For

[PATCH v4 2/2] target/riscv: Add textra matching condition for the triggers

2024-08-25 Thread Alvin Chang via
According to RISC-V Debug specification, the optional textra32 and textra64 trigger CSRs can be used to configure additional matching conditions for the triggers. For example, if the textra.MHSELECT field is set to 4 (mcontext), this trigger will only match or fire if the low bits of mcontext/hcont

Re: [PATCH] hw/misc: Add a virtual PCILeech device

2024-08-25 Thread Zero Tang
I'd like to *PING* this patch once again. Please review this patch. If there is anything missing or ambiguous in the patch, please let me know. Thanks, Zero Tang On Sun, Aug 18, 2024 at 1:30 AM Zero Tang wrote: > Hello, > > I'd like to ping this patch in that the QEMU-PCILeech plugin is now mer

Re: [PATCH] target/riscv/kvm: Fix the group bit setting of AIA

2024-08-25 Thread Alistair Francis
On Wed, Aug 21, 2024 at 5:51 PM Andrew Jones wrote: > > Just as the hart bit setting of the AIA should be calculated as > ceil(log2(max_hart_id + 1)) the group bit setting should be > calculated as ceil(log2(max_group_id + 1)). The hart bits are > implemented by passing max_hart_id to find_last_bi

Re: [PATCH RESEND v4 1/3] qtest: allow SPCR acpi table changes

2024-08-25 Thread Alistair Francis
On Fri, Aug 23, 2024 at 9:33 PM Sia Jee Heng wrote: > > Signed-off-by: Sia Jee Heng Acked-by: Alistair Francis Alistair > --- > tests/qtest/bios-tables-test-allowed-diff.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tests/qtest/bios-tables-test-allowed-diff.h > b/tests/qtest/bi

Re: [PATCH v3 2/2] target/riscv: Add textra matching condition for the triggers

2024-08-25 Thread Alistair Francis
On Tue, Aug 20, 2024 at 2:00 PM Alvin Che-Chia Chang(張哲嘉) wrote: > > Hi Alistair, > > > -Original Message- > > From: Alvin Che-Chia Chang(張哲嘉) > > Sent: Sunday, July 21, 2024 3:24 PM > > To: qemu-ri...@nongnu.org; qemu-devel@nongnu.org > > Cc: alistair.fran...@wdc.com; bin.m...@windriver.

Re: [PATCH] target: riscv: Enable Bit Manip for OpenTitan Ibex CPU

2024-08-25 Thread Alistair Francis
On Fri, Aug 23, 2024 at 10:32 AM Alistair Francis wrote: > > The OpenTitan Ibex CPU now supports the the Zba, Zbb, Zbc > and Zbs bit-manipulation sub-extensions ratified in > v.1.0.0 of the RISC-V Bit- Manipulation ISA Extension, so let's enable > them in QEMU as well. > > 1: https://github.com/lo

Re: [PATCH] target/riscv: fix za64rs enabling

2024-08-25 Thread Alistair Francis
On Fri, Aug 23, 2024 at 4:39 PM Vladimir Isaev wrote: > > za64rs requires priv 1.12 when enabled by priv 1.11. > > This fixes annoying warning: > warning: disabling za64rs extension for hart 0x because privilege > spec version does not match > > on priv 1.11 CPUs. > > Fixes: 68c9e54beae8

Re: [PATCH] target/riscv/tcg/tcg-cpu.c: consider MISA bit choice in implied rule

2024-08-25 Thread Alistair Francis
On Sun, Aug 25, 2024 at 3:34 AM Daniel Henrique Barboza wrote: > > Gitlab issue [1] reports a misleading error when trying to run a 'rv64' > cpu with 'zfinx' and without 'f': > > $ ./build/qemu-system-riscv64 -nographic -M virt -cpu rv64,zfinx=true,f=false > qemu-system-riscv64: Zfinx cannot be su

Re: [PATCH] target/riscv: fix za64rs enabling

2024-08-25 Thread Alistair Francis
On Fri, Aug 23, 2024 at 4:39 PM Vladimir Isaev wrote: > > za64rs requires priv 1.12 when enabled by priv 1.11. > > This fixes annoying warning: > warning: disabling za64rs extension for hart 0x because privilege > spec version does not match > > on priv 1.11 CPUs. > > Fixes: 68c9e54beae8

Re: [PATCH] target/riscv/tcg/tcg-cpu.c: consider MISA bit choice in implied rule

2024-08-25 Thread Alistair Francis
On Sun, Aug 25, 2024 at 3:34 AM Daniel Henrique Barboza wrote: > > Gitlab issue [1] reports a misleading error when trying to run a 'rv64' > cpu with 'zfinx' and without 'f': > > $ ./build/qemu-system-riscv64 -nographic -M virt -cpu rv64,zfinx=true,f=false > qemu-system-riscv64: Zfinx cannot be su

Re: [PATCH for-9.2 6/6] hm/nvram/xlnx-versal-efuse-ctrl: Call register_finalize_block

2024-08-25 Thread Alistair Francis
On Fri, Aug 23, 2024 at 2:22 AM Peter Maydell wrote: > > The TYPE_XLNX_VERSAL_EFUSE_CTRL device creates a register block with > register_init_block32() in its instance_init method; we must > therefore destroy it in our instance_finalize method to avoid a leak > in the QOM introspection "init-inspe

Re: [PATCH for-9.2 5/6] hw/misc/xlnx-versal-trng: Call register_finalize_block

2024-08-25 Thread Alistair Francis
On Fri, Aug 23, 2024 at 2:22 AM Peter Maydell wrote: > > The TYPE_XLNX_VERSAL_TRNG device creates a register block with > register_init_block32() in its instance_init method; we must > therefore destroy it in our instance_finalize method to avoid a leak > in the QOM introspection "init-inspect-fin

Re: [PATCH for-9.2 4/6] hw/nvram/xlnx-zynqmp-efuse: Call register_finalize_block

2024-08-25 Thread Alistair Francis
On Fri, Aug 23, 2024 at 2:23 AM Peter Maydell wrote: > > The TYPE_XLNX_ZYNQMP_EFUSE device creates a register block with > register_init_block32() in its instance_init method; we must > therefore destroy it in our instance_finalize method to avoid a leak > in the QOM introspection "init-inspect-fi

Re: [PATCH for-9.2 3/6] hw/nvram/xlnx-bbram: Call register_finalize_block

2024-08-25 Thread Alistair Francis
On Fri, Aug 23, 2024 at 2:22 AM Peter Maydell wrote: > > The TYPE_XLNX_BBRAM device creates a register block with > register_init_block32() in its instance_init method; we must > therefore destroy it in our instance_finalize method to avoid a leak > in the QOM introspection "init-inspect-finalize"

Re: [PATCH v2 0/4] hw/ufs: ufs device testing function added and modified

2024-08-25 Thread Jeuk Kim
Thank you for your contribution. Reviewed-by: Jeuk Kim On 8/22/2024 5:08 PM, Yoochan Jeong wrote: Previously, it was only able to test virtual UFS devices if they properly read and write storage data. In this patch, three test functions are added to test if virtual UFS devices properly read a

Re: [PATCH for-9.2 2/6] hw/misc/xlnx-versal-trng: Free s->prng in finalize, not unrealize

2024-08-25 Thread Alistair Francis
On Fri, Aug 23, 2024 at 2:22 AM Peter Maydell wrote: > > The TYPE_XLNX_VERSAL_TRNG device creates s->prng with g_rand_new() > in its init method, but it frees it in its unrealize method. This > results in a leak in the QOM introspection "initialize-inspect-finalize" > lifecycle: > > Direct leak of

Re: [PATCH for-9.2 1/6] hw/misc/xlnx-versal-cfu: destroy fifo in finalize

2024-08-25 Thread Alistair Francis
On Fri, Aug 23, 2024 at 2:22 AM Peter Maydell wrote: > > Since the TYPE_XNLX_VERSAL_CFU_FDRO device creates a FIFO in its > instance_init method, we must destroy the FIFO in instance_finalize > to avoid a memory leak for the QOM introspection > "instantiate-examine-finalize" cycle: > > Direct leak

Re: [PATCH v8 04/17] target/riscv: additional code information for sw check

2024-08-25 Thread Richard Henderson
On 8/24/24 05:01, Deepak Gupta wrote: diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index 12484ca7d2..9f08a67a9e 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -1761,6 +1761,8 @@ void riscv_cpu_do_interrupt(CPUState *cs) cs->watchp

Re: [PATCH 2/5] hw/net/can/xlnx-versal-canfd: Fix CAN FD flag check

2024-08-25 Thread Doug Brown
Hi Peter and Pavel, On 8/25/2024 10:30 AM, Peter Maydell wrote: > We're currently still in codefreeze for the upcoming 9.1 release, > so I would recommend sending a v2 with the extra patches. Nothing > except critical bugfixes is going to be applied upstream for > the next week or two. Thanks, t

Re: [PATCH 2/5] hw/net/can/xlnx-versal-canfd: Fix CAN FD flag check

2024-08-25 Thread Peter Maydell
On Sat, 24 Aug 2024 at 02:55, Doug Brown wrote: > Now, all of these patches are reviewed but there are a few other issues > we talked about here (dlc2len/len2dlc and issues with the flags), and I > also found a FIFO issue. Would it make the most sense for me to submit a > V2 of this series with a

Re: Issue with QEMU Live Migration

2024-08-25 Thread Arisetty, Chakri
Hello, > Is this a type of migration that you have attempted before and it used > to work? Or is this the first time you're using the mirror job for live > migration? We have been using live migration for a quite some time (about 5 years) and this issue has been present for many years. It is no

Re: [PATCH 2/5] hw/net/can/xlnx-versal-canfd: Fix CAN FD flag check

2024-08-25 Thread Pavel Pisa
Hello Doug On Saturday 24 of August 2024 03:54:00 Doug Brown wrote: > Thank you for reviewing all of my patches, Francisco. > > Now, all of these patches are reviewed but there are a few other issues > we talked about here (dlc2len/len2dlc and issues with the flags), and I > also found a FIFO issu

[PATCH v3 4/4] tests/tcg/aarch64: Extend MTE gdbstub tests to system mode

2024-08-25 Thread Gustavo Romero
Extend MTE gdbstub tests to also run in system mode (share tests between user mode and system mode). The tests will only run if a version of GDB that supports MTE on baremetal is available in the test environment and if available compiler supports the 'memtag' flag (-march=armv8.5-a+memtag). For t

[PATCH v3 1/4] gdbstub: Use specific MMU index when probing MTE addresses

2024-08-25 Thread Gustavo Romero
Use cpu_mmu_index() to determine the specific translation regime (MMU index) before probing addresses using allocation_tag_mem_probe(). Currently, the MMU index is hardcoded to 0 and only works for user mode. By obtaining the specific MMU index according to the translation regime, future use of th

[PATCH v3 3/4] tests/guest-debug: Support passing arguments to the GDB test script

2024-08-25 Thread Gustavo Romero
This commit adds support for passing arguments to the GDB test scripts so it's possible to parse the args in an "argparse way" in the test scripts launched by the runner. The arguments should be preceded by -- when passed to the runner. For example, passing "--help" arg to the GDB_TEST_SCRIPT: run

[PATCH v3 0/4] gdbstub: Add support for MTE in system mode

2024-08-25 Thread Gustavo Romero
This patchset makes handle_q_memtag, handle_q_isaddresstagged, and handle_Q_memtag stubs build for system mode, allowing all GDB 'memory-tag' subcommands to work with QEMU gdbstub on aarch64 system mode. It also extends the MTE gdbstub tests to run in system mode, sharing the tests between QEMU us

[PATCH v3 2/4] gdbstub: Add support for MTE in system mode

2024-08-25 Thread Gustavo Romero
This commit makes handle_q_memtag, handle_q_isaddresstagged, and handle_Q_memtag stubs build for system mode, allowing all GDB 'memory-tag' subcommands to work with QEMU gdbstub on aarch64 system mode. Signed-off-by: Gustavo Romero Reviewed-by: Richard Henderson --- target/arm/gdbstub64.c | 4 +

Re: [PATCH RESEND] hw/openrisc/openrisc_sim: keep serial@90000000 as default

2024-08-25 Thread Peter Maydell
On Sun, 25 Aug 2024 at 12:35, Jason A. Donenfeld wrote: > > On Fri, Aug 23, 2024 at 07:28:43AM +0100, Stafford Horne wrote: > > Also, I will wait to see if Jason has anything to say. > > So long as this doesn't change the assignment of the serial ports to > device nodes in Linux, I don't think thi

Re: [PATCH for-9.2] hw/arm/sbsa-ref: Don't leak string in sbsa_fdt_add_gic_node()

2024-08-25 Thread Richard Henderson
On 8/23/24 16:42, Philippe Mathieu-Daudé wrote:   static void sbsa_fdt_add_gic_node(SBSAMachineState *sms)   { -    char *nodename; +    const char *intc_nodename = "/intc"; +    const char *its_nodename = "/intc/its"; Should we use static qualifiers?' No. The real object is the string liter

Re: [PATCH RESEND] hw/openrisc/openrisc_sim: keep serial@90000000 as default

2024-08-25 Thread Jason A. Donenfeld
On Fri, Aug 23, 2024 at 07:28:43AM +0100, Stafford Horne wrote: > Also, I will wait to see if Jason has anything to say. So long as this doesn't change the assignment of the serial ports to device nodes in Linux, I don't think this should interfere with much. You might want to try it, though. Jas

Re: [PATCH v9 11/12] target/arm: add an experimental mpidr arm cpu property object

2024-08-25 Thread Peter Maydell
On Sun, 25 Aug 2024 at 04:46, Mauro Carvalho Chehab wrote: > > Accurately injecting an ARM Processor error ACPI/APEI GHES > error record requires the value of the ARM Multiprocessor > Affinity Register (mpidr). > > While ARM implements it, this is currently not visible. > > Add a field at CPU stor

[PATCH v3] hw/cxl: fix physical address field in get scan media results output

2024-08-25 Thread peng guo
When using the mailbox command get scan media results, the scan media restart physical address field in the ouput palyload is not 64-byte aligned. This patch removed the error source of the restart physical address. The Scan Media Restart Physical Address is the location from which the host s