Re: [PTACH v2 1/6] update-linux-headers: sync-up header with Linux for KVM AIA support

2023-05-08 Thread Cornelia Huck
On Fri, May 05 2023, Alex Williamson wrote: > On Fri, 5 May 2023 11:39:36 + > Yong-Xuan Wang wrote: > >> Update the linux headers to get the latest KVM RISC-V headers with AIA >> support >> by the scripts/update-linux-headers.sh. >> The linux headers is comes from the riscv_aia_v1 branch a

Re: [PATCH] virtio-net: not enable vq reset feature unconditionally

2023-05-08 Thread Xuan Zhuo
On Mon, 8 May 2023 14:44:21 +0800, Jason Wang wrote: > On Sun, May 7, 2023 at 2:01 PM Michael S. Tsirkin wrote: > > > > On Sat, May 06, 2023 at 10:13:36AM +0800, Xuan Zhuo wrote: > > > On Thu, 4 May 2023 12:14:47 +0200, =?utf-8?q?Eugenio_P=C3=A9rez?= > > > wrote: > > > > The commit 93a97dc5200

Re: [PATCH v3] linux-user: Add /proc/cpuinfo handler for RISC-V

2023-05-08 Thread Andreas Schwab
On Mai 05 2023, Laurent Vivier wrote: > [PATCH qemu v2] linux-user: Emulate /proc/cpuinfo output for riscv > https://patchew.org/QEMU/167873059442.9885.1515208531657524845...@git.sr.ht/ This looks better. You can drop my patch. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint =

[PATCH 02/12] aspeed: Introduce a boot_rom region at the machine level

2023-05-08 Thread Cédric Le Goater
This should also avoid Coverity to report a memory leak warning when the QEMU process exits. See CID 1508061. Signed-off-by: Cédric Le Goater --- hw/arm/aspeed.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 0b29028fe1..b

[PATCH 00/12] aspeed: fixes and extensions

2023-05-08 Thread Cédric Le Goater
Hello, This series fixes issues spotted by Coverity and adds a couple of improvements for the machine definition. The first is to offer the capability to define all CS of all SPI controllers without introducing new machine types, using a blockdev on the command line : -blockdev node-name=fmc

[PATCH 04/12] hw/ssi: Add an "addr" property to SSIPeripheral

2023-05-08 Thread Cédric Le Goater
Boards will use this new property to identify the device CS line and wire the SPI controllers accordingly. Cc: Alistair Francis Signed-off-by: Cédric Le Goater --- include/hw/ssi/ssi.h | 3 +++ hw/ssi/ssi.c | 7 +++ 2 files changed, 10 insertions(+) diff --git a/include/hw/ssi/ssi.

[PATCH 01/12] aspeed/hace: Initialize g_autofree pointer

2023-05-08 Thread Cédric Le Goater
As mentioned in docs/devel/style.rst "Automatic memory deallocation": * Variables declared with g_auto* MUST always be initialized, otherwise the cleanup function will use uninitialized stack memory This avoids QEMU to coredump when running the "hash test" command under Zephyr. Cc: Steven Lee

[PATCH 08/12] aspeed: Create flash devices only when defaults are enabled

