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

2024-08-26 Thread JeeHeng Sia
> -Original Message- > From: Sunil V L > Sent: Friday, August 23, 2024 10:29 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 0/3] Upgrade ACPI SPCR table to support SPCR table revision 4 format

2024-08-26 Thread Sunil V L
Hi Jee Heng, On Mon, Aug 26, 2024 at 07:04:11AM +, JeeHeng Sia wrote: > > > > -Original Message- > > From: Sunil V L > > Sent: Friday, August 23, 2024 10:29 PM > > To: JeeHeng Sia > > Cc: qemu-...@nongnu.org; qemu-devel@nongnu.org; qemu-ri...@nongnu.org; > > m...@redhat.com; imamm

Re: [External] Re: [PATCH v8 4/5] migration: Introduce 'qatzip' compression method

2024-08-26 Thread Prasad Pandit
On Sat, 24 Aug 2024 at 04:22, Yichen Wang wrote: > The patch was originally written exactly like what you suggest, > cleanup in the error path of the same function. However, later I > realized in gdb that I was wrong. The qatzip_send_cleanup() function > will be called later in another thread in b

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

2024-08-26 Thread JeeHeng Sia
> -Original Message- > From: Sunil V L > Sent: Monday, August 26, 2024 3:14 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 v8 6/8] rust: add crate to expose bindings and interfaces

