[PATCH 06/12] cloop: mark more functions as coroutine_fns and GRAPH_RDLOCK

2023-06-01 Thread Paolo Bonzini
Mark functions as coroutine_fn when they are only called by other coroutine_fns and they can suspend. Change calls to co_wrappers to use the non-wrapped functions, which in turn requires adding GRAPH_RDLOCK annotations. Signed-off-by: Paolo Bonzini --- block/cloop.c | 9 + 1 file change

[PATCH 12/12] block: use bdrv_co_debug_event in coroutine context

2023-06-01 Thread Paolo Bonzini
bdrv_co_debug_event was recently introduced, with bdrv_debug_event becoming a wrapper for use in unknown context. Because most of the time bdrv_debug_event is used on a BdrvChild via the wrapper macro BLKDBG_EVENT, introduce a similar macro BLKDBG_CO_EVENT that calls bdrv_co_debug_event, and switc

[PATCH 00/12] block: more fixes to coroutine_fn marking

2023-06-01 Thread Paolo Bonzini
*** BLURB HERE *** Paolo Bonzini (12): file-posix: remove incorrect coroutine_fn calls qed: mark more functions as coroutine_fns and GRAPH_RDLOCK vpc: mark more functions as coroutine_fns and GRAPH_RDLOCK bochs: mark more functions as coroutine_fns and GRAPH_RDLOCK block: mark another fu

[PATCH 09/12] vhdx: mark more functions as coroutine_fns and GRAPH_RDLOCK

2023-06-01 Thread Paolo Bonzini
Mark functions as coroutine_fn when they are only called by other coroutine_fns and they can suspend. Change calls to co_wrappers to use the non-wrapped functions, which in turn requires adding GRAPH_RDLOCK annotations. Signed-off-by: Paolo Bonzini --- block/vhdx-log.c | 36 +---

[PATCH v2 2/4] block: complete public block status API

2023-06-01 Thread Paolo Bonzini
Include both coroutine and non-coroutine versions, the latter being co_wrapper_mixed_bdrv_rdlock of the former. Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- block/io.c | 18 +- include/block/block-io.h | 18 -- 2 files changed, 17 insert

[PATCH 01/12] file-posix: remove incorrect coroutine_fn calls

2023-06-01 Thread Paolo Bonzini
raw_co_getlength is called by handle_aiocb_write_zeroes, which is not a coroutine function. This is harmless because raw_co_getlength does not actually suspend, but in the interest of clarity make it a non-coroutine_fn that is just wrapped by the coroutine_fn raw_co_getlength. Likewise, check_ca

[PATCH v2 3/4] block: switch to co_wrapper for bdrv_is_allocated_*

2023-06-01 Thread Paolo Bonzini
Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- block/io.c | 53 ++-- include/block/block-io.h | 12 + 2 files changed, 14 insertions(+), 51 deletions(-) diff --git a/block/io.c b/block/io.c index 806715a5bbe3..2fae64ad1eb6 1006

[PATCH v2 3/3] block: remove separate bdrv_file_open callback

2023-06-01 Thread Paolo Bonzini
bdrv_file_open and bdrv_open are completely equivalent, they are never checked except to see which one to invoke. So merge them into a single one. Signed-off-by: Paolo Bonzini --- block.c | 4 +--- block/blkdebug.c | 2 +- block/blkio.c

[PATCH 03/12] vpc: mark more functions as coroutine_fns and GRAPH_RDLOCK

2023-06-01 Thread Paolo Bonzini
Mark functions as coroutine_fn when they are only called by other coroutine_fns and they can suspend. Change calls to co_wrappers to use the non-wrapped functions, which in turn requires adding GRAPH_RDLOCK annotations. Signed-off-by: Paolo Bonzini --- block/vpc.c | 52 +

[PATCH 08/12] vmdk: mark more functions as coroutine_fns and GRAPH_RDLOCK

2023-06-01 Thread Paolo Bonzini
Mark functions as coroutine_fn when they are only called by other coroutine_fns and they can suspend. Change calls to co_wrappers to use the non-wrapped functions, which in turn requires adding GRAPH_RDLOCK annotations. Signed-off-by: Paolo Bonzini --- block/vmdk.c | 27 ++--

[PATCH 11/12] block: use bdrv_co_getlength in coroutine context

2023-06-01 Thread Paolo Bonzini
bdrv_co_getlength was recently introduced, with bdrv_getlength becoming a wrapper for use in unknown context. Switch to bdrv_co_getlength when possible. Signed-off-by: Paolo Bonzini --- block/io.c| 10 +- block/parallels.c | 4 ++-- block/qcow.c | 6 +++--- block/vmdk.c

Re: [PATCH v3 1/9] tests/qtest: add various qtest_qmp_assert_success() variants

2023-06-01 Thread Juan Quintela
Daniel P. Berrangé wrote: > Add several counterparts of qtest_qmp_assert_success() that can > > * Use va_list instead of ... > * Accept a list of FDs to send > * Return the response data > > Signed-off-by: Daniel P. Berrangé > --- > tests/qtest/libqtest.c | 99 +++

Re: [PATCH v3 0/3] Trivial cleanups

2023-06-01 Thread Michael S. Tsirkin
On Thu, May 25, 2023 at 05:03:15PM +0100, Mark Cave-Ayland wrote: > On 23/05/2023 20:56, Bernhard Beschow wrote: > > > This series: > > * Removes dead code from omap_uart and i82378 > > * Resolves redundant code in the i8254 timer devices > > > > v3: > > * Drop TYPE_ISA_PARALLEL since they became