2023-05-08 Thread Cédric Le Goater
When the -nodefaults option is set, flash devices should be created with : -blockdev node-name=fmc0,driver=file,filename=./flash.img \ -device mx66u51235f,addr=0x0,bus=ssi.0,drive=fmc0 \ To be noted that in this case, the ROM will not be installed and the initial boot sequence (U-Boot loa

[PATCH 05/12] hw/ssi: Introduce a ssi_get_cs() helper

2023-05-08 Thread Cédric Le Goater
Simple routine to retrieve a DeviceState object on a SPI bus using its address/cs. It will be useful for the board to wire the CS lines. Cc: Alistair Francis Signed-off-by: Cédric Le Goater --- include/hw/ssi/ssi.h | 2 ++ hw/ssi/ssi.c | 15 +++ 2 files changed, 17 insertio

[PATCH 06/12] aspeed/smc: Wire CS lines at reset

2023-05-08 Thread Cédric Le Goater
Currently, a set of default flash devices is created at machine init and drives defined on the QEMU command line are associated to the FMC and SPI controllers in sequence : -drive file,format=raw,if=mtd -drive file,format=raw,if=mtd The CS lines are wired in the same creation loop. This mak

[PATCH 11/12] aspeed: Introduce a "uart" machine option

2023-05-08 Thread Cédric Le Goater
Most of the Aspeed machines use the UART5 device for the boot console, and QEMU connects the first serial Chardev to this SoC device for this purpose. See routine connect_serial_hds_to_uarts(). Nevertheless, some machines use another boot console, such as the fuji, and commit 5d63d0c76c ("hw/arm/a

[PATCH 03/12] aspeed: Use the boot_rom region of the fby35 machine

2023-05-08 Thread Cédric Le Goater
This change completes commits 5aa281d757 ("aspeed: Introduce a spi_boot region under the SoC") and 8b744a6a47 ("aspeed: Add a boot_rom overlap region in the SoC spi_boot container") which introduced a spi_boot container at the SoC level to map the boot rom region as an overlap. It also fixes a Cov

[PATCH 09/12] m25p80: Introduce an helper to retrieve the BlockBackend of a device

2023-05-08 Thread Cédric Le Goater
It will help in getting rid of some drive_get(IF_MTD) calls by retrieving the BlockBackend directly from the m25p80 device. Cc: Alistair Francis Signed-off-by: Cédric Le Goater --- include/hw/block/flash.h | 4 hw/block/m25p80.c| 6 ++ 2 files changed, 10 insertions(+) diff --

[PATCH 10/12] aspeed: Get the BlockBackend of FMC0 from the flash device

2023-05-08 Thread Cédric Le Goater
and get rid of an unnecessary drive_get(IF_MTD) call. Signed-off-by: Cédric Le Goater --- hw/arm/aspeed.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index a8832c0072..3d5488faf7 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c

[PATCH 12/12] target/arm: Allow users to set the number of VFP registers

2023-05-08 Thread Cédric Le Goater
Cortex A7 CPUs with an FPU implementing VFPv4 without NEON support have 16 64-bit FPU registers and not 32 registers. Let users set the number of VFP registers with a CPU property. The primary use case of this property is for the Cortex A7 of the Aspeed AST2600 SoC. Signed-off-by: Cédric Le Goate

[PATCH 07/12] hw/ssi: Check for duplicate addresses

2023-05-08 Thread Cédric Le Goater
This to avoid address conflicts on the same SSI bus. Adapt machines using multiple devices on the same bus to avoid breakage. Cc: "Edgar E. Iglesias" Cc: Alistair Francis Signed-off-by: Cédric Le Goater --- hw/arm/stellaris.c | 4 +++- hw/arm/xilinx_zynq.c| 1

Re: [PULL 00/21] Migration 20230428 patches

2023-05-08 Thread Juan Quintela
Lukas Straub wrote: > On Tue, 02 May 2023 12:39:12 +0200 > Juan Quintela wrote: > >> [...] >> >> my patches are only code movement and cleanups, so Lukas any clue? >> >> Lukas, I am going to drop the compress code for now and pass the other >> patches. In the meanwhile, I am going to try to se

How can I find problematic uses of error_report() with vrc?

2023-05-08 Thread Markus Armbruster
Calling error_report() from within a function using Error to return error information is almost always wrong. Example: QMP command qmp_migrate() calls rdma_start_outgoing_migration() calls qemu_rdma_source_init() calls qemu_rdma_reg_control() The first four have an Error **errp p

Re: css_clear_io_interrupt() error handling

2023-05-08 Thread Cornelia Huck
On Mon, May 08 2023, Markus Armbruster wrote: > css_clear_io_interrupt() aborts on unexpected ioctl() errors, and I > wonder whether that's appropriate. Let's have a closer look: > > static void css_clear_io_interrupt(uint16_t subchannel_id, >uint16_t

Re: [PATCH] virtio-net: not enable vq reset feature unconditionally

2023-05-08 Thread Eugenio Perez Martin
On Sat, May 6, 2023 at 4:25 AM Xuan Zhuo wrote: > > On Thu, 4 May 2023 12:14:47 +0200, =?utf-8?q?Eugenio_P=C3=A9rez?= > wrote: > > The commit 93a97dc5200a ("virtio-net: enable vq reset feature") enables > > unconditionally vq reset feature as long as the device is emulated. > > This makes impos

Re: [PATCH v10 1/8] memory: prevent dma-reentracy issues

2023-05-08 Thread Thomas Huth
On 06/05/2023 11.25, Song Gao wrote:  Hi Alexander 在 2023/4/28 下午5:14, Thomas Huth 写道: On 28/04/2023 11.11, Alexander Bulekov wrote: On 230428 1015, Thomas Huth wrote: On 28/04/2023 10.12, Daniel P. Berrangé wrote: On Thu, Apr 27, 2023 at 05:10:06PM -0400, Alexander Bulekov wrote: Add a fl

Re: [PATCH] virtio-net: not enable vq reset feature unconditionally

2023-05-08 Thread Xuan Zhuo
On Mon, 8 May 2023 11:09:46 +0200, Eugenio Perez Martin wrote: > On Sat, May 6, 2023 at 4:25 AM Xuan Zhuo wrote: > > > > On Thu, 4 May 2023 12:14:47 +0200, =?utf-8?q?Eugenio_P=C3=A9rez?= > > wrote: > > > The commit 93a97dc5200a ("virtio-net: enable vq reset feature") enables > > > uncondition

Re: [PULL 00/21] Migration 20230428 patches

2023-05-08 Thread Lukas Straub
On Mon, 08 May 2023 10:12:35 +0200 Juan Quintela wrote: > Lukas Straub wrote: > > On Tue, 02 May 2023 12:39:12 +0200 > > Juan Quintela wrote: > > > >> [...] > >> > >> my patches are only code movement and cleanups, so Lukas any clue? > >> > >> Lukas, I am going to drop the compress code for n

Re: [PATCH v11 01/14] accel/tcg: introduce TBStatistics structure

2023-05-08 Thread Wu, Fei
On 5/3/2023 4:12 PM, Richard Henderson wrote: > On 4/21/23 14:24, Fei Wu wrote: >> From: "Vanderson M. do Rosario" >> >> To store statistics for each TB, we created a TBStatistics structure >> which is linked with the TBs. TBStatistics can stay alive after >> tb_flush and be relinked to a regenera

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-08 Thread Andrea Bolognani
On Mon, May 08, 2023 at 11:37:43AM +0530, Sunil V L wrote: > On Mon, May 08, 2023 at 07:37:23AM +0200, Heinrich Schuchardt wrote: > > On 4/25/23 12:25, Sunil V L wrote: > > > Currently, virt machine supports two pflash instances each with > > > 32MB size. However, the first pflash is always assumed

Re: [PATCH v11 02/14] accel: collecting TB execution count

2023-05-08 Thread Wu, Fei
On 5/3/2023 4:28 PM, Richard Henderson wrote: > On 4/21/23 14:24, Fei Wu wrote: >> From: "Vanderson M. do Rosario" >> >> If a TB has a TBS (TBStatistics) with the TB_EXEC_STATS >> enabled, then we instrument the start code of this TB >> to atomically count the number of times it is executed. >> We

Re: [PATCH v4 03/57] accel/tcg: Introduce tlb_read_idx

2023-05-08 Thread Richard Henderson
On 5/7/23 11:09, Peter Maydell wrote: On Fri, 5 May 2023 at 19:57, Richard Henderson wrote: On 5/4/23 16:02, Peter Maydell wrote: On Wed, 3 May 2023 at 08:15, Richard Henderson wrote: Instead of playing with offsetof in various places, use MMUAccessType to index an array. This is easily d

Re: [PATCH v4 07/57] accel/tcg: Honor atomicity of stores

2023-05-08 Thread Richard Henderson
On 5/5/23 10:28, Peter Maydell wrote: On Wed, 3 May 2023 at 08:11, Richard Henderson wrote: Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 103 +++ accel/tcg/user-exec.c | 12 +- accel/tcg/ldst_atomicity.c.inc | 491 +

Re: missing boot rom: is it really a fatal error?

2023-05-08 Thread Thomas Huth
On 07/05/2023 19.56, Michael Tokarev wrote: Hi! In old good world ;), there was qemu which didn't require boot roms to be present for all devices for which bootrom file is defined, missing rom was just a warning. But this changed in 2014, 9 years ago, with this commit: commit 178e785fb4507ec

Re: [PATCH] virtio-net: not enable vq reset feature unconditionally

2023-05-08 Thread Michael S. Tsirkin
On Mon, May 08, 2023 at 11:09:46AM +0200, Eugenio Perez Martin wrote: > On Sat, May 6, 2023 at 4:25 AM Xuan Zhuo wrote: > > > > On Thu, 4 May 2023 12:14:47 +0200, =?utf-8?q?Eugenio_P=C3=A9rez?= > > wrote: > > > The commit 93a97dc5200a ("virtio-net: enable vq reset feature") enables > > > uncond

Re: missing boot rom: is it really a fatal error?

2023-05-08 Thread Michael S. Tsirkin
On Sun, May 07, 2023 at 08:56:23PM +0300, Michael Tokarev wrote: > Hi! > > In old good world ;), there was qemu which didn't require boot roms to be > present > for all devices for which bootrom file is defined, missing rom was just a > warning. > But this changed in 2014, 9 years ago, with this

Re: [PATCH v8 11/11] target/riscv: rework write_misa()

2023-05-08 Thread Daniel Henrique Barboza
On 5/7/23 20:25, Alistair Francis wrote: On Fri, Apr 21, 2023 at 11:29 PM Daniel Henrique Barboza wrote: write_misa() must use as much common logic as possible. We want to open code just the bits that are exclusive to the CSR write operation and TCG internals. Our validation is done with r

Re: missing boot rom: is it really a fatal error?

2023-05-08 Thread Markus Armbruster
"Michael S. Tsirkin" writes: > On Sun, May 07, 2023 at 08:56:23PM +0300, Michael Tokarev wrote: >> Hi! >> >> In old good world ;), there was qemu which didn't require boot roms to be >> present >> for all devices for which bootrom file is defined, missing rom was just a >> warning. >> But this