2024-08-26 Thread Junjie Mao
On 8/26/2024 2:41 PM, 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() == 0 { +    g_malloc0(layout.size().try_into().unwrap()).cast::(

Re: [PATCH v2] tests/functional: Convert Aarch64 Virt machine avocado tests

2024-08-26 Thread Thomas Huth
On 23/08/2024 10.24, Philippe Mathieu-Daudé wrote: Straight forward conversion. Update the SHA1 hash to SHA256 since SHA1 should not be used anymore nowadays. Provide get_qemu_img() helper in qemu_test. $ make check-functional-aarch64 V=1 ... ▶ 1/4 test_aarch64_virt.Aarch64VirtMachine.

Re: [PATCH v4 11/35] tests/functional: Prepare the meson build system for the functional tests

2024-08-26 Thread Thomas Huth
On 23/08/2024 14.54, Philippe Mathieu-Daudé wrote: On 21/8/24 10:27, Thomas Huth wrote: Provide a meson.build file for the upcoming python-based functional tests, and add some wrapper glue targets to the tests/Makefile.include file. We are going to use two "speed" modes for the functional tests:

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

2024-08-26 Thread Thomas Huth
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() == 0 { +    g_malloc0(layout.size().try_into().unwrap()).cast::()

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

2024-08-26 Thread Junjie Mao
On 8/26/2024 2:12 PM, Manos Pitsidianakis wrote: 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

Re: [PATCH v3 1/7] tests/functional: Convert mips64el Fuloong2e avocado test (1/2)

2024-08-26 Thread Thomas Huth
On 24/08/2024 18.08, Philippe Mathieu-Daudé wrote: Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays. Since the asset is expected locally and the test is guarded with QEMU_TEST_ALLOW_UNTRUSTED_CODE, keep it under the 'quick' s/Q

Re: [PATCH] Add vhost-user-spi and vhost-user-spi-pci devices

2024-08-26 Thread Haixu Cui
Hi team, I've added the vhost-user-spi patch here to support virtio-spi in qemu. You are the experts on both virtio and vhost-user, can you please help review the patch. Thanks a lot. Best Regards On 7/12/2024 11:42 AM, Haixu Cui wrote: This work is based on the virtio-spi spec, virtio-

Re: [PATCH v3 2/7] tests/functional: Convert mips64el Fuloong2e avocado test (2/2)

2024-08-26 Thread Thomas Huth
On 24/08/2024 18.08, Philippe Mathieu-Daudé wrote: Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays. Add extract_from_deb() method in qemu_test.utils package. Should we maybe rather copy the whole LinuxKernelTest class into a n

[PULL 2/3] .gitlab-ci.d/windows.yml: Disable the qtests in the MSYS2 job

2024-08-26 Thread Thomas Huth
The qtests are broken since a while in the MSYS2 job in the gitlab-CI, likely due to some changes in the MSYS2 environment. So far nobody has neither a clue what's going wrong here, nor an idea how to fix this (in fact most QEMU developers even don't have a Windows environment available for properl

[PULL 0/3] Optional fixes for 9.1.0-rc4

2024-08-26 Thread Thomas Huth
Hi Richard, since it seems like we're going to have RC4, here are some minor fixes that could still be included. The following changes since commit f259e4cb8a8b4ef5463326fc214a7d8d7703d5de: Merge tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu into staging (2024-08-24 08:09:27 +1

[PULL 3/3] tests/qtest: Delete previous boot file

2024-08-26 Thread Thomas Huth
From: Akihiko Odaki A test run may create boot files several times. Delete the previous boot file before creating a new one. Signed-off-by: Akihiko Odaki Reviewed-by: Michael S. Tsirkin Message-ID: <20240823-san-v4-7-a24c6dfa4...@daynix.com> Signed-off-by: Thomas Huth --- tests/qtest/migrati

[PULL 1/3] gitlab-ci: Replace build_script -> step_script in Cirrus jobs

2024-08-26 Thread Thomas Huth
From: Philippe Mathieu-Daudé Long due upgrade, see [1]: In GitLab Runner 13.2 a translation for step_script to build_script was added to the custom executor. In 14.0 the build_script stage will be replaced with step_script. We are using GitLab 17 [2]! This removes the following warning:

Re: [PATCH v2] aspeed: Deprecate the tacoma-bmc machine

2024-08-26 Thread Cédric Le Goater
Hello Guenter, On 8/9/24 00:05, Guenter Roeck wrote: Hi, On Tue, Jun 25, 2024 at 09:08:30AM +0200, Cédric Le Goater wrote: The tacoma-bmc machine was a board including an AST2600 SoC based BMC and a witherspoon like OpenPOWER system. It was used for bring up of the AST2600 SoC in labs. It can

Re: [PATCH] ppc/pnv: ADU fix possible buffer overrun with invalid size

2024-08-26 Thread Cédric Le Goater
On 8/6/24 17:13, Nicholas Piggin wrote: The ADU LPC transfer-size field is 7 bits, but the supported sizes for LPC access via ADU appear to be 1, 2, 4, 8. The data buffer could overrun if firmware set an invalid size field, so add checks to reject them with a message. Reported-by: Cédric Le Goat

Re: [PATCH 1/7] ppc/pnv: Fix LPC serirq routing calculation

2024-08-26 Thread Cédric Le Goater
On 8/6/24 15:13, Nicholas Piggin wrote: The serirq routing table is split over two registers, the calculation for the high irqs in the second register did not subtract the irq offset. This was spotted by Coverity as a shift-by-negative. Fix this and change the open-coded shifting and masking to u

Re: [PATCH 2/7] ppc/pnv: Fix LPC POWER8 register sanity check

2024-08-26 Thread Cédric Le Goater
On 8/6/24 15:13, Nicholas Piggin wrote: POWER8 does not have the ISA IRQ -> SERIRQ routing system of later CPUs, instead all ISA IRQs are sent to the CPU via a single PSI interrupt. There is a sanity check in the POWER8 case to ensure the routing bits have not been set, because that would indicat

Re: [PATCH 01/13] pnv/xive: TIMA patch sets pre-req alignment and formatting changes

2024-08-26 Thread Cédric Le Goater
On 8/1/24 22:29, Michael Kowal wrote: From: Michael Kowal Making some pre-requisite alignment changes ahead of the following patch sets. Making these changes now will ease the review of the patch sets. Checkpatch wants the closing comment '*/' on a separate line, unless it is on the same line

Re: [PATCH 02/13] pnv/xive2: Define OGEN field in the TIMA

2024-08-26 Thread Cédric Le Goater
On 8/1/24 22:29, Michael Kowal wrote: From: Frederic Barrat The OGEN field at offset 0x1F is a new field for Gen2 TIMA. This patch defines it. Signed-off-by: Frederic Barrat Signed-off-by: Michael Kowal Reviewed-by: Cédric Le Goater Thanks, C. --- include/hw/ppc/xive_regs.h | 1 +

[PATCH v3] tests/functional: Convert Aarch64 Virt machine avocado tests

2024-08-26 Thread Philippe Mathieu-Daudé
Straight forward conversion. Update the SHA1 hash to SHA256 since SHA1 should not be used anymore nowadays. Provide get_qemu_img() helper in qemu_test. $ make check-functional-aarch64 V=1 ▶ 1/4 test_aarch64_virt.Aarch64VirtMachine.test_aarch64_virt_gicv2 OK ▶ 1/4 test_aarch

Re: [PATCH v3] tests/functional: Convert Aarch64 Virt machine avocado tests

2024-08-26 Thread Thomas Huth
On 26/08/2024 12.36, Philippe Mathieu-Daudé wrote: Straight forward conversion. Update the SHA1 hash to SHA256 since SHA1 should not be used anymore nowadays. Provide get_qemu_img() helper in qemu_test. $ make check-functional-aarch64 V=1 ▶ 1/4 test_aarch64_virt.Aarch64VirtMachine.test_aa

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

2024-08-26 Thread Prasad Pandit
On Fri, 23 Aug 2024 at 23:12, 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

Re: [PATCH 04/13] pnv/xive2: Support for "OS LGS Push" TIMA operation

2024-08-26 Thread Cédric Le Goater
On 8/1/24 22:29, Michael Kowal wrote: From: Glenn Miles Adds support for single byte writes to offset 0x15 of the TIMA address space. This offset holds the Logical Server Group Size (LGS) field. The field is used to evenly distribute the interrupt load among the members of a group, but is unus

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() == 0 { +    g_mal

Re: [PATCH 05/13] ppc/xive2: Dump more NVP state with 'info pic'

2024-08-26 Thread Cédric Le Goater
On 8/1/24 22:30, Michael Kowal wrote: From: Frederic Barrat The 'PGoFirst' field of a Notify Virtual Processor tells if the NVP belongs to a VP group. Also, print the Reporting Cache Line address, if defined. Signed-off-by: Frederic Barrat Signed-off-by: Michael Kowal --- include/hw/ppc/x

Re: [PATCH 07/13] ppc/xive2: Allow 1-byte write of Target field in TIMA

2024-08-26 Thread Cédric Le Goater
On 8/1/24 22:30, Michael Kowal wrote: From: Glenn Miles When running PowerVM, the console is littered with XIVE traces regarding invalid writes to TIMA address 0x100b6 due to a lack of support for writes to the "TARGET" field which was added for XIVE GEN2. To fix this, we add special op suppor

Re: [PATCH 08/13] ppc/xive2: Support "Pull Thread Context to Register" operation

2024-08-26 Thread Cédric Le Goater
On 8/1/24 22:30, Michael Kowal wrote: From: Glenn Miles Adds support for single byte read of offset 0x838 of the TIMA address space. According to the XIVE2 Specification, this causes the hardware to atomically: 1. Read the number of bytes requested (lbz or lhz are supported). 2. Reset th

Re: [PATCH v1 04/15] hw/i2c/aspeed: support discontinuous register memory region of I2C bus

2024-08-26 Thread Cédric Le Goater
Hello Jamin, On 7/26/24 08:00, Jamin Lin wrote: Hi Cedric, I will looked at v2. Sorry for the late reply, I was on PTO. Thanks, C. Subject: Re: [PATCH v1 04/15] hw/i2c/aspeed: support discontinuous register memory region of I2C bus On 7/18/24 11:44, Jamin Lin wrote: Hi Cedric, Sub

Re: Issue with QEMU Live Migration

2024-08-26 Thread Prasad Pandit
On Sun, 25 Aug 2024 at 22:40, Arisetty, Chakri wrote: > > - start the mirror job > > - qmp_migrate > > - once PRE_SWITCHOVER is reached, issue block-job-cancel > > - qmp_migrate_continue > > We use exact same steps to do live migration. I repeated the test now > > Sure, as you suggested to rule ou

Re: [PATCH for-9.2 00/10] s390: Convert virtio-ccw, cpu to three-phase reset, and followup cleanup

2024-08-26 Thread Nico Boehr
Quoting Nina Schoetterl-Glausch (2024-08-22 12:34:14) > I'll run it through our CI and see if anything pops up. Nina is on holiday, she asked me to quickly report back. There was a little hickup without the fixup to patch 2, but after Nina pushed the fixup, we did not observe any failures related

Re: [PATCH for-9.1] nbd/server: CVE-2024-7409: Avoid use-after-free when closing server

2024-08-26 Thread Stefan Hajnoczi
On Thu, Aug 22, 2024 at 09:35:29AM -0500, Eric Blake wrote: > Commit 3e7ef738 plugged the use-after-free of the global nbd_server > object, but overlooked a use-after-free of nbd_server->listener. > Although this race is harder to hit, notice that our shutdown path > first drops the reference count

[PULL for-9.1-rc4 0/1] NBD patches for 2024-08-26

2024-08-26 Thread Eric Blake
The following changes since commit f259e4cb8a8b4ef5463326fc214a7d8d7703d5de: Merge tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu into staging (2024-08-24 08:09:27 +1000) are available in the Git repository at: https://repo.or.cz/qemu/ericb.git tags/pull-nbd-2024-08-26 for you

[PULL 1/1] nbd/server: CVE-2024-7409: Avoid use-after-free when closing server

2024-08-26 Thread Eric Blake
Commit 3e7ef738 plugged the use-after-free of the global nbd_server object, but overlooked a use-after-free of nbd_server->listener. Although this race is harder to hit, notice that our shutdown path first drops the reference count of nbd_server->listener, then triggers actions that can result in a

[PATCH] hw/arm: fix memleak in sbsa-ref.c

2024-08-26 Thread Dmitry Frolov
Memory, allocated by the first call of g_strdup_printf() is lost at the second call. Signed-off-by: Dmitry Frolov --- hw/arm/sbsa-ref.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index ae37a92301..10984fc339 100644 --

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

2024-08-26 Thread Deepak Gupta
On Mon, Aug 26, 2024 at 09:59:55AM +1000, Richard Henderson wrote: 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 @@ vo

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

2024-08-26 Thread Peter Xu
On Fri, Aug 23, 2024 at 03:13:11PM +0900, Akihiko Odaki wrote: > memory_region_update_container_subregions() used to call > memory_region_ref(), which creates a reference to the owner of the > subregion, on behalf of the owner of the container. This results in a > circular reference if the subregio

Re: [PATCH v4 7/7] tests/qtest: Delete previous boot file

2024-08-26 Thread Peter Xu
On Fri, Aug 23, 2024 at 03:13:12PM +0900, Akihiko Odaki wrote: > A test run may create boot files several times. Delete the previous boot > file before creating a new one. > > Signed-off-by: Akihiko Odaki > Reviewed-by: Michael S. Tsirkin > Acked-by: Thomas Huth I didn't track which came early

[PATCH v9 03/17] target/riscv: save and restore elp state on priv transitions

2024-08-26 Thread Deepak Gupta
elp state is recorded in *status on trap entry (less privilege to higher privilege) and restored in elp from *status on trap exit (higher to less privilege). Additionally this patch introduces a forward cfi helper function to determine if current privilege has forward cfi is enabled or not based o

[PATCH v9 00/17] riscv support for control flow integrity extensions

2024-08-26 Thread Deepak Gupta
v9 for riscv zicfilp and zicfiss extensions support in qemu. Links for previous versions [1] - v1 https://lists.nongnu.org/archive/html/qemu-devel/2024-07/msg06017.html [2] - v2 https://lore.kernel.org/all/ed23bcbc-fdc4-4492-803c-daa958803...@linaro.org/T/ [3] - v3 https://lists.nongnu.org/archiv

[PATCH v9 02/17] target/riscv: Introduce elp state and enabling controls for zicfilp

2024-08-26 Thread Deepak Gupta
zicfilp introduces a new state elp ("expected landing pad") in cpu. During normal execution, elp is idle (NO_LP_EXPECTED) i.e not expecting landing pad. On an indirect call, elp moves LP_EXPECTED. When elp is LP_EXPECTED, only a subsquent landing pad instruction can set state back to NO_LP_EXPECTED

[PATCH v9 01/17] target/riscv: Add zicfilp extension

2024-08-26 Thread Deepak Gupta
zicfilp [1] riscv cpu extension enables forward control flow integrity. If enabled, all indirect calls must land on a landing pad instruction. This patch sets up space for zicfilp extension in cpuconfig. zicfilp is dependend on zicsr. [1] - https://github.com/riscv/riscv-cfi Signed-off-by: Deepa

[PATCH v9 11/17] target/riscv: mmu changes for zicfiss shadow stack protection

2024-08-26 Thread Deepak Gupta
zicfiss protects shadow stack using new page table encodings PTE.W=0, PTE.R=0 and PTE.X=0. This encoding is reserved if zicfiss is not implemented or if shadow stack are not enabled. Loads on shadow stack memory are allowed while stores to shadow stack memory leads to access faults. Shadow stack ac

[PATCH v9 08/17] target/riscv: Add zicfiss extension

2024-08-26 Thread Deepak Gupta
zicfiss [1] riscv cpu extension enables backward control flow integrity. This patch sets up space for zicfiss extension in cpuconfig. And imple- ments dependency on A, zicsr, zimop and zcmop extensions. [1] - https://github.com/riscv/riscv-cfi Signed-off-by: Deepak Gupta Co-developed-by: Jim Sh

[PATCH v9 13/17] target/riscv: update `decode_save_opc` to store extra word2

2024-08-26 Thread Deepak Gupta
Extra word 2 is stored during tcg compile and `decode_save_opc` needs additional argument in order to pass the value. This will be used during unwind to get extra information about instruction like how to massage exceptions. Updated all callsites as well. Signed-off-by: Deepak Gupta --- target/r

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

2024-08-26 Thread Deepak Gupta
sw check exception support was recently added. This patch further augments sw check exception by providing support for additional code which is provided in *tval. Adds `sw_check_code` field in cpuarchstate. Whenever sw check exception is raised *tval gets the value deposited in `sw_check_code`. Si

[PATCH v9 12/17] target/riscv: AMO operations always raise store/AMO fault

2024-08-26 Thread Deepak Gupta
This patch adds one more word for tcg compile which can be obtained during unwind time to determine fault type for original operation (example AMO). Depending on that, fault can be promoted to store/AMO fault. Signed-off-by: Deepak Gupta Suggested-by: Richard Henderson --- target/riscv/cpu.h

Re: [PATCH v4 5/7] memory: Clarify owner must not call memory_region_ref()

2024-08-26 Thread Peter Xu
On Fri, Aug 23, 2024 at 03:13:10PM +0900, Akihiko Odaki wrote: > Signed-off-by: Akihiko Odaki > --- > include/exec/memory.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/exec/memory.h b/include/exec/memory.h > index d79415a3b159..6698e9d05eab 100644 > --- a/include/exec/memory

[PATCH v9 05/17] target/riscv: tracking indirect branches (fcfi) for zicfilp

2024-08-26 Thread Deepak Gupta
zicfilp protects forward control flow (if enabled) by enforcing all indirect call and jmp must land on a landing pad instruction `lpad`. If target of an indirect call or jmp is not `lpad` then cpu/hart must raise a sw check exception with tval = 2. This patch implements the mechanism using TCG. Ta

[PATCH v9 09/17] target/riscv: introduce ssp and enabling controls for zicfiss

2024-08-26 Thread Deepak Gupta
zicfiss introduces a new state ssp ("shadow stack register") in cpu. ssp is expressed as a new unprivileged csr (CSR_SSP=0x11) and holds virtual address for shadow stack as programmed by software. Shadow stack (for each mode) is enabled via bit3 in *envcfg CSRs. Shadow stack can be enabled for a m

[PATCH v9 07/17] disas/riscv: enable `lpad` disassembly

2024-08-26 Thread Deepak Gupta
Signed-off-by: Deepak Gupta Co-developed-by: Jim Shu Co-developed-by: Andy Chiu Reviewed-by: Richard Henderson --- disas/riscv.c | 18 +- disas/riscv.h | 2 ++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/disas/riscv.c b/disas/riscv.c index c8364c2b07..c7c92a

[PATCH v9 14/17] target/riscv: implement zicfiss instructions

2024-08-26 Thread Deepak Gupta
zicfiss has following instructions - sspopchk: pops a value from shadow stack and compares with x1/x5. If they dont match, reports a sw check exception with tval = 3. - sspush: pushes value in x1/x5 on shadow stack - ssrdp: reads current shadow stack - ssamoswap: swaps contents of shadow sta

[PATCH v9 10/17] target/riscv: tb flag for shadow stack instructions

2024-08-26 Thread Deepak Gupta
Shadow stack instructions can be decoded as zimop / zcmop or shadow stack instructions depending on whether shadow stack are enabled at current privilege. This requires a TB flag so that correct TB generation and correct TB lookup happens. `DisasContext` gets a field indicating whether bcfi is enab

[PATCH v9 06/17] target/riscv: zicfilp `lpad` impl and branch tracking

2024-08-26 Thread Deepak Gupta
Implements setting lp expected when `jalr` is encountered and implements `lpad` instruction of zicfilp. `lpad` instruction is taken out of auipc x0, . This is an existing HINTNOP space. If `lpad` is target of an indirect branch, cpu checks for 20 bit value in x7 upper with 20 bit value embedded in

[PATCH v9 16/17] disas/riscv: enable disassembly for zicfiss instructions

2024-08-26 Thread Deepak Gupta
Enable disassembly for sspush, sspopchk, ssrdp & ssamoswap. Disasembly is only enabled if zimop and zicfiss ext is set to true. Signed-off-by: Deepak Gupta --- disas/riscv.c | 40 +++- disas/riscv.h | 1 + 2 files changed, 40 insertions(+), 1 deletion(-) dif

[PATCH v9 15/17] target/riscv: compressed encodings for sspush and sspopchk

2024-08-26 Thread Deepak Gupta
sspush/sspopchk have compressed encodings carved out of zcmops. compressed sspush is designated as c.mop.1 while compressed sspopchk is designated as c.mop.5. Note that c.sspush x1 exists while c.sspush x5 doesn't. Similarly c.sspopchk x5 exists while c.sspopchk x1 doesn't. Signed-off-by: Deepak

[PATCH v9 17/17] disas/riscv: enable disassembly for compressed sspush/sspopchk

2024-08-26 Thread Deepak Gupta
sspush and sspopchk have equivalent compressed encoding taken from zcmop. cmop.1 is sspush x1 while cmop.5 is sspopchk x5. Due to unusual encoding for both rs1 and rs2 from space bitfield, this required a new codec. Signed-off-by: Deepak Gupta --- disas/riscv.c | 19 ++- disas/ri

Re: [PATCH] hw/arm: fix memleak in sbsa-ref.c

2024-08-26 Thread Philippe Mathieu-Daudé
Hi Dmitry, On 26/8/24 16:16, Dmitry Frolov wrote: Memory, allocated by the first call of g_strdup_printf() is lost at the second call. Signed-off-by: Dmitry Frolov --- hw/arm/sbsa-ref.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/hw/arm/sbsa-ref.c b/h

Re: apparent memory leak from object-add+object-del of memory-backend-ram

2024-08-26 Thread David Hildenbrand
On 20.08.24 10:50, Peter Maydell wrote: On Mon, 19 Aug 2024 at 20:07, David Hildenbrand wrote: On 19.08.24 18:24, Peter Maydell wrote: Hi; I'm looking at a memory leak apparently in the host memory backend code that you can see from the qmp-cmd-test. Repro instructions: Hi Peter, (1) bui

Re: [PATCH v4 09/16] migration/multifd: Remove total pages tracing

2024-08-26 Thread Peter Xu
On Fri, Aug 23, 2024 at 02:39:04PM -0300, Fabiano Rosas wrote: > The total_normal_pages and total_zero_pages elements are used only for > the end tracepoints of the multifd threads. These are not super useful > since they record per-channel numbers and are just the sum of all the > pages that are t

Re: apparent memory leak from object-add+object-del of memory-backend-ram

2024-08-26 Thread David Hildenbrand
On 26.08.24 17:38, David Hildenbrand wrote: On 20.08.24 10:50, Peter Maydell wrote: On Mon, 19 Aug 2024 at 20:07, David Hildenbrand wrote: On 19.08.24 18:24, Peter Maydell wrote: Hi; I'm looking at a memory leak apparently in the host memory backend code that you can see from the qmp-cmd-tes

Re: [PATCH for-9.2 01/10] hw/s390/virtio-ccw: Convert to three-phase reset

2024-08-26 Thread Philippe Mathieu-Daudé
Hi Peter, On 13/8/24 18:52, Peter Maydell wrote: Convert the virtio-ccw code to three-phase reset. This allows us to remove a call to device_class_set_parent_reset(), replacing it with the three-phase equivalent resettable_class_set_parent_phases(). Removing all the device_class_set_parent_rese

Re: [PATCH for-9.2 03/10] hw: Remove device_class_set_parent_reset()

2024-08-26 Thread Philippe Mathieu-Daudé
On 13/8/24 18:52, Peter Maydell wrote: There are no callers of device_class_set_parent_reset() left in the tree, as they've all been converted to use three-phase reset and the corresponding resettable_class_set_parent_phases() function. Remove device_class_set_parent_reset(). Signed-off-by: Pete

Re: [PATCH for-9.2 07/10] hw: Define new device_class_set_legacy_reset()

2024-08-26 Thread Philippe Mathieu-Daudé
On 13/8/24 18:52, Peter Maydell wrote: Define a device_class_set_legacy_reset() function which sets the DeviceClass::reset field. This serves two purposes: * it makes it clearer to the person writing code that DeviceClass::reset is now legacy and they should look for the new alternative

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

2024-08-26 Thread Peter Xu
On Fri, Aug 23, 2024 at 02:39:05PM -0300, 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 Reviewed-by: Peter Xu -- Peter

Re: [PATCH for-9.2 09/10] hw: Rename DeviceClass::reset field to legacy_reset

2024-08-26 Thread Philippe Mathieu-Daudé
On 13/8/24 18:52, Peter Maydell wrote: Rename the DeviceClass::reset field to legacy_reset; this is helpful both in flagging up that it's best not used in new code and in making it easy to search for where it's being used still. Signed-off-by: Peter Maydell --- include/hw/qdev-core.h | 4 ++--

Re: [PATCH] tests/avocado: Move LinuxTest related code into a separate file

2024-08-26 Thread Philippe Mathieu-Daudé
On 21/8/24 17:14, Thomas Huth wrote: On 21/08/2024 17.11, Philippe Mathieu-Daudé wrote: On 19/7/24 11:50, Thomas Huth wrote: Only some few tests are using the LinuxTest class. Move the related code into a separate file so that this does not pollute the main namespace. Signed-off-by: Thomas Hut

Re: [PATCH v4 14/16] migration/multifd: Standardize on multifd ops names

2024-08-26 Thread Peter Xu
On Fri, Aug 23, 2024 at 02:39:09PM -0300, Fabiano Rosas wrote: > Add the multifd_ prefix to all functions and remove the useless > docstrings. > > Signed-off-by: Fabiano Rosas Some of the comment might still be helpful, but yeah the dups aren't that helpful at least. Maybe a generic doc update

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

2024-08-26 Thread Peter Xu
On Fri, Aug 23, 2024 at 02:39:10PM -0300, 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

Re: [PATCH v4 16/16] migration/multifd: Move nocomp code into multifd-nocomp.c

2024-08-26 Thread Peter Xu
On Fri, Aug 23, 2024 at 02:39:11PM -0300, Fabiano Rosas wrote: > In preparation for adding new payload types to multifd, move most of > the no-compression code into multifd-nocomp.c. Let's try to keep a > semblance of layering by not mixing general multifd control flow with > the details of transmi

Re: apparent memory leak from object-add+object-del of memory-backend-ram

2024-08-26 Thread David Hildenbrand
On 26.08.24 17:56, David Hildenbrand wrote: On 26.08.24 17:38, David Hildenbrand wrote: On 20.08.24 10:50, Peter Maydell wrote: On Mon, 19 Aug 2024 at 20:07, David Hildenbrand wrote: On 19.08.24 18:24, Peter Maydell wrote: Hi; I'm looking at a memory leak apparently in the host memory backe

Re: apparent memory leak from object-add+object-del of memory-backend-ram

2024-08-26 Thread David Hildenbrand
On 26.08.24 18:25, David Hildenbrand wrote: On 26.08.24 17:56, David Hildenbrand wrote: On 26.08.24 17:38, David Hildenbrand wrote: On 20.08.24 10:50, Peter Maydell wrote: On Mon, 19 Aug 2024 at 20:07, David Hildenbrand wrote: On 19.08.24 18:24, Peter Maydell wrote: Hi; I'm looking at a me

Re: [PATCH 1/7] ppc/pnv: Fix LPC serirq routing calculation

2024-08-26 Thread Cédric Le Goater
On 8/6/24 15:13, Nicholas Piggin wrote: The serirq routing table is split over two registers, the calculation for the high irqs in the second register did not subtract the irq offset. This was spotted by Coverity as a shift-by-negative. Fix this and change the open-coded shifting and masking to u

Re: [PATCH 4/7] vfio/igd: add new bar0 quirk to emulate BDSM mirror

2024-08-26 Thread Alex Williamson
On Thu, 22 Aug 2024 13:08:29 +0200 Corvin Köhne wrote: > The BDSM register is mirrored into MMIO space at least for gen 11 and > later devices. Unfortunately, the Windows driver reads the register > value from MMIO space instead of PCI config space for those devices [1]. > Therefore, we either h

Re: [PATCH for-9.2] hw/vfio/pci.c: Use correct type in trace_vfio_msix_early_setup()

2024-08-26 Thread Cédric Le Goater
On 8/15/24 15:52, Peter Maydell wrote: The tracepoint trace_vfio_msix_early_setup() uses "int" for the type of the table_bar argument, but we use this to print a uint32_t. Coverity warns that this means that we could end up treating it as a negative number. We only use this in printing the value

Re: [PATCH 0/7] pc-bios/s390-ccw: Merge the netboot loader into s390-ccw.img

2024-08-26 Thread Jared Rossi
Hi Thomas, I just wanted to get your thoughts on the status of the netboot loader merge. I see that the first patch from this series was merged, but not the others. Is there any issue with the rest of the changes? I would like to put together a comprehensive rework for all device types that repl

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

2024-08-26 Thread Peter Maydell
On Mon, 26 Aug 2024 at 16:22, Peter Xu wrote: > > On Fri, Aug 23, 2024 at 03:13:11PM +0900, Akihiko Odaki wrote: > > memory_region_update_container_subregions() used to call > > memory_region_ref(), which creates a reference to the owner of the > > subregion, on behalf of the owner of the containe

Re: [PATCH for-9.2 01/10] hw/s390/virtio-ccw: Convert to three-phase reset

2024-08-26 Thread Peter Maydell
On Mon, 26 Aug 2024 at 17:02, Philippe Mathieu-Daudé wrote: > > Hi Peter, > > On 13/8/24 18:52, Peter Maydell wrote: > > Convert the virtio-ccw code to three-phase reset. This allows us to > > remove a call to device_class_set_parent_reset(), replacing it with > > the three-phase equivalent reset

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

2024-08-26 Thread Fabiano Rosas
Philippe Mathieu-Daudé writes: > 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 >> --- >> migrat

Re: [PATCH v4 14/16] migration/multifd: Standardize on multifd ops names

2024-08-26 Thread Fabiano Rosas
Peter Xu writes: > On Fri, Aug 23, 2024 at 02:39:09PM -0300, Fabiano Rosas wrote: >> Add the multifd_ prefix to all functions and remove the useless >> docstrings. >> >> Signed-off-by: Fabiano Rosas > > Some of the comment might still be helpful, but yeah the dups aren't that > helpful at least

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 v2] aspeed: Deprecate the tacoma-bmc machine

2024-08-26 Thread Guenter Roeck
Hi, On 8/26/24 02:58, Cédric Le Goater wrote: Hello Guenter, On 8/9/24 00:05, Guenter Roeck wrote: Hi, On Tue, Jun 25, 2024 at 09:08:30AM +0200, Cédric Le Goater wrote: The tacoma-bmc machine was a board including an AST2600 SoC based BMC and a witherspoon like OpenPOWER system. It was used

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

Re: Issue with QEMU Live Migration

2024-08-26 Thread Arisetty, Chakri
> * How is 'issue block-job-cancel' command issued exactly at the > PRE_SWITCHOVER stage? virsh blockjob --abort? We are currently not using libvirt/virsh to issue QMP command. Our software makes up QMP connection and sends the QMP command to cancel the job when RAM migration state is in pre-swi

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

2024-08-26 Thread Pierrick Bouvier
On 8/26/24 11:47, Rowan Hart wrote: 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 :) Sure, no worries, you did well! I'll make my comments in this patch, but for v2, please split those individual com

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

2024-08-26 Thread Peter Xu
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, Akihiko Odaki wrote: > > > memory_region_update_container_subregions() used to call > > > memory_region_ref(), which creates a reference

[PATCH v5 01/18] migration/multifd: Reduce access to p->pages

2024-08-26 Thread Fabiano Rosas
I'm about to replace the p->pages pointer with an opaque pointer, so do a cleanup now to reduce direct accesses to p->page, which makes the next diffs cleaner. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/multifd-qpl.c | 8 +--- migration/multifd-uadk.c | 9 +

[PATCH v5 12/18] migration/multifd: Replace multifd_send_state->pages with client data

2024-08-26 Thread Fabiano Rosas
Multifd currently has a simple scheduling mechanism that distributes work to the various channels by keeping storage space within each channel and an extra space that is given to the client. Each time the client fills the space with data and calls into multifd, that space is given to the next idle

[PATCH v5 04/18] migration/multifd: Pass in MultiFDPages_t to file_write_ramblock_iov

2024-08-26 Thread Fabiano Rosas
We want to stop dereferencing 'pages' so it can be replaced by an opaque pointer in the next patches. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/file.c| 3 ++- migration/file.h| 2 +- migration/multifd.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) dif

[PATCH v5 06/18] migration/multifd: Make MultiFDPages_t:offset a flexible array member

2024-08-26 Thread Fabiano Rosas
We're about to use MultiFDPages_t from inside the MultiFDSendData payload union, which means we cannot have pointers to allocated data inside the pages structure, otherwise we'd lose the reference to that memory once another payload type touches the union. Move the offset array into the end of the

[PATCH v5 00/18] migration/multifd: Remove multifd_send_state->pages

2024-08-26 Thread Fabiano Rosas
Hi, thank you all for the reviews. One more version to address a couple of cleanups suggested by Philippe. CI run: https://gitlab.com/farosas/qemu/-/pipelines/1427843439 Thanks v4: https://lore.kernel.org/r/20240823173911.6712-1-fa

[PATCH v5 02/18] migration/multifd: Inline page_size and page_count

2024-08-26 Thread Fabiano Rosas
The MultiFD*Params structures are for per-channel data. Constant values should not be there because that needlessly wastes cycles and storage. The page_size and page_count fall into this category so move them inline in multifd.h. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/

[PATCH v5 14/18] migration/multifd: Standardize on multifd ops names

2024-08-26 Thread Fabiano Rosas
Add the multifd_ prefix to all functions and remove the useless docstrings. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/multifd-qpl.c | 57 migration/multifd-uadk.c | 55 --- migration/multifd-zlib.c | 81 ++-

[PATCH v5 09/18] migration/multifd: Remove total pages tracing

2024-08-26 Thread Fabiano Rosas
The total_normal_pages and total_zero_pages elements are used only for the end tracepoints of the multifd threads. These are not super useful since they record per-channel numbers and are just the sum of all the pages that are transmitted per-packet, for which we already have tracepoints. Remove th

[PATCH v5 10/18] migration/multifd: Isolate ram pages packet data

2024-08-26 Thread Fabiano Rosas
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. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/multifd.c| 99 ++

[PATCH v5 17/18] migration/multifd: Make MultiFDMethods const

2024-08-26 Thread Fabiano Rosas
The methods are defined at module_init time and don't ever change. Make them const. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Fabiano Rosas --- migration/multifd-nocomp.c | 2 +- migration/multifd-qpl.c| 2 +- migration/multifd-uadk.c | 2 +- migration/multifd-zlib.c | 2 +- m

[PATCH v5 03/18] migration/multifd: Remove pages->allocated

2024-08-26 Thread Fabiano Rosas
This value never changes and is always the same as page_count. We don't need a copy of it per-channel plus one in the extra slot. Remove it. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/multifd.c | 6 ++ migration/multifd.h | 2 -- 2 files changed, 2 insertions(+), 6 del

[PATCH v5 18/18] migration/multifd: Stop changing the packet on recv side

2024-08-26 Thread Fabiano Rosas
As observed by Philippe, the multifd_ram_unfill_packet() function currently leaves the MultiFDPacket structure with mixed endianness. This is harmless, but ultimately not very clean. Aside from that, the packet is also written to on the recv side to ensure the ramblock name is null-terminated. Sto

  1   2   >