Re: [PATCH v3 4/9] tests/qtest: get rid of some 'qtest_qmp' usage in migration test

2023-06-01 Thread Juan Quintela
Daniel P. Berrangé wrote: > Some of the usage is just a verbose way of re-inventing the > qtest_qmp_assert_success(_ref) methods. > > Signed-off-by: Daniel P. Berrangé Reviewed-by: Juan Quintela

Re: [PATCH v14 08/10] Adding info [tb-list|tb] commands to HMP (WIP)

2023-06-01 Thread Wu, Fei
On 6/1/2023 10:40 AM, Richard Henderson wrote: > On 5/30/23 01:35, Fei Wu wrote: >> +static void do_dump_tbs_info(int total, int sort_by) >> +{ >> +    id = 1; >> +    GList *i; >> +    int count = total; >> + >> +    g_list_free(last_search); >> +    last_search = NULL; >> + >> +    qht_iter(&tb_c

[PATCH v2 1/5] pnv/xive2: Add definition for TCTXT Config register

2023-06-01 Thread Frederic Barrat
Add basic read/write support for the TCTXT Config register on P10. qemu doesn't do anything with it yet, but it avoids logging a guest error when skiboot configures the fused-core state: qemu-system-ppc64 -machine powernv10 ... -d guest_errors ... [0.13167,5] XIVE: [ IC 00 ] Initializin

Re: [PATCH v3 2/9] tests/qtest: add support for callback to receive QMP events

2023-06-01 Thread Juan Quintela
Daniel P. Berrangé wrote: > Currently code must call one of the qtest_qmp_event* functions to > fetch events. These are only usable if the immediate caller knows > the particular event they want to capture, and are only interested > in one specific event type. Adding ability to register an event >

[PATCH v2 2/5] pnv/xive2: Add definition for the ESB cache configuration register

2023-06-01 Thread Frederic Barrat
Add basic read/write support for the ESB cache configuration register on P10. We don't model the ESB cache in qemu so reading/writing the register won't do anything, but it avoids logging a guest error when skiboot configures it: qemu-system-ppc64 -machine powernv10 ... -d guest_errors ... X

[PATCH v2 0/5] Various xive fixes

2023-06-01 Thread Frederic Barrat
A set of small fixes for the interrupt controller (xive2) on P10. Change log: v2: split last patch to do a bit of cleanup first add Cedric's reviewed-by on the first 3 patches Frederic Barrat (5): pnv/xive2: Add definition for TCTXT Config register pnv/xive2: Add definition for the ESB ca

[PATCH v2 5/5] pnv/xive2: Handle TIMA access through all ports

2023-06-01 Thread Frederic Barrat
The Thread Interrupt Management Area (TIMA) can be accessed through 4 ports, targeted by the address. The base address of a TIMA is using port 0 and the other ports are 0x80 apart. Using one port or another can be useful to balance the load on the snoop buses. With skiboot and linux, we currently u

[PATCH v2 4/5] pnv/xive2: Introduce macros to manipulate TIMA addresses

2023-06-01 Thread Frederic Barrat
TIMA addresses are somewhat special and are split in several bit fields with different meanings. This patch describes it and introduce macros to more easily access the various fields. Signed-off-by: Frederic Barrat --- hw/intc/xive.c | 14 +++--- include/hw/ppc/xive_regs.h |

[PATCH] memory-device: Track used region size in DeviceMemoryState

2023-06-01 Thread David Hildenbrand
Let's avoid iterating over all devices and simply track it in the DeviceMemoryState. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: David Hildenbrand --- hw/mem/memory-device.c | 22 +++--- include/hw/boards.h| 2 ++ 2 files changed, 5 insertions(+), 19 deletions(-) di

[PATCH v2 3/5] pnv/xive2: Allow writes to the Physical Thread Enable registers

2023-06-01 Thread Frederic Barrat
Fix what was probably a silly mistake and allow to write the Physical Thread enable registers 0 and 1. Skiboot prefers to use the ENx_SET variant so it went unnoticed, but there's no reason to discard a write to the full register, it is Read-Write. Fixes: da71b7e3ed45 ("ppc/pnv: Add a XIVE2 contro

[PATCH v3 00/10] memory-device: Some cleanups

2023-06-01 Thread David Hildenbrand
Working on adding multi-memslot support for virtio-mem (teaching memory device code about memory devices that can consume multiple memslots), I have some preparatory cleanups in my queue that make sense independent of the actual memory-device/virtio-mem extensions. v2 -> v3: - "memory-device: Intr

[PATCH v3 02/10] memory-device: Introduce machine_memory_devices_init()

2023-06-01 Thread David Hildenbrand
Let's intrduce a new helper that we will use to replace existing memory device setup code during machine initialization. We'll enforce that the size has to be > 0. Once all machines were converted, we'll only allocate ms->device_memory if the size > 0. Reviewed-by: Philippe Mathieu-Daudé Signed-

[PATCH v3 01/10] memory-device: Unify enabled vs. supported error messages

2023-06-01 Thread David Hildenbrand
Let's unify the error messages, such that we can simply stop allocating ms->device_memory if the size would be 0 (and there are no memory devices ever). The case of "not supported by the machine" should barely pop up either way: if the machine doesn't support memory devices, it usually doesn't cal

[PATCH v3 03/10] hw/arm/virt: Use machine_memory_devices_init()

2023-06-01 Thread David Hildenbrand
Let's use our new helper. We'll add the subregion to system RAM now earlier. That shouldn't matter, because the system RAM memory region should already be alive at that point. Cc: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: David Hildenbrand --- hw/arm/virt.c | 9 +

Re: [PATCH v3 3/9] tests/qtest: get rid of 'qmp_command' helper in migration test

2023-06-01 Thread Juan Quintela
Daniel P. Berrangé wrote: > This function duplicates logic of qtest_qmp_assert_success_ref > > Signed-off-by: Daniel P. Berrangé Reviewed-by: Juan Quintela Much better that the current code. And as you answer to Thomas, better messages in case of errors.

[PATCH v3 06/10] hw/i386/pc: Use machine_memory_devices_init()

2023-06-01 Thread David Hildenbrand
Let's use our new helper and stop always allocating ms->device_memory. Once allcoated, we're sure that the size > 0 and that the base was initialized. Adjust the code in pc_memory_init() to check for machine->device_memory instead of pcmc->has_reserved_memory and machine->device_memory->base. Cc:

[PATCH v3 04/10] hw/ppc/spapr: Use machine_memory_devices_init()

2023-06-01 Thread David Hildenbrand
Let's use our new helper and stop always allocating ms->device_memory. There is no difference in common memory-device code anymore between ms->device_memory being NULL or the size being 0. So we only have to teach spapr code that ms->device_memory isn't always around. We can now modify two maxram_

[PATCH v3 09/10] memory-device: Refactor memory_device_pre_plug()

2023-06-01 Thread David Hildenbrand
Let's move memory_device_check_addable() and basic checks out of memory_device_get_free_addr() directly into memory_device_pre_plug(). Separating basic checks from address assignment is cleaner and prepares for further changes. As all memory device users now use memory_devices_init(), and that fu

[PATCH v3 10/10] memory-device: Track used region size in DeviceMemoryState

2023-06-01 Thread David Hildenbrand
Let's avoid iterating over all devices and simply track it in the DeviceMemoryState. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: David Hildenbrand --- hw/mem/memory-device.c | 22 +++--- include/hw/boards.h| 2 ++ 2 files changed, 5 insertions(+), 19 deletions(-) di

[PATCH v3 08/10] hw/i386/pc: Remove PC_MACHINE_DEVMEM_REGION_SIZE

2023-06-01 Thread David Hildenbrand
There are no remaining users in the tree. Libvirt never used that property and a quick internet search revealed no other users. Further, we renamed that property already in commit f2ffbe2b7dd0 ("pc: rename "hotplug memory" terminology to "device memory"") without anybody complaining. So let's jus

[PATCH v3 07/10] hw/i386/acpi-build: Rely on machine->device_memory when building SRAT

2023-06-01 Thread David Hildenbrand
We're already looking at machine->device_memory when calling build_srat_memory(), so let's simply avoid going via PC_MACHINE_DEVMEM_REGION_SIZE to get the size and rely on machine->device_memory directly. Once machine->device_memory is set, we know that the size > 0. The code now looks much more s

[PATCH v3 05/10] hw/loongarch/virt: Use machine_memory_devices_init()

2023-06-01 Thread David Hildenbrand
Let's use our new helper. While at it, use VIRT_HIGHMEM_BASE. Cc: Xiaojuan Yang Cc: Song Gao Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Song Gao Signed-off-by: David Hildenbrand --- hw/loongarch/virt.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/hw/

Re: [PATCH v3 1/9] tests/qtest: add various qtest_qmp_assert_success() variants

2023-06-01 Thread Juan Quintela
Daniel P. Berrangé wrote: > Add several counterparts of qtest_qmp_assert_success() that can > > * Use va_list instead of ... > * Accept a list of FDs to send > * Return the response data > > Signed-off-by: Daniel P. Berrangé > --- > tests/qtest/libqtest.c | 99 +++

Re: [PATCH v3 5/9] tests/qtest: switch to using event callbacks for STOP event

2023-06-01 Thread Juan Quintela
Daniel P. Berrangé wrote: > Change the migration test to use the new qtest event callback to watch > for the stop event. This ensures that we only watch for the STOP event > on the source QEMU. The previous code would set the single 'got_stop' > flag when either source or dest QEMU got the STOP ev

Re: [PATCH v2 4/5] pnv/xive2: Introduce macros to manipulate TIMA addresses

2023-06-01 Thread Cédric Le Goater
On 6/1/23 14:13, Frederic Barrat wrote: TIMA addresses are somewhat special and are split in several bit fields with different meanings. This patch describes it and introduce macros to more easily access the various fields. Signed-off-by: Frederic Barrat Reviewed-by: Cédric Le Goater Thank

Re: [PATCH] memory-device: Track used region size in DeviceMemoryState

2023-06-01 Thread David Hildenbrand
On 01.06.23 14:14, David Hildenbrand wrote: Let's avoid iterating over all devices and simply track it in the DeviceMemoryState. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: David Hildenbrand Not my week for sending patches, ignore this one, it's a duplicate with #10 ... -- Thanks,

Re: [PATCH v3 6/7] hw/ide/pci: Replace some magic numbers by constants

2023-06-01 Thread Mark Cave-Ayland
On 31/05/2023 22:10, Bernhard Beschow wrote: Signed-off-by: Bernhard Beschow --- hw/ide/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/ide/pci.c b/hw/ide/pci.c index 0b26a4ce9f..a25b352537 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -320,7 +320,8 @@ void b

Re: [PATCH v2 5/5] pnv/xive2: Handle TIMA access through all ports

2023-06-01 Thread Cédric Le Goater
On 6/1/23 14:13, Frederic Barrat wrote: The Thread Interrupt Management Area (TIMA) can be accessed through 4 ports, targeted by the address. The base address of a TIMA is using port 0 and the other ports are 0x80 apart. Using one port or another can be useful to balance the load on the snoop bus

Re: [PATCH v3 7/7] hw/ide/piix: Move registration of VMStateDescription to DeviceClass

2023-06-01 Thread Mark Cave-Ayland
On 31/05/2023 22:10, Bernhard Beschow wrote: The modern, declarative way to set up VM state handling is to assign to DeviceClass::vmsd attribute. There shouldn't be any change in behavior since dc->vmsd causes vmstate_register_with_alias_id() to be called on the instance during the instance ini

Re: [PATCH v3 6/9] tests/qtest: replace wait_command() with qtest_qmp_assert_success

2023-06-01 Thread Juan Quintela
Daniel P. Berrangé wrote: > Most usage of wait_command() is followed by qobject_unref(), which > is just a verbose re-implementation of qtest_qmp_assert_success(). > > Signed-off-by: Daniel P. Berrangé Reviewed-by: Juan Quintela > -qobject_unref(rsp); > +qtest_qmp_fds_assert_success(

Re: [PATCH v3 7/9] tests/qtest: capture RESUME events during migration

2023-06-01 Thread Juan Quintela
Daniel P. Berrangé wrote: > When running migration tests we monitor for a STOP event so we can skip > redundant waits. This will be needed for the RESUME event too shortly. > > Signed-off-by: Daniel P. Berrangé > --- > tests/qtest/migration-helpers.c | 12 > tests/qtest/migration-he

[PATCH 0/2] Implement PMULL using host intrinsics

2023-06-01 Thread Ard Biesheuvel
Another set of RFC patches - this time for 64x64->128 polynomial multiplication. Playing round with this on top of the AES changes I sent out earlier this week, I noticed that the speedup is rather substantial. PMULL is relevant for GCM encryption, which combines AES in counter mode with GHASH, wh

[PATCH 2/2] target/i386: Implement PCLMULQDQ using AArch64 PMULL instructions

2023-06-01 Thread Ard Biesheuvel
Use the AArch64 PMULL{2}.P64 instructions to implement PCLMULQDQ instead of emulating them in C code if the host supports this. This is used in the implementation of GCM, which is widely used in IPsec VPN and HTTPS. Somewhat surprising results: on my ThunderX2, enabling this on top of the AES acce

[PATCH 1/2] target/arm: Use x86 intrinsics to implement PMULL.P64

2023-06-01 Thread Ard Biesheuvel
Signed-off-by: Ard Biesheuvel --- host/include/i386/host/cpuinfo.h | 1 + target/arm/tcg/vec_helper.c | 26 +++- util/cpuinfo-i386.c | 1 + 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/host/include/i386/host/cpuinfo.h b/host/include/i386/host/

Re: [PATCH v3 8/9] tests/qtest: make more migration pre-copy scenarios run non-live

2023-06-01 Thread Juan Quintela
Daniel P. Berrangé wrote: > There are 27 pre-copy live migration scenarios being tested. In all of > these we force non-convergance and run for one iteration, then let it > converge and wait for completion during the second (or following) > iterations. At 3 mbps bandwidth limit the first iteration

Re: [PATCH v3 7/9] tests/qtest: capture RESUME events during migration

2023-06-01 Thread Daniel P . Berrangé
On Thu, Jun 01, 2023 at 02:31:13PM +0200, Juan Quintela wrote: > Daniel P. Berrangé wrote: > > When running migration tests we monitor for a STOP event so we can skip > > redundant waits. This will be needed for the RESUME event too shortly. > > > > Signed-off-by: Daniel P. Berrangé > > --- > >

Re: [PATCH v3 7/9] tests/qtest: capture RESUME events during migration

2023-06-01 Thread Juan Quintela
Daniel P. Berrangé wrote: > On Thu, Jun 01, 2023 at 02:31:13PM +0200, Juan Quintela wrote: >> Daniel P. Berrangé wrote: >> > When running migration tests we monitor for a STOP event so we can skip >> > redundant waits. This will be needed for the RESUME event too shortly. >> > >> > Signed-off-by:

Re: [PATCH v3 8/9] tests/qtest: make more migration pre-copy scenarios run non-live

2023-06-01 Thread Daniel P . Berrangé
On Thu, Jun 01, 2023 at 02:33:56PM +0200, Juan Quintela wrote: > Daniel P. Berrangé wrote: > > There are 27 pre-copy live migration scenarios being tested. In all of > > these we force non-convergance and run for one iteration, then let it > > converge and wait for completion during the second (or

Re: [PATCH v3 7/9] tests/qtest: capture RESUME events during migration

2023-06-01 Thread Daniel P . Berrangé
On Thu, Jun 01, 2023 at 02:37:37PM +0200, Juan Quintela wrote: > Daniel P. Berrangé wrote: > > On Thu, Jun 01, 2023 at 02:31:13PM +0200, Juan Quintela wrote: > >> Daniel P. Berrangé wrote: > >> > When running migration tests we monitor for a STOP event so we can skip > >> > redundant waits. This

Re: [PATCH v3 0/3] Trivial cleanups

2023-06-01 Thread Mark Cave-Ayland
On 01/06/2023 13:07, Michael S. Tsirkin wrote: On Thu, May 25, 2023 at 05:03:15PM +0100, Mark Cave-Ayland wrote: On 23/05/2023 20:56, Bernhard Beschow wrote: This series: * Removes dead code from omap_uart and i82378 * Resolves redundant code in the i8254 timer devices v3: * Drop TYPE_ISA_PA

Re: [PATCH v13 04/10] accel/tcg: add jit stats and time to TBStatistics

2023-06-01 Thread Wu, Fei
On 6/1/2023 7:51 PM, Alex Bennée wrote: > > "Wu, Fei" writes: > >> On 5/30/2023 6:08 PM, Alex Bennée wrote: >>> >>> "Wu, Fei" writes: >>> On 5/30/2023 1:01 PM, Wu, Fei wrote: > On 5/30/2023 12:07 PM, Richard Henderson wrote: >> On 5/29/23 04:49, Fei Wu wrote: > >>

Re: [PATCH v3 1/9] tests/qtest: add various qtest_qmp_assert_success() variants

2023-06-01 Thread Daniel P . Berrangé
On Thu, Jun 01, 2023 at 11:23:01AM +0200, Thomas Huth wrote: > On 31/05/2023 15.23, Daniel P. Berrangé wrote: > > Add several counterparts of qtest_qmp_assert_success() that can > > > > * Use va_list instead of ... > > * Accept a list of FDs to send > > * Return the response data > > > > Si

Re: [PATCH v3 1/9] tests/qtest: add various qtest_qmp_assert_success() variants

2023-06-01 Thread Daniel P . Berrangé
On Thu, Jun 01, 2023 at 02:20:34PM +0200, Juan Quintela wrote: > Daniel P. Berrangé wrote: > > Add several counterparts of qtest_qmp_assert_success() that can > > > > * Use va_list instead of ... > > * Accept a list of FDs to send > > * Return the response data > > > > Signed-off-by: Daniel P.

Re: [PATCH v3 2/9] tests/qtest: add support for callback to receive QMP events

2023-06-01 Thread Daniel P . Berrangé
On Thu, Jun 01, 2023 at 02:14:08PM +0200, Juan Quintela wrote: > Daniel P. Berrangé wrote: > > Currently code must call one of the qtest_qmp_event* functions to > > fetch events. These are only usable if the immediate caller knows > > the particular event they want to capture, and are only interes

Re: [PATCH] qcow2: add discard-no-unref option

2023-06-01 Thread Jean-Louis Dupond
On 31/05/2023 17:05, Hanna Czenczek wrote: On 15.05.23 09:36, Jean-Louis Dupond wrote: When we for example have a sparse qcow2 image and discard: unmap is enabled, there can be a lot of fragmentation in the image after some time. Surely on VM's s/. Surely/, especially/ that do a lot of writ

Re: [PATCH 1/2] target/arm: Use x86 intrinsics to implement PMULL.P64

2023-06-01 Thread Peter Maydell
On Thu, 1 Jun 2023 at 13:33, Ard Biesheuvel wrote: > > Signed-off-by: Ard Biesheuvel > --- > host/include/i386/host/cpuinfo.h | 1 + > target/arm/tcg/vec_helper.c | 26 +++- > util/cpuinfo-i386.c | 1 + > 3 files changed, 27 insertions(+), 1 deletion(-) > > di

Re: [PATCH v3 0/6] block: add blk_io_plug_call() API

2023-06-01 Thread Stefan Hajnoczi
On Tue, May 30, 2023 at 02:09:53PM -0400, Stefan Hajnoczi wrote: > v3 > - Patch 5: Mention why dev_max_batch condition was dropped [Stefano] > v2 > - Patch 1: "is not be freed" -> "is not freed" [Eric] > - Patch 2: Remove unused nvme_process_completion_queue_plugged trace event > [Stefano] > - Pa

[RFC] linux-user/riscv: Add syscall riscv_hwprobe

2023-06-01 Thread Robbin Ehn
This patch adds the new syscall for the "RISC-V Hardware Probing Interface" (https://docs.kernel.org/riscv/hwprobe.html). Signed-off-by: Robbin Ehn --- linux-headers/asm-riscv/unistd.h | 9 +++ linux-user/riscv/cpu_loop.c | 119 ++- linux-user/riscv/syscall32_n

Re: [PATCH] qcow2: add discard-no-unref option

2023-06-01 Thread Jean-Louis Dupond
On 31/05/2023 17:16, Hanna Czenczek wrote: On 15.05.23 09:36, Jean-Louis Dupond wrote: When we for example have a sparse qcow2 image and discard: unmap is enabled, there can be a lot of fragmentation in the image after some time. Surely on VM's that do a lot of writes/deletes. This causes th

Re: Performance improvement and regression with 6d740fb01b9f0f5ea7a82f4d5e458d91940a19ee

2023-06-01 Thread Stefan Hajnoczi
On Thu, Jun 01, 2023 at 06:23:21AM +0200, Lukáš Doktor wrote: > Dne 31. 05. 23 v 19:14 Stefan Hajnoczi napsal(a): > > On Wed, 31 May 2023 at 12:50, Lukáš Doktor wrote: > >> > >> Dne 26. 05. 23 v 12:56 Stefan Hajnoczi napsal(a): > >>> On Fri, 26 May 2023 at 04:07, Lukáš Doktor wrote: > >

Re: [PATCH 2/9] hw/ide/core: set ERR_STAT in unsupported command completion

2023-06-01 Thread Niklas Cassel
On Wed, May 17, 2023 at 05:12:57PM -0400, John Snow wrote: > On Fri, Apr 28, 2023 at 9:22 AM Niklas Cassel wrote: > > > > From: Niklas Cassel > > > > Currently, the first time sending an unsupported command > > (e.g. READ LOG DMA EXT) will not have ERR_STAT set in the completion. > > Sending the

Re: [PATCH v2 1/4] block: rename the bdrv_co_block_status static function

2023-06-01 Thread Eric Blake
On Thu, Jun 01, 2023 at 01:51:28PM +0200, Paolo Bonzini wrote: > bdrv_block_status exists as a wrapper for bdrv_block_status_above, > but the name of the (hypothetical) coroutine version, bdrv_co_block_status, > is squatted by a random static function. Rename it to bdrv_do_block_status. bdrv_co_d

Re: [PATCH v2 2/4] block: complete public block status API

2023-06-01 Thread Eric Blake
On Thu, Jun 01, 2023 at 01:51:29PM +0200, Paolo Bonzini wrote: > Include both coroutine and non-coroutine versions, the latter being > co_wrapper_mixed_bdrv_rdlock of the former. > > Reviewed-by: Eric Blake > Signed-off-by: Paolo Bonzini > --- > block/io.c | 18 +-

Re: [PATCH v2 0/6] Vhost-vdpa Shadow Virtqueue Offloads support

2023-06-01 Thread Hawkins Jiawei
On 2023/6/1 17:56, Lei Yang wrote: > I'm a QE responsible for vhost_vdpa parts. Could you please provide me > with the test steps for this series? I can test it in my environment > and update the test results. > Hi Lei, I am not sure if these are enough, but you can test it like this: 1. you can

Re: [PATCH v2 0/3] block: remove separate bdrv_file_open callback

2023-06-01 Thread Eric Blake
On Thu, Jun 01, 2023 at 01:51:36PM +0200, Paolo Bonzini wrote: > The value of the bdrv_file_open is sometimes checked to distinguish > protocol and format drivers, but apart from that there is no difference > between bdrv_file_open and bdrv_open. > > However, they can all be distinguished by the n

Re: [PATCH v2 4/6] virtio-net: expose virtio_net_supported_guest_offloads()

2023-06-01 Thread Eugenio Perez Martin
On Thu, Jun 1, 2023 at 11:05 AM Hawkins Jiawei wrote: > > On Thu, 1 Jun 2023 at 16:48, Hawkins Jiawei wrote: > > > > To support restoring offloads state in vdpa, need to expose > > the function virtio_net_supported_guest_offloads(), then vdpa > > uses this function to get the guest supported offl

[PATCH v2 0/8] misc AHCI cleanups

2023-06-01 Thread Niklas Cassel
From: Niklas Cassel Hello John, Here comes some misc AHCI cleanups. Most are related to error handling. Please review. (I'm also working on a second series which will add support for READ LOG EXT and READ LOG DMA EXT, but I will send that one out once it is ready. (It might take a couple of w

[PATCH v2 1/8] hw/ide/ahci: remove stray backslash

2023-06-01 Thread Niklas Cassel
From: Niklas Cassel This backslash obviously does not belong here, so remove it. Signed-off-by: Niklas Cassel Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: John Snow --- hw/ide/ahci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 4

[PATCH v2 2/8] hw/ide/core: set ERR_STAT in unsupported command completion

2023-06-01 Thread Niklas Cassel
From: Niklas Cassel Currently, the first time sending an unsupported command (e.g. READ LOG DMA EXT) will not have ERR_STAT set in the completion. Sending the unsupported command again, will correctly have ERR_STAT set. When ide_cmd_permitted() returns false, it calls ide_abort_command(). ide_ab

[PATCH v2 4/8] hw/ide/ahci: simplify and document PxCI handling

2023-06-01 Thread Niklas Cassel
From: Niklas Cassel The AHCI spec states that: For NCQ, PxCI is cleared on command queued successfully. For non-NCQ, PxCI is cleared on command completed successfully. (A non-NCQ command that completes with error does not clear PxCI.) The current QEMU implementation either clears PxCI in check_

[PATCH v2 3/8] hw/ide/ahci: write D2H FIS on when processing NCQ command

2023-06-01 Thread Niklas Cassel
From: Niklas Cassel The way that BUSY + PxCI is cleared for NCQ (FPDMA QUEUED) commands is described in SATA 3.5a Gold: 11.15 FPDMA QUEUED command protocol DFPDMAQ2: ClearInterfaceBsy "Transmit Register Device to Host FIS with the BSY bit cleared to zero and the DRQ bit cleared to zero and Inter

[PATCH v2 7/8] hw/ide/ahci: fix ahci_write_fis_sdb()

2023-06-01 Thread Niklas Cassel
From: Niklas Cassel When there is an error, we need to raise a TFES error irq, see AHCI 1.3.1, 5.3.13.1 SDB:Entry. If ERR_STAT is set, we jump to state ERR:FatalTaskfile, which will raise a TFES IRQ unconditionally, regardless if the I bit is set in the FIS or not. Thus, we should never raise a

[PATCH v2 6/8] hw/ide/ahci: PxSACT and PxCI is cleared when PxCMD.ST is cleared

2023-06-01 Thread Niklas Cassel
From: Niklas Cassel According to AHCI 1.3.1 definition of PxSACT: This field is cleared when PxCMD.ST is written from a '1' to a '0' by software. This field is not cleared by a COMRESET or a software reset. According to AHCI 1.3.1 definition of PxCI: This field is also cleared when PxCMD.ST is w

[PATCH v2 8/8] hw/ide/ahci: fix broken SError handling

2023-06-01 Thread Niklas Cassel
From: Niklas Cassel When encountering an NCQ error, you should not write the NCQ tag to the SError register. This is completely wrong. The SError register has a clear definition, where each bit represents a different error, see PxSERR definition in AHCI 1.3.1. If we write a random value (like t

[PATCH v2 5/8] hw/ide/ahci: PxCI should not get cleared when ERR_STAT is set

2023-06-01 Thread Niklas Cassel
From: Niklas Cassel For NCQ, PxCI is cleared on command queued successfully. For non-NCQ, PxCI is cleared on command completed successfully. Successfully means ERR_STAT, BUSY and DRQ are all cleared. A command that has ERR_STAT set, does not get to clear PxCI. See AHCI 1.3.1, section 5.3.8, stat

[PATCH v3 1/6] include/hw/virtio: make some VirtIODevice const

2023-06-01 Thread Hawkins Jiawei
The VirtIODevice structure is not modified in virtio_vdev_has_feature(). Therefore, make it const to allow this function to accept const variables. Signed-off-by: Hawkins Jiawei --- include/hw/virtio/virtio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/virtio/v

[PATCH v3 0/6] Vhost-vdpa Shadow Virtqueue Offloads support

2023-06-01 Thread Hawkins Jiawei
This series enables shadowed CVQ to intercept Offloads commands through shadowed CVQ, update the virtio NIC device model so qemu send it in a migration, and the restore of that Offloads state in the destination. Changelog = v3: - refactor the commit message in patch "virtio-net: expose v

[PATCH v3 2/6] vdpa: reuse virtio_vdev_has_feature()

2023-06-01 Thread Hawkins Jiawei
We can use virtio_vdev_has_feature() instead of manually accessing the features. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 37cdc84562..e907a3c792 100644 --- a/net/vhost-vd

[PATCH v3 6/6] vdpa: Allow VIRTIO_NET_F_CTRL_GUEST_OFFLOADS in SVQ

2023-06-01 Thread Hawkins Jiawei
Enable SVQ with VIRTIO_NET_F_CTRL_GUEST_OFFLOADS feature. Signed-off-by: Hawkins Jiawei Acked-by: Jason Wang --- net/vhost-vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 0e647886d1..4cc24a2997 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vd

[PATCH v3 4/6] virtio-net: expose virtio_net_supported_guest_offloads()

2023-06-01 Thread Hawkins Jiawei
To support restoring offloads state in vdpa, need to expose the function virtio_net_supported_guest_offloads(). QEMU uses this function to get the guest supported offloads and no needs to send the corresponding CVQ command if guest enables all supported features. Signed-off-by: Hawkins Jiawei ---

[PATCH v3 3/6] hw/net/virtio-net: make some VirtIONet const

2023-06-01 Thread Hawkins Jiawei
The VirtIONet structure is not modified in virtio_net_supported_guest_offloads(). Therefore, make it const to allow this function to accept const variables. Signed-off-by: Hawkins Jiawei --- hw/net/virtio-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/virtio-net

[PATCH v3 5/6] vdpa: Add vhost_vdpa_net_load_offloads()

2023-06-01 Thread Hawkins Jiawei
This patch introduces vhost_vdpa_net_load_offloads() to restore offloads state at device's startup. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 38 ++ 1 file changed, 38 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index e907a3c792.

Re: [PATCH 01/12] file-posix: remove incorrect coroutine_fn calls

2023-06-01 Thread Eric Blake
On Thu, Jun 01, 2023 at 01:51:34PM +0200, Paolo Bonzini wrote: > raw_co_getlength is called by handle_aiocb_write_zeroes, which is not a > coroutine > function. This is harmless because raw_co_getlength does not actually > suspend, > but in the interest of clarity make it a non-coroutine_fn that

Re: [PULL 01/11] *-user: remove the guest_user_syscall tracepoints

2023-06-01 Thread Stefan Hajnoczi
On Wed, May 31, 2023 at 02:29:49PM -0700, Richard Henderson wrote: > On 5/31/23 12:48, Stefan Hajnoczi wrote: > > --- a/bsd-user/freebsd/os-syscall.c > > +++ b/bsd-user/freebsd/os-syscall.c > > @@ -531,7 +531,6 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, > > abi_long arg1, > > CPU

Re: [PATCH 0/9] misc AHCI cleanups

2023-06-01 Thread Niklas Cassel
On Wed, May 17, 2023 at 01:06:06PM -0400, John Snow wrote: > On Fri, Apr 28, 2023 at 9:22 AM Niklas Cassel wrote: > > > > From: Niklas Cassel > > > > Hello John, > > > > Hi Niklas! > > I haven't been actively involved with AHCI for a while, so I am not > sure I can find the time to give this a

Re: [PATCH v2 4/6] virtio-net: expose virtio_net_supported_guest_offloads()

2023-06-01 Thread Hawkins Jiawei
On 2023/6/1 21:43, Eugenio Perez Martin wrote: > On Thu, Jun 1, 2023 at 11:05 AM Hawkins Jiawei wrote: >> >> On Thu, 1 Jun 2023 at 16:48, Hawkins Jiawei wrote: >>> >>> To support restoring offloads state in vdpa, need to expose >>> the function virtio_net_supported_guest_offloads(), then vdpa >>>

[ANNOUNCE] QEMU 7.2.3 Stable released

2023-06-01 Thread Michael Roth
Hi everyone, I am pleased to announce that the QEMU v7.2.3 stable release is now available. You can grab the tarball from our download page here: https://www.qemu.org/download/#source v7.2.3 is now tagged in the official qemu.git repository, and the stable-7.2 branch has been updated accordin

[PATCH] SDL: OpenGL 3 window context

2023-06-01 Thread Antonio Caggiano
SDL renderer creates an OpenGL 2.1 context while QEMU expects minimum OpenGL version 3.3 or ES 3.0. To fix this we create an OpenGL context directly, ignoring the SDL renderer when OpenGL is enabled. Signed-off-by: Antonio Caggiano --- ui/sdl2.c | 34 ++ 1 file ch

Re: [PATCH 1/1] hw/ide/core.c: fix handling of unsupported commands

2023-06-01 Thread Niklas Cassel
On Wed, May 24, 2023 at 11:20:41AM -0400, John Snow wrote: > On Wed, May 24, 2023, 4:17 AM Niklas Cassel wrote: > > > On Tue, May 23, 2023 at 10:35:56AM -0400, John Snow wrote: > > > On Mon, May 22, 2023 at 5:16???PM Mateusz Albecki < > > mateusz.p.albe...@gmail.com> > > > wrote: > > > > > > > >

Re: [PATCH v14 03/10] accel: collecting TB execution count

2023-06-01 Thread Richard Henderson
On 5/31/23 22:44, Wu, Fei wrote: On 6/1/2023 8:05 AM, Richard Henderson wrote: On 5/30/23 01:35, 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

[ANNOUNCE] QEMU 8.0.2 Stable released

2023-06-01 Thread Michael Roth
Hi everyone, I am pleased to announce that the QEMU v8.0.2 stable release is now available. You can grab the tarball from our download page here: https://www.qemu.org/download/#source v8.0.2 is now tagged in the official qemu.git repository, and the stable-8.0 branch has been updated accordin

Re: [PATCH v14 04/10] accel/tcg: add jit stats and time to TBStatistics

2023-06-01 Thread Richard Henderson
On 5/31/23 23:48, Wu, Fei wrote: -int64_t tcg_cpu_exec_time(void); +uint64_t tcg_cpu_exec_time(void); Why?  (Also, probably wants removing, per above.) The original patch mentioned 'make it an uint64_t as we won't be dealing in negative numbers.' The signed vs unsigned thing is something th

Re: [PATCH v3 5/6] vdpa: Add vhost_vdpa_net_load_offloads()

2023-06-01 Thread Eugenio Perez Martin
On Thu, Jun 1, 2023 at 3:49 PM Hawkins Jiawei wrote: > > This patch introduces vhost_vdpa_net_load_offloads() to > restore offloads state at device's startup. > > Signed-off-by: Hawkins Jiawei > --- > net/vhost-vdpa.c | 38 ++ > 1 file changed, 38 insertions(+

Re: [PATCH v3 1/6] include/hw/virtio: make some VirtIODevice const

2023-06-01 Thread Eugenio Perez Martin
On Thu, Jun 1, 2023 at 3:49 PM Hawkins Jiawei wrote: > > The VirtIODevice structure is not modified in > virtio_vdev_has_feature(). Therefore, make it const > to allow this function to accept const variables. > > Signed-off-by: Hawkins Jiawei Reviewed-by: Eugenio Pérez Martin > --- > include/

Re: [PATCH v3 2/6] vdpa: reuse virtio_vdev_has_feature()

2023-06-01 Thread Eugenio Perez Martin
On Thu, Jun 1, 2023 at 3:49 PM Hawkins Jiawei wrote: > > We can use virtio_vdev_has_feature() instead of manually > accessing the features. > > Signed-off-by: Hawkins Jiawei Acked-by: Eugenio Pérez > --- > net/vhost-vdpa.c | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff

Re: [PATCH v3 3/6] hw/net/virtio-net: make some VirtIONet const

2023-06-01 Thread Eugenio Perez Martin
On Thu, Jun 1, 2023 at 3:49 PM Hawkins Jiawei wrote: > > The VirtIONet structure is not modified in > virtio_net_supported_guest_offloads(). > Therefore, make it const to allow this function to > accept const variables. > > Signed-off-by: Hawkins Jiawei Reviewed-by: Eugenio Pérez > --- > hw/n

Re: [PATCH v3 6/6] vdpa: Allow VIRTIO_NET_F_CTRL_GUEST_OFFLOADS in SVQ

2023-06-01 Thread Eugenio Perez Martin
On Thu, Jun 1, 2023 at 3:50 PM Hawkins Jiawei wrote: > > Enable SVQ with VIRTIO_NET_F_CTRL_GUEST_OFFLOADS feature. > > Signed-off-by: Hawkins Jiawei > Acked-by: Jason Wang Acked-by: Eugenio Pérez > --- > net/vhost-vdpa.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/net/vhost-vdpa

<    1   2   3   4   5   >