Re: Question about graph locking preconditions regarding qemu_in_main_thread()

2023-05-08 Thread Kevin Wolf
Am 05.05.2023 um 11:35 hat Fiona Ebner geschrieben: > Hi, > I noticed that the bdrv_graph_co_rd_lock() and bdrv_graph_co_rd_unlock() > functions use qemu_in_main_thread() as a conditional to return early. > What high-level requirements ensure that qemu_in_main_thread() will > evaluate to the same v

Re: missing boot rom: is it really a fatal error?

2023-05-08 Thread Michael Tokarev
08.05.2023 13:28, Michael S. Tsirkin wrote: On Sun, May 07, 2023 at 08:56:23PM +0300, Michael Tokarev wrote: .. I'm about to revert that old change on debian, to make it just a warning instead of an error (the code is different now, but the same principle applies), - because I dislike depende

Re: How can I find problematic uses of error_report() with vrc?

2023-05-08 Thread Paolo Bonzini
On 5/8/23 10:32, Markus Armbruster wrote: 1. Find functions using Error Doesn't have to be perfect. I have a simple Coccinelle script (appended) that spits out some 4400 functions. I run it like $ spatch --sp-file find-error-fns.cocci --macro-file scripts/cocci-macro-file.h `git

Re: [PATCH] migration: Attempt disk reactivation in more failure scenarios

2023-05-08 Thread Kevin Wolf
Am 02.05.2023 um 22:52 hat Eric Blake geschrieben: > Commit fe904ea824 added a fail_inactivate label, which tries to > reactivate disks on the source after a failure while s->state == > MIGRATION_STATUS_ACTIVE, but didn't actually use the label if > qemu_savevm_state_complete_precopy() failed. Thi

Re: [PATCH 0/8] migration: Add precopy initial data capability and VFIO precopy support

2023-05-08 Thread Avihai Horon
On 08/05/2023 3:49, Peter Xu wrote: External email: Use caution opening links or attachments On Sun, May 07, 2023 at 03:54:00PM +0300, Avihai Horon wrote: On 04/05/2023 18:50, Peter Xu wrote: External email: Use caution opening links or attachments On Thu, May 04, 2023 at 01:18:04PM +0300

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-08 Thread Sunil V L
On Mon, May 08, 2023 at 03:00:02AM -0700, Andrea Bolognani wrote: > On Mon, May 08, 2023 at 11:37:43AM +0530, Sunil V L wrote: > > On Mon, May 08, 2023 at 07:37:23AM +0200, Heinrich Schuchardt wrote: > > > On 4/25/23 12:25, Sunil V L wrote: > > > > Currently, virt machine supports two pflash instan

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-08 Thread Andrea Bolognani
On Mon, May 08, 2023 at 04:53:46PM +0530, Sunil V L wrote: > On Mon, May 08, 2023 at 03:00:02AM -0700, Andrea Bolognani wrote: > > I think that it's more important to align with other architectures. > > > > The number of people currently running edk2 on RISC-V is probably > > vanishingly small, and

Re: [PULL 05/42] target/m68k: Finish conversion to tcg_gen_qemu_{ld, st}_*

2023-05-08 Thread Laurent Vivier
Le 05/05/2023 à 23:24, Richard Henderson a écrit : Convert away from the old interface with the implicit MemOp argument. Signed-off-by: Richard Henderson Reviewed-by: Anton Johansson Message-Id: <20230502135741.1158035-5-richard.hender...@linaro.org> --- target/m68k/translate.c | 76

Re: missing boot rom: is it really a fatal error?

2023-05-08 Thread Michael S. Tsirkin
On Mon, May 08, 2023 at 01:42:04PM +0300, Michael Tokarev wrote: > 08.05.2023 13:28, Michael S. Tsirkin wrote: > > On Sun, May 07, 2023 at 08:56:23PM +0300, Michael Tokarev wrote: > .. > > > > I'm about to revert that old change on debian, to make it just a warning > > > instead > > > of an error

Re: [PATCH] target/ppc: Fix fallback to MFSS for MFFSCRN, MFFSCRNI, MFFSCE and MFFSL

2023-05-08 Thread Matheus K. Ferst
On 05/05/2023 12:23, Richard Henderson wrote: On 5/4/23 18:17, Matheus K. Ferst wrote: On 04/05/2023 08:01, Richard Purdie wrote: The following commits changed the code such that these instructions became invalid on pre 3.0 ISAs:    bf8adfd88b547680aa857c46098f3a1e94373160 - target/ppc: Move

[PATCH] hw/net: Move xilinx_ethlite.c to the target-independent source set

2023-05-08 Thread Thomas Huth
Now that the tswap() functions are available for target-independent code, too, we can move xilinx_ethlite.c from specific_ss to softmmu_ss to avoid that we have to compile this file multiple times. Signed-off-by: Thomas Huth --- hw/net/xilinx_ethlite.c | 2 +- hw/net/meson.build | 2 +- 2 f

Re: [PATCH v2] target/ppc: Fix fallback to MFSS for MFFS* instructions on pre 3.0 ISAs

2023-05-08 Thread Matheus K. Ferst
On 06/05/2023 03:52, Richard Purdie wrote: The following commits changed the code such that the fallback to MFSS for MFFSCRN, MFFSCRNI, MFFSCE and MFFSL on pre 3.0 ISAs was removed and became an illegal instruction: bf8adfd88b547680aa857c46098f3a1e94373160 - target/ppc: Move mffscrn[i] to

Re: [PATCH v4 56/57] tcg/ppc: Support 128-bit load/store

2023-05-08 Thread Daniel Henrique Barboza
On 5/3/23 04:06, Richard Henderson wrote: Use LQ/STQ with ISA v2.07, and 16-byte atomicity is required. Note that these instructions do not require 16-byte alignment. Signed-off-by: Richard Henderson --- Reviewed-by: Daniel Henrique Barboza tcg/ppc/tcg-target-con-set.h | 2 + tcg/

Re: [PATCH 02/11] tcg/riscv: Probe for Zba, Zbb, Zicond extensions

2023-05-08 Thread Daniel Henrique Barboza
On 5/3/23 05:56, Richard Henderson wrote: Define a useful subset of the extensions. Probe for them via compiler pre-processor feature macros and SIGILL. Signed-off-by: Richard Henderson --- Reviewed-by: Daniel Henrique Barboza tcg/riscv/tcg-target.h | 6 +++ tcg/riscv/tcg-targe

Re: [PATCH 01/11] disas/riscv: Decode czero.{eqz,nez}

2023-05-08 Thread Daniel Henrique Barboza
On 5/3/23 05:56, Richard Henderson wrote: Signed-off-by: Richard Henderson --- Reviewed-by: Daniel Henrique Barboza disas/riscv.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/disas/riscv.c b/disas/riscv.c index d6b0fbe5e8..c0a8b1006a 100644 --- a/disas/ri

Re: [PATCH 03/11] tcg/riscv: Support ANDN, ORN, XNOR from Zbb

2023-05-08 Thread Daniel Henrique Barboza
On 5/3/23 05:56, Richard Henderson wrote: Signed-off-by: Richard Henderson --- Reviewed-by: Daniel Henrique Barboza tcg/riscv/tcg-target-con-set.h | 1 + tcg/riscv/tcg-target-con-str.h | 1 + tcg/riscv/tcg-target.h | 12 +- tcg/riscv/tcg-target.c.inc | 41 +

Re: [PATCH 04/11] tcg/riscv: Support ADD.UW, SEXT.B, SEXT.H, ZEXT.H from Zba+Zbb

2023-05-08 Thread Daniel Henrique Barboza
On 5/3/23 05:56, Richard Henderson wrote: Signed-off-by: Richard Henderson --- Reviewed-by: Daniel Henrique Barboza tcg/riscv/tcg-target.c.inc | 32 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/

Re: [PATCH 05/11] tcg/riscv: Use ADD.UW for guest address generation

2023-05-08 Thread Daniel Henrique Barboza
On 5/3/23 05:56, Richard Henderson wrote: The instruction is a combined zero-extend and add. Use it for exactly that. Signed-off-by: Richard Henderson --- tcg/riscv/tcg-target.c.inc | 33 ++--- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/tcg

Re: [PATCH 06/11] tcg/riscv: Support rotates from Zbb

2023-05-08 Thread Daniel Henrique Barboza
On 5/3/23 05:56, Richard Henderson wrote: Signed-off-by: Richard Henderson --- Reviewed-by: Daniel Henrique Barboza tcg/riscv/tcg-target.h | 4 ++-- tcg/riscv/tcg-target.c.inc | 34 ++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git

Re: [PATCH 07/11] tcg/riscv: Support REV8 from Zbb

2023-05-08 Thread Daniel Henrique Barboza
On 5/3/23 05:56, Richard Henderson wrote: Signed-off-by: Richard Henderson --- Reviewed-by: Daniel Henrique Barboza tcg/riscv/tcg-target.h | 10 +- tcg/riscv/tcg-target.c.inc | 29 + 2 files changed, 34 insertions(+), 5 deletions(-) diff --git

Re: [PATCH 08/11] tcg/riscv: Support CPOP from Zbb

2023-05-08 Thread Daniel Henrique Barboza
On 5/3/23 05:56, Richard Henderson wrote: Signed-off-by: Richard Henderson --- Reviewed-by: Daniel Henrique Barboza tcg/riscv/tcg-target.h | 4 ++-- tcg/riscv/tcg-target.c.inc | 9 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tcg/riscv/tcg-target.h b

Re: [PATCH 09/11] tcg/riscv: Improve setcond expansion

2023-05-08 Thread Daniel Henrique Barboza
On 5/3/23 05:56, Richard Henderson wrote: Split out a helper function, tcg_out_setcond_int, which does not always produce the complete boolean result, but returns a set of flags to do so. Based on 21af16198425, the same improvement for loongarch64. Signed-off-by: Richard Henderson --- Rev

Re: [PATCH 10/11] tcg/riscv: Implement movcond

2023-05-08 Thread Daniel Henrique Barboza
On 5/3/23 05:56, Richard Henderson wrote: Implement with and without Zicond. Without Zicond, we were letting the middle-end expand to a 5 insn sequence; better to use a branch over a single insn. Signed-off-by: Richard Henderson --- Reviewed-by: Daniel Henrique Barboza tcg/riscv/tcg-

Re: [PATCH 11/11] tcg/riscv: Support CTZ, CLZ from Zbb

2023-05-08 Thread Daniel Henrique Barboza
On 5/3/23 05:56, Richard Henderson wrote: Signed-off-by: Richard Henderson --- Reviewed-by: Daniel Henrique Barboza tcg/riscv/tcg-target-con-set.h | 1 + tcg/riscv/tcg-target.h | 8 tcg/riscv/tcg-target.c.inc | 35 ++ 3 files ch

Re: [PATCH 00/11] tcg/riscv: Support for Zba, Zbb, Zicond extensions

2023-05-08 Thread Daniel Henrique Barboza
On 5/3/23 05:56, Richard Henderson wrote: Based-on: 20230503070656.1746170-1-richard.hender...@linaro.org ("[PATCH v4 00/57] tcg: Improve atomicity support") I've been vaguely following the __hw_probe syscall progress in the upstream kernel. The initial version only handled bog standard F+D

Re: [PATCH v10 1/8] memory: prevent dma-reentracy issues

2023-05-08 Thread Song Gao
Hi, Thomas 在 2023/5/8 下午5:33, Thomas Huth 写道: On 06/05/2023 11.25, Song Gao wrote:   Hi Alexander 在 2023/4/28 下午5:14, Thomas Huth 写道: On 28/04/2023 11.11, Alexander Bulekov wrote: On 230428 1015, Thomas Huth wrote: On 28/04/2023 10.12, Daniel P. Berrangé wrote: On Thu, Apr 27, 2023 at 05:1

[PATCH 02/21] migration: Don't use INT64_MAX for unlimited rate

2023-05-08 Thread Juan Quintela
Use 0 instead. Signed-off-by: Juan Quintela --- migration/migration.c | 4 ++-- migration/qemu-file.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 1192f1ebf1..3979a98949 100644 --- a/migration/migration.c +++ b/migrat

[PATCH 04/21] qemu-file: make qemu_file_[sg]et_rate_limit() use an uint64_t

2023-05-08 Thread Juan Quintela
It is really size_t. Everything else uses uint64_t, so move this to uint64_t as well. A size can't be negative anyways. Signed-off-by: Juan Quintela Message-Id: <20230504113841.23130-4-quint...@redhat.com> --- Don't drop the check if rate_limit_max is zero. --- migration/qemu-file.c | 6 +++-

[PATCH 01/21] migration: A rate limit value of 0 is valid

2023-05-08 Thread Juan Quintela
And it is the best way to not have rate_limit. Signed-off-by: Juan Quintela --- migration/migration.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 232e387109..1192f1ebf1 100644 --- a/migration/migration.c +++ b/migr

[PATCH 00/21] Migration: More migration atomic counters

2023-05-08 Thread Juan Quintela
Hi In this series: - play with rate limit * document that a value of 0 means no rate-limit * change all users of INT64_MAX to use 0 * Make sure that transferred value is right This gets transferred == multifd_bytes + qemu_file_transferred() until the completation stage. Changing all

[PATCH 07/21] migration: Correct transferred bytes value

2023-05-08 Thread Juan Quintela
We forget several places to add to trasferred amount of data. With this fixes I get: qemu_file_transferred() + multifd_bytes == transferred The only place whrer this is not true is during devices sending. But going all through the full tree searching for devices that use QEMUFile directly is

[PATCH 10/21] migration: Move rate_limit_max and rate_limit_used to migration_stats

2023-05-08 Thread Juan Quintela
This way we can make them atomic and use this functions from any place. I also moved all functions that use rate_limit to migration-stats. Functions got renamed, they are not qemu_file anymore. qemu_file_rate_limit -> migration_rate_limit_exceeded qemu_file_set_rate_limit -> migration_rate_limit

[PATCH 06/21] qemu-file: Remove total from qemu_file_total_transferred_*()

2023-05-08 Thread Juan Quintela
Function is already quite long. Signed-off-by: Juan Quintela --- migration/block.c | 4 ++-- migration/migration.c | 2 +- migration/qemu-file.c | 4 ++-- migration/qemu-file.h | 10 +- migration/savevm.c| 6 +++--- migration/vmstate.c | 5 ++--- 6 files changed, 15 insert

[PATCH 12/21] migration: Add a trace for migration_transferred_bytes

2023-05-08 Thread Juan Quintela
Signed-off-by: Juan Quintela --- migration/migration-stats.c | 8 ++-- migration/trace-events | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/migration/migration-stats.c b/migration/migration-stats.c index fba66c4577..46b2b0d06e 100644 --- a/migration/migration-st

[PATCH 03/21] migration: We set the rate_limit by a second

2023-05-08 Thread Juan Quintela
That the implementation does the check every 100 milliseconds is an implementation detail that shouldn't be seen on the interfaz. Notice that all callers of qemu_file_set_rate_limit() used the division or pass 0, so this change is a NOP. Signed-off-by: Juan Quintela --- migration/migration.c | 7

[PATCH 13/21] migration: Use migration_transferred_bytes() to calculate rate_limit

2023-05-08 Thread Juan Quintela
Signed-off-by: Juan Quintela --- migration/migration-stats.c | 7 +-- migration/migration-stats.h | 6 +- migration/migration.c | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/migration/migration-stats.c b/migration/migration-stats.c index 46b2b0d06e..eb1a2c1

[PATCH 16/21] migration/RDMA: It is accounting for zero/normal pages in two places

2023-05-08 Thread Juan Quintela
Remove the one in control_save_page(). Signed-off-by: Juan Quintela --- migration/ram.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 2339a99932..558f2ed3b1 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1356,13 +1356,6 @@ static bool c

[PATCH 21/21] migration/multifd: Compute transferred bytes correctly

2023-05-08 Thread Juan Quintela
In the past, we had to put the in the main thread all the operations related with sizes due to qemu_file not beeing thread safe. As now all counters are atomic, we can update the counters just after the do the write. As an aditional bonus, we are able to use the right value for the compression me

[PATCH 17/21] migration/rdma: Remove QEMUFile parameter when not used

2023-05-08 Thread Juan Quintela
Signed-off-by: Juan Quintela --- migration/rdma.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index 941797506a..dac3d91e16 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -2027,7 +2027,7 @@ static int qe

[PATCH 09/21] qemu-file: Account for rate_limit usage on qemu_fflush()

2023-05-08 Thread Juan Quintela
That is the moment we know we have transferred something. Signed-off-by: Juan Quintela --- migration/qemu-file.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/migration/qemu-file.c b/migration/qemu-file.c index 6ebc2bd3ec..8de1ecd082 100644 --- a/migration/qemu-file.

[PATCH 11/21] migration: Move migration_total_bytes() to migration-stats.c

2023-05-08 Thread Juan Quintela
Once there rename it to migration_transferred_bytes() and pass a QEMUFile instead of a migration object. Signed-off-by: Juan Quintela --- migration/migration-stats.c | 6 ++ migration/migration-stats.h | 9 + migration/migration.c | 13 +++-- 3 files changed, 18 inser

Re: [PATCH v10 1/8] memory: prevent dma-reentracy issues

2023-05-08 Thread Thomas Huth
On 08/05/2023 15.03, Song Gao wrote: Hi, Thomas 在 2023/5/8 下午5:33, Thomas Huth 写道: On 06/05/2023 11.25, Song Gao wrote:   Hi Alexander 在 2023/4/28 下午5:14, Thomas Huth 写道: On 28/04/2023 11.11, Alexander Bulekov wrote: On 230428 1015, Thomas Huth wrote: On 28/04/2023 10.12, Daniel P. Berrang

[PATCH 14/21] migration: We don't need the field rate_limit_used anymore

2023-05-08 Thread Juan Quintela
Since previous commit, we calculate how much data we have send with migration_transferred_bytes() so no need to maintain this counter and remember to always update it. Signed-off-by: Juan Quintela --- migration/migration-stats.c | 6 -- migration/migration-stats.h | 14 -- migra

[PATCH 19/21] migration: Remove unused qemu_file_credit_transfer()

2023-05-08 Thread Juan Quintela
After this change, nothing abuses QEMUFile to account for data transferrefd during migration. Signed-off-by: Juan Quintela --- migration/qemu-file.c | 5 - migration/qemu-file.h | 8 2 files changed, 13 deletions(-) diff --git a/migration/qemu-file.c b/migration/qemu-file.c index 9

[PATCH 20/21] migration/rdma: Simplify the function that saves a page

2023-05-08 Thread Juan Quintela
When we sent a page through QEMUFile hooks (RDMA) there are three posiblities: - We are not using RDMA. return RAM_SAVE_CONTROL_DELAYED and control_save_page() returns false to let anything else to proceed. - There is one error but we are using RDMA. Then we return a negative value, control_sa

[PATCH 05/21] qemu-file: Make rate_limit_used an uint64_t

2023-05-08 Thread Juan Quintela
Change all the functions that use it. It was already passed as uint64_t. Signed-off-by: Juan Quintela Reviewed-by: Daniel P. Berrangé Message-Id: <20230504113841.23130-5-quint...@redhat.com> --- migration/qemu-file.c | 4 ++-- migration/qemu-file.h | 2 +- 2 files changed, 3 insertions(+), 3 d

Re: [PATCH 1/4] virtio-dmabuf: introduce virtio-dmabuf

2023-05-08 Thread Cornelia Huck
On Wed, May 03 2023, Albert Esteve wrote: > This API manages objects (in this iteration, > dmabuf fds) that can be shared along different > virtio devices. > > The API allows the different devices to add, > remove and/or retrieve the objects by simply > invoking the public functions that reside i

[PATCH 08/21] migration: Move setup_time to mig_stats

2023-05-08 Thread Juan Quintela
It is a time that needs to be cleaned each time cancel migration. Once there ccreate calculate_time_since() to calculate how time since a time in the past. Signed-off-by: Juan Quintela --- migration/migration-stats.c | 7 +++ migration/migration-stats.h | 14 ++ migration/migrat

Re: [PULL 05/42] target/m68k: Finish conversion to tcg_gen_qemu_{ld, st}_*

2023-05-08 Thread Richard Henderson
On 5/8/23 12:44, Laurent Vivier wrote: Le 05/05/2023 à 23:24, Richard Henderson a écrit : Convert away from the old interface with the implicit MemOp argument. Signed-off-by: Richard Henderson Reviewed-by: Anton Johansson Message-Id: <20230502135741.1158035-5-richard.hender...@linaro.org> ---

[PATCH 18/21] migration/rdma: Don't use imaginary transfers

2023-05-08 Thread Juan Quintela
RDMA protocol is completely asynchronous, so in qemu_rdma_save_page() they "invent" that a byte has been transferred. And then they call qemu_file_credit_transfer() and ram_transferred_add() with that byte. Just remove that calls as nothing has been sent. Signed-off-by: Juan Quintela --- migrat

[PATCH 15/21] migration: Don't abuse qemu_file transferred for RDMA

2023-05-08 Thread Juan Quintela
Just create a variable for it, the same way that multifd does. This way it is safe to use for other thread, etc, etc. Signed-off-by: Juan Quintela --- migration/migration-stats.c | 5 +++-- migration/migration-stats.h | 4 migration/rdma.c| 22 -- migratio

Re: [PATCH v2 00/12] simpletrace: refactor and general improvements

2023-05-08 Thread Mads Ynddal
> A question for you: do you think it's possible to move simpletrace into > qemu/python/utils? This requires cleaning up the code to some fairly pedantic > standards, but helps protect it against rot as we change target python > versions. > > No problem if that's too much to ask. just want t

[RFC PATCH 0/2] Make the core disassembler functions target-independent

2023-05-08 Thread Thomas Huth
Move disas.c into the target-independent source set, so that we only have to compile this code once instead multiple times (one time for each target). Marked as RFC since we have to replace the target_ulongs here with hwaddr, and the TARGET_FMT_lx with HWADDR_FMT_plx, which is a little bit ugly ..

[RFC PATCH 2/2] disas: Move disas.c into the target-independent source set

2023-05-08 Thread Thomas Huth
By using hwaddr instead of target_ulong and by tweaking some other spots, we can turn this code into target-independent code for compiling it only once and not multiple times during the build process. Signed-off-by: Thomas Huth --- meson.build | 4 ++-- include/disas/disas.h | 15 +++-

[PATCH v2] Hexagon (decode): look for pkts with multiple insns at the same slot

2023-05-08 Thread Matheus Tavares Bernardino
Each slot in a packet can be assigned to at most one instruction. Although the assembler generally ought to enforce this rule, we better be safe than sorry and also do some check to properly throw an "invalid packet" exception on wrong slot assignments. This should also make it easier to debug pos

[RFC PATCH 1/2] disas: Move softmmu specific code to separate file

2023-05-08 Thread Thomas Huth
We'd like to move disas.c into the common code source set, where CONFIG_USER_ONLY is not available anymore. So we have to move the related code into a separate file instead. While doing the movement, change the type of the "pc" parameter of the monitor_disas() function to "hwaddr" instead of "targ

Re: [PATCH v4 14/57] tcg/i386: Add have_atomic16

2023-05-08 Thread Richard Henderson
On 5/5/23 11:34, Peter Maydell wrote: On Wed, 3 May 2023 at 08:10, Richard Henderson wrote: Notice when Intel or AMD have guaranteed that vmovdqa is atomic. The new variable will also be used in generated code. Signed-off-by: Richard Henderson --- include/qemu/cpuid.h | 18 +++

Re: [PATCH v7 1/1] util/async-teardown: wire up query-command-line-options

2023-05-08 Thread Thomas Huth
On 05/05/2023 14.00, Claudio Imbrenda wrote: Add new -run-with option with an async-teardown=on|off parameter. It is visible in the output of query-command-line-options QMP command, so it can be discovered and used by libvirt. The option -async-teardown is now redundant, deprecate it. Reported-

Re: [PATCH v4 15/57] accel/tcg: Use have_atomic16 in ldst_atomicity.c.inc

2023-05-08 Thread Richard Henderson
On 5/5/23 11:37, Peter Maydell wrote: On Wed, 3 May 2023 at 08:08, Richard Henderson wrote: Hosts using Intel and AMD AVX cpus are quite common. Add fast paths through ldst_atomicity using this. Only enable with CONFIG_INT128; some older clang versions do not support __int128_t, and the inlin

Re: [RFC PATCH 0/2] Make the core disassembler functions target-independent

2023-05-08 Thread Richard Henderson
On 5/8/23 14:37, Thomas Huth wrote: Move disas.c into the target-independent source set, so that we only have to compile this code once instead multiple times (one time for each target). Marked as RFC since we have to replace the target_ulongs here with hwaddr, and the TARGET_FMT_lx with HWADDR_

[PATCH] target/m68k: Fix gen_load_fp for OS_LONG

2023-05-08 Thread Richard Henderson
Case was accidentally dropped in b7a94da9550b. Signed-off-by: Richard Henderson --- target/m68k/translate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 744eb3748b..44d852b106 100644 --- a/target/m68k/translate.c +++ b/target/m68k/tr

Re: [PATCH 79/84] disas: Move disas.c to disas/

2023-05-08 Thread Thomas Huth
On 03/05/2023 09.23, Richard Henderson wrote: Signed-off-by: Richard Henderson --- disas.c => disas/disas.c | 0 disas/meson.build| 4 +++- meson.build | 3 --- 3 files changed, 3 insertions(+), 4 deletions(-) rename disas.c => disas/disas.c (100%) Good idea, I alwa

Re: [PATCH 80/84] disas: Remove target_ulong from the interface

2023-05-08 Thread Thomas Huth
On 03/05/2023 09.23, Richard Henderson wrote: Use uint64_t for the pc, and size_t for the size. Signed-off-by: Richard Henderson --- include/disas/disas.h | 17 ++--- disas/disas.c | 19 +-- linux-user/elfload.c | 5 +++-- 3 files changed, 18 insertion

[PATCH] ui/cursor: incomplete check for integer overflow in cursor_alloc

2023-05-08 Thread Mauro Matteo Cascella
The cursor_alloc function still accepts a signed integer for both the cursor width and height. A specially crafted negative width/height could make datasize wrap around and cause the next allocation to be 0, potentially leading to a heap buffer overflow. Modify QEMUCursor struct and cursor_alloc pr

Re: [PATCH 81/84] tcg: Split out exec/user/guest-base.h

2023-05-08 Thread Thomas Huth
On 03/05/2023 09.23, Richard Henderson wrote: TCG will need this declaration, without all of the other bits that come with cpu-all.h. Signed-off-by: Richard Henderson --- include/exec/cpu-all.h | 5 + include/exec/user/guest-base.h | 12 tcg/tcg.c

Re: [PATCH 82/84] disas: Remove target-specific headers

2023-05-08 Thread Thomas Huth
Maybe add a short description: "This is possible now since we replaced 'target_ulong' in a preceeding patch" ... or so... On 03/05/2023 09.23, Richard Henderson wrote: Signed-off-by: Richard Henderson --- include/disas/disas.h | 6 -- disas/disas.c | 3 ++- 2 files changed,

Re: [PATCH 02/12] aspeed: Introduce a boot_rom region at the machine level

2023-05-08 Thread Francisco Iglesias
On [2023 May 08] Mon 09:58:49, Cédric Le Goater wrote: > This should also avoid Coverity to report a memory leak warning when > the QEMU process exits. See CID 1508061. > > Signed-off-by: Cédric Le Goater Reviewed-by: Francisco Iglesias > --- > hw/arm/aspeed.c | 12 ++-- > 1 file chan

  1   2   3   >