Re: [PULL 11/35] arm/Kconfig: Do not build TCG-only boards on a KVM-only build

2023-05-08 Thread Thomas Huth
On 04/05/2023 14.27, Fabiano Rosas wrote: Thomas Huth writes: On 02/05/2023 14.14, Peter Maydell wrote: From: Fabiano Rosas Move all the CONFIG_FOO=y from default.mak into "default y if TCG" statements in Kconfig. That way they won't be selected when CONFIG_TCG=n. I'm leaving CONFIG_ARM_VI

Re: [PATCH RESEND] vhost: fix possible wrap in SVQ descriptor ring

2023-05-08 Thread Hawkins Jiawei
Hi Eugenio, Thanks for reviewing. On 2023/5/9 1:26, Eugenio Perez Martin wrote: > On Sat, May 6, 2023 at 5:01 PM Hawkins Jiawei wrote: >> >> QEMU invokes vhost_svq_add() when adding a guest's element into SVQ. >> In vhost_svq_add(), it uses vhost_svq_available_slots() to check >> whether QEMU can

Re: [PATCH v3 3/3] tests/qtest: Don't run cdrom boot tests if no accelerator is present

2023-05-08 Thread Thomas Huth
On 08/05/2023 20.16, Fabiano Rosas wrote: On a build configured with: --disable-tcg --enable-xen it is possible to produce a QEMU binary with no TCG nor KVM support. Skip the cdrom boot tests if that's the case. Fixes: 0c1ae3ff9d ("tests/qtest: Fix tests when no KVM or TCG are present") Signed-o

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-05-08 Thread Eugenio Perez Martin
On Mon, May 8, 2023 at 10:10 PM Stefan Hajnoczi wrote: > > On Thu, Apr 20, 2023 at 03:29:44PM +0200, Eugenio Pérez wrote: > > On Wed, 2023-04-19 at 07:21 -0400, Stefan Hajnoczi wrote: > > > On Wed, 19 Apr 2023 at 07:10, Hanna Czenczek wrote: > > > > On 18.04.23 09:54, Eugenio Perez Martin wrote:

[PATCH] Fix QEMU crash caused when NUMA nodes exceed available CPUs

2023-05-08 Thread Yin Wang
command "qemu-system-riscv64 -machine virt -m 2G -smp 1 -numa node,mem=1G -numa node,mem=1G" would trigger this problem. This commit fixes the issue by adding parameter checks. Signed-off-by: Yin Wang --- hw/core/numa.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/core/numa.c b/

Re: [PULL 00/13] Compression code patches

2023-05-08 Thread Richard Henderson
5:27 +0200) Migration PULL request (20230508 edition, take 2) Hi This is just the compression bits of the Migration PULL request for 20230428. Only change is that we don't run the compression tests by default. The problem already exist with compression code. The test just show that it don

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-05-08 Thread Eugenio Perez Martin
On Mon, May 8, 2023 at 9:12 PM Stefan Hajnoczi wrote: > > On Thu, Apr 20, 2023 at 03:27:51PM +0200, Eugenio Pérez wrote: > > On Tue, 2023-04-18 at 16:40 -0400, Stefan Hajnoczi wrote: > > > On Tue, 18 Apr 2023 at 14:31, Eugenio Perez Martin > > > wrote: > > > > On Tue, Apr 18, 2023 at 7:59 PM Stef

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

2023-05-08 Thread Jason Wang
On Tue, May 9, 2023 at 1:32 AM Eugenio Perez Martin wrote: > > On Mon, May 8, 2023 at 12:22 PM Michael S. Tsirkin wrote: > > > > 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

Re: [PATCH v3 0/4] hw/arm/virt: Support dirty ring

2023-05-08 Thread Gavin Shan
Hi Paolo, On 5/9/23 12:21 PM, Gavin Shan wrote: This series intends to support dirty ring for live migration for arm64. The dirty ring use discrete buffer to track dirty pages. For arm64, the speciality is to use backup bitmap to track dirty pages when there is no-running-vcpu context. It's know

[PATCH v3 4/4] kvm: Enable dirty ring for arm64

2023-05-08 Thread Gavin Shan
arm64 has different capability from x86 to enable the dirty ring, which is KVM_CAP_DIRTY_LOG_RING_ACQ_REL. Besides, arm64 also needs the backup bitmap extension (KVM_CAP_DIRTY_LOG_RING_WITH_BITMAP) when 'kvm-arm-gicv3' or 'arm-its-kvm' device is enabled. Here the extension is always enabled and the

[PATCH v3 2/4] kvm: Synchronize the backup bitmap in the last stage

2023-05-08 Thread Gavin Shan
In the last stage of live migration or memory slot removal, the backup bitmap needs to be synchronized when it has been enabled. Signed-off-by: Gavin Shan Reviewed-by: Peter Xu Tested-by: Zhenyu Zhang --- accel/kvm/kvm-all.c | 11 +++ include/sysemu/kvm_int.h | 1 + 2 files chang

[PATCH v3 1/4] migration: Add last stage indicator to global dirty log

2023-05-08 Thread Gavin Shan
The global dirty log synchronization is used when KVM and dirty ring are enabled. There is a particularity for ARM64 where the backup bitmap is used to track dirty pages in non-running-vcpu situations. It means the dirty ring works with the combination of ring buffer and backup bitmap. The dirty bi

[PATCH v3 0/4] hw/arm/virt: Support dirty ring

2023-05-08 Thread Gavin Shan
This series intends to support dirty ring for live migration for arm64. The dirty ring use discrete buffer to track dirty pages. For arm64, the speciality is to use backup bitmap to track dirty pages when there is no-running-vcpu context. It's known that the backup bitmap needs to be synchronized w

[PATCH v3 3/4] kvm: Add helper kvm_dirty_ring_init()

2023-05-08 Thread Gavin Shan
Due to multiple capabilities associated with the dirty ring for different architectures: KVM_CAP_DIRTY_{LOG_RING, LOG_RING_ACQ_REL} for x86 and arm64 separately. There will be more to be done in order to support the dirty ring for arm64. Lets add helper kvm_dirty_ring_init() to enable the dirty ri

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

2023-05-08 Thread Song Gao
在 2023/5/8 下午9:12, 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:

Re: ssl fips self check fails with 7.2.0 on x86 TCG

2023-05-08 Thread Patrick Venture
Verified it was https://gitlab.com/qemu-project/qemu/-/issues/1471 On Thu, May 4, 2023 at 12:03 PM Patrick Venture wrote: > Hi, > > I just finished rebasing my team onto 7.2.0 and now I'm seeing > https://boringssl.googlesource.com/boringssl/+/master/crypto/fipsmodule/self_check/self_check.c#361

Re: RE: [PATCH] virtio-crypto: fix NULL pointer dereference in virtio_crypto_free_request

2023-05-08 Thread zhenwei pi
On 5/9/23 09:02, Gonglei (Arei) wrote: -Original Message- From: Mauro Matteo Cascella [mailto:mcasc...@redhat.com] Sent: Monday, May 8, 2023 11:02 PM To: qemu-devel@nongnu.org Cc: m...@redhat.com; Gonglei (Arei) ; pizhen...@bytedance.com; ta...@zju.edu.cn; mcasc...@redhat.com Subjec

RE: [PATCH] virtio-crypto: fix NULL pointer dereference in virtio_crypto_free_request

2023-05-08 Thread Gonglei (Arei)
> -Original Message- > From: Mauro Matteo Cascella [mailto:mcasc...@redhat.com] > Sent: Monday, May 8, 2023 11:02 PM > To: qemu-devel@nongnu.org > Cc: m...@redhat.com; Gonglei (Arei) ; > pizhen...@bytedance.com; ta...@zju.edu.cn; mcasc...@redhat.com > Subject: [PATCH] virtio-crypto: fix

Re: [PATCH v5 0/3] NUMA: Apply cluster-NUMA-node boundary for aarch64 and riscv machines

2023-05-08 Thread Gavin Shan
Hi Paolo, On 5/9/23 10:27 AM, Gavin Shan wrote: For arm64 and riscv architecture, the driver (/base/arch_topology.c) is used to populate the CPU topology in the Linux guest. It's required that the CPUs in one cluster can't span mutiple NUMA nodes. Otherwise, the Linux scheduling domain can't be

[PATCH v5 0/3] NUMA: Apply cluster-NUMA-node boundary for aarch64 and riscv machines

2023-05-08 Thread Gavin Shan
For arm64 and riscv architecture, the driver (/base/arch_topology.c) is used to populate the CPU topology in the Linux guest. It's required that the CPUs in one cluster can't span mutiple NUMA nodes. Otherwise, the Linux scheduling domain can't be sorted out, as the following warning message indica

[PATCH v5 2/3] hw/arm: Validate cluster and NUMA node boundary

2023-05-08 Thread Gavin Shan
There are two ARM machines where NUMA is aware: 'virt' and 'sbsa-ref'. Both of them are required to follow cluster-NUMA-node boundary. To enable the validation to warn about the irregular configuration where multiple CPUs in one cluster have been associated with different NUMA nodes. Signed-off-by

[PATCH v5 3/3] hw/riscv: Validate cluster and NUMA node boundary

2023-05-08 Thread Gavin Shan
There are two RISCV machines where NUMA is aware: 'virt' and 'spike'. Both of them are required to follow cluster-NUMA-node boundary. To enable the validation to warn about the irregular configuration where multiple CPUs in one cluster has been associated with multiple NUMA nodes. Signed-off-by: G

[PATCH v5 1/3] numa: Validate cluster and NUMA node boundary if required

2023-05-08 Thread Gavin Shan
For some architectures like ARM64, multiple CPUs in one cluster can be associated with different NUMA nodes, which is irregular configuration because we shouldn't have this in baremetal environment. The irregular configuration causes Linux guest to misbehave, as the following warning messages indic

Re: [PATCH 05/22] hw/arm: Select VIRTIO_NET for virt machine

2023-05-08 Thread Paolo Bonzini
Il gio 4 mag 2023, 14:56 Fabiano Rosas ha scritto: > > It's a bit hard to maintain the original intention with just > documentation. Couldn't we require that --without-default-devices always > be accompanied by --with-devices? Maybe, but why would it be bad to just patch the default .mak file?

Re: [PULL 11/35] arm/Kconfig: Do not build TCG-only boards on a KVM-only build

2023-05-08 Thread Paolo Bonzini
Il gio 4 mag 2023, 14:27 Fabiano Rosas ha scritto: > Thomas Huth writes: > > > On 02/05/2023 14.14, Peter Maydell wrote: > >> From: Fabiano Rosas > >> > >> Move all the CONFIG_FOO=y from default.mak into "default y if TCG" > >> statements in Kconfig. That way they won't be selected when > >> CO

Re: [PATCH v20 11/21] qapi/s390x/cpu topology: CPU_POLARIZATION_CHANGE qapi event

2023-05-08 Thread Nina Schoetterl-Glausch
On Tue, 2023-04-25 at 18:14 +0200, Pierre Morel wrote: > When the guest asks to change the polarization this change > is forwarded to the upper layer using QAPI. > The upper layer is supposed to take according decisions concerning > CPU provisioning. > > Signed-off-by: Pierre Morel > --- > qapi/

Re: [PATCH 11/11] cutils: Improve qemu_strtosz handling of fractions

2023-05-08 Thread Eric Blake
On Mon, May 08, 2023 at 03:03:43PM -0500, Eric Blake wrote: > We have several limitations and bugs worth fixing; they are > inter-related enough that it is not worth splitting this patch into > smaller pieces: > > * ".5k" should work to specify 512, just as "0.5k" does > * "1.k" and "1." + "9"

Re: [PATCH v1 6/9] KVM: x86: Add Heki hypervisor support

2023-05-08 Thread Wei Liu
On Fri, May 05, 2023 at 05:20:43PM +0200, Mickaël Salaün wrote: > From: Madhavan T. Venkataraman > > Each supported hypervisor in x86 implements a struct x86_hyper_init to > define the init functions for the hypervisor. Define a new init_heki() > entry point in struct x86_hyper_init. Hypervisor

Re: [PATCH 07/11] numa: Check for qemu_strtosz_MiB error

2023-05-08 Thread Eric Blake
On Mon, May 08, 2023 at 03:03:39PM -0500, Eric Blake wrote: > As shown in the previous commit, qemu_strtosz_MiB sometimes leaves the > result value untoutched (we have to audit further to learn that in untouched > that case, the QAPI generator says that visit_type_NumaOptions() will > have zero-i

Re: [PATCH v1 5/9] KVM: x86: Add new hypercall to lock control registers

2023-05-08 Thread Wei Liu
On Fri, May 05, 2023 at 05:20:42PM +0200, Mickaël Salaün wrote: > This enables guests to lock their CR0 and CR4 registers with a subset of > X86_CR0_WP, X86_CR4_SMEP, X86_CR4_SMAP, X86_CR4_UMIP, X86_CR4_FSGSBASE > and X86_CR4_CET flags. > > The new KVM_HC_LOCK_CR_UPDATE hypercall takes two argumen

Re: [PATCH 0/4] vhost-user-fs: Internal migration

2023-05-08 Thread Stefan Hajnoczi
On Fri, May 05, 2023 at 02:51:55PM +0200, Hanna Czenczek wrote: > On 05.05.23 11:53, Eugenio Perez Martin wrote: > > On Fri, May 5, 2023 at 11:03 AM Hanna Czenczek wrote: > > > On 04.05.23 23:14, Stefan Hajnoczi wrote: > > > > On Thu, 4 May 2023 at 13:39, Hanna Czenczek wrote: > > [...] > > > >

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-05-08 Thread Stefan Hajnoczi
On Thu, Apr 20, 2023 at 03:29:44PM +0200, Eugenio Pérez wrote: > On Wed, 2023-04-19 at 07:21 -0400, Stefan Hajnoczi wrote: > > On Wed, 19 Apr 2023 at 07:10, Hanna Czenczek wrote: > > > On 18.04.23 09:54, Eugenio Perez Martin wrote: > > > > On Mon, Apr 17, 2023 at 9:21 PM Stefan Hajnoczi > > > > w

Re: [PATCH v1 3/9] virt: Implement Heki common code

2023-05-08 Thread Wei Liu
On Fri, May 05, 2023 at 05:20:40PM +0200, Mickaël Salaün wrote: > From: Madhavan T. Venkataraman > > Hypervisor Enforced Kernel Integrity (Heki) is a feature that will use > the hypervisor to enhance guest virtual machine security. > > Configuration > = > > Define the config variabl

[PATCH 04/11] test-cutils: Add coverage of qemu_strtod

2023-05-08 Thread Eric Blake
Plenty more corner cases of strtod proper, but this covers the bulk of what our wrappers do. In particular, it demonstrates the difference on when *value is left uninitialized, which an upcoming patch will normalize. Signed-off-by: Eric Blake --- tests/unit/test-cutils.c | 435 ++

[PATCH 01/11] test-cutils: Avoid g_assert in unit tests

2023-05-08 Thread Eric Blake
glib documentation[1] is clear: g_assert() should be avoided in unit tests because it is ineffective if G_DISABLE_ASSERT is defined; unit tests should stick to constructs based on g_assert_true() instead. Note that since commit 262a69f428, we intentionally state that you cannot define G_DISABLE_ASS

[PATCH 09/11] cutils: Set value in all integral qemu_strto* error paths

2023-05-08 Thread Eric Blake
Our goal in writing qemu_strtoi() and friends is to have an interface harder to abuse than libc's strtol(). Leaving the return value initialized on some error paths does not lend itself well to this goal; and our documentation wasn't helpful on the matter. Note that the previous patch changed all

[PATCH 03/11] test-cutils: Test integral qemu_strto* value on failures

2023-05-08 Thread Eric Blake
We are inconsistent on the contents of *value after a strto* parse failure. I found the following behaviors: - parse_uint() and parse_uint_full(), which document that *value is slammed to 0 on all EINVAL failures and 0 or UINT_MAX on ERANGE failures, and has unit tests for that (note that par

[PATCH 02/11] test-cutils: Use g_assert_cmpuint where appropriate

2023-05-08 Thread Eric Blake
When debugging test failures, seeing unsigned values as large positive values rather than negative values matters (assuming that the bug in glib 2.76 [1] where g_assert_cmpuint displays signed instead of unsigned values will eventually be fixed). No impact when the test is passing, but using a con

[PATCH 08/11] cutils: Set value in all qemu_strtosz* error paths

2023-05-08 Thread Eric Blake
Making callers determine whether or not *value was populated on error is not nice for usability. Pre-patch, we have unit tests that check that *result is left unchanged on most EINVAL errors and set to 0 on many ERANGE errors. This is subtly different from libc strtoumax() behavior which returns

[PATCH 05/11] test-cutils: Prepare for upcoming semantic change in qemu_strtosz

2023-05-08 Thread Eric Blake
A quick search for 'qemu_strtosz' in the code base shows that outside of the testsuite, the ONLY place that passes a non-NULL pointer to @endptr of any variant of a size parser is in hmp.c (the 'o' parser of monitor_parse_arguments), and that particular caller warns of "extraneous characters at the

[PATCH 10/11] cutils: Improve qemu_strtod* error paths

2023-05-08 Thread Eric Blake
Previous patches changed all integral qemu_strto*() error paths to guarantee that *value is never left uninitialized. Do likewise for qemu_strtod. Also, tighten qemu_strtod_finite() to never return a non-finite value (prior to this patch, we were rejecting "inf" with -EINVAL and unspecified resul

[PATCH 06/11] test-cutils: Add more coverage to qemu_strtosz

2023-05-08 Thread Eric Blake
Add some more strings that the user might send our way. In particular, some of these additions include FIXME comments showing where our parser doesn't quite behave the way we want. Signed-off-by: Eric Blake --- tests/unit/test-cutils.c | 226 +-- 1 file chang

[PATCH 07/11] numa: Check for qemu_strtosz_MiB error

2023-05-08 Thread Eric Blake
As shown in the previous commit, qemu_strtosz_MiB sometimes leaves the result value untoutched (we have to audit further to learn that in that case, the QAPI generator says that visit_type_NumaOptions() will have zero-initialized it), and sometimes leaves it with the value of a partial parse before

[PATCH 11/11] cutils: Improve qemu_strtosz handling of fractions

2023-05-08 Thread Eric Blake
We have several limitations and bugs worth fixing; they are inter-related enough that it is not worth splitting this patch into smaller pieces: * ".5k" should work to specify 512, just as "0.5k" does * "1.k" and "1." + "9"*50 + "k" should both produce the same result of 2048 after rounding *

[PATCH 00/11] Fix qemu_strtosz() read-out-of-bounds

2023-05-08 Thread Eric Blake
This series blew up in my face when Hanna first pointed me to https://gitlab.com/qemu-project/qemu/-/issues/1629 Basically, 'qemu-img dd bs=9.9e999' killed a sanitized build because of a read-out-of-bounds (".9e999" parses as infinity, but qemu_strtosz wasn't expecting ERANGE failure). The overal

Re: [PATCH v20 10/21] machine: adding s390 topology to info hotpluggable-cpus

2023-05-08 Thread Nina Schoetterl-Glausch
On Tue, 2023-04-25 at 18:14 +0200, Pierre Morel wrote: > S390 topology adds books and drawers topology containers. > Let's add these to the HMP information for hotpluggable cpus. > > Signed-off-by: Pierre Morel Reviewed-by: Nina Schoetterl-Glausch if you fix the nits below. > --- > hw/core/ma

Re: [PATCH v20 08/21] qapi/s390x/cpu topology: set-cpu-topology qmp command

2023-05-08 Thread Nina Schoetterl-Glausch
On Tue, 2023-04-25 at 18:14 +0200, Pierre Morel wrote: > The modification of the CPU attributes are done through a monitor > command. > > It allows to move the core inside the topology tree to optimize > the cache usage in the case the host's hypervisor previously > moved the CPU. > > The same co

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

2023-05-08 Thread Francisco Iglesias
On [2023 May 08] Mon 14:03:14, Thomas Huth wrote: > 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 Reviewed-by

Re: [PATCH 0/4] vhost-user-fs: Internal migration

2023-05-08 Thread Eugenio Perez Martin
On Mon, May 8, 2023 at 7:51 PM Eugenio Perez Martin wrote: > > On Mon, May 8, 2023 at 7:00 PM Hanna Czenczek wrote: > > > > On 05.05.23 16:37, Hanna Czenczek wrote: > > > On 05.05.23 16:26, Eugenio Perez Martin wrote: > > >> On Fri, May 5, 2023 at 11:51 AM Hanna Czenczek > > >> wrote: > > >>> (B

[PATCH v2 6/6] multifd: Add colo support

2023-05-08 Thread Lukas Straub
Like in the normal ram_load() path, put the received pages into the colo cache and mark the pages in the bitmap so that they will be flushed to the guest later. Signed-off-by: Lukas Straub --- migration/multifd-colo.c | 30 +- 1 file changed, 29 insertions(+), 1 delet

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-05-08 Thread Stefan Hajnoczi
On Thu, Apr 20, 2023 at 03:27:51PM +0200, Eugenio Pérez wrote: > On Tue, 2023-04-18 at 16:40 -0400, Stefan Hajnoczi wrote: > > On Tue, 18 Apr 2023 at 14:31, Eugenio Perez Martin > > wrote: > > > On Tue, Apr 18, 2023 at 7:59 PM Stefan Hajnoczi > > > wrote: > > > > On Tue, Apr 18, 2023 at 10:09:30

[PATCH v2 3/6] multifd: Introduce multifd-internal.h

2023-05-08 Thread Lukas Straub
Introduce multifd-internal.h so code that would normally go into multifd.c can go into an extra file. This way, multifd.c hopefully won't grow to 4000 lines like ram.c This will be used in the next commits to add colo support to multifd. Signed-off-by: Lukas Straub --- migration/multifd-interna

[PATCH v2 4/6] multifd: Introduce a overridable revc_pages method

2023-05-08 Thread Lukas Straub
This allows to override the behaviour around recv_pages. Think of it like a "multifd_colo" child class of multifd. This will be used in the next commits to add colo support to multifd. Signed-off-by: Lukas Straub --- migration/meson.build| 1 + migration/multifd-colo.c | 39 +++

[PATCH v2 1/6] ram: Add public helper to set colo bitmap

2023-05-08 Thread Lukas Straub
The overhead of the mutex in non-multifd mode is negligible, because in that case its just the single thread taking the mutex. This will be used in the next commits to add colo support to multifd. Signed-off-by: Lukas Straub --- migration/ram.c | 17 ++--- migration/ram.h | 1 + 2

[PATCH v2 2/6] ram: Let colo_flush_ram_cache take the bitmap_mutex

2023-05-08 Thread Lukas Straub
This is not required, colo_flush_ram_cache does not run concurrently with the multifd threads since the cache is only flushed after everything has been received. But it makes me more comfortable. This will be used in the next commits to add colo support to multifd. Signed-off-by: Lukas Straub --

[PATCH v2 5/6] multifd: Add the ramblock to MultiFDRecvParams

2023-05-08 Thread Lukas Straub
This will be used in the next commits to add colo support to multifd. Signed-off-by: Lukas Straub --- migration/multifd.c | 11 +-- migration/multifd.h | 2 ++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index fb5e8859de..fddb

[PATCH v2 0/6] multifd: Add colo support

2023-05-08 Thread Lukas Straub
Hello Everyone, These patches add support for colo to multifd. -v2: - Split out addition of p->block - Add more comments Lukas Straub (6): ram: Add public helper to set colo bitmap ram: Let colo_flush_ram_cache take the bitmap_mutex multifd: Introduce multifd-internal.h multifd: Introd

[PULL 12/13] ram-compress.c: Make target independent

2023-05-08 Thread Juan Quintela
From: Lukas Straub Make ram-compress.c target independent. Signed-off-by: Lukas Straub Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/meson.build| 3 ++- migration/ram-compress.c | 17 ++--- 2 files changed, 12 inse

[PULL 11/13] ram compress: Assert that the file buffer matches the result

2023-05-08 Thread Juan Quintela
From: Lukas Straub Before this series, "nothing to send" was handled by the file buffer being empty. Now it is tracked via param->result. Assert that the file buffer state matches the result. Signed-off-by: Lukas Straub Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/q

[PULL 13/13] migration: Initialize and cleanup decompression in migration.c

2023-05-08 Thread Juan Quintela
From: Lukas Straub This fixes compress with colo. Signed-off-by: Lukas Straub Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/migration.c | 9 + migration/ram.c | 5 - 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/migration/migration.c

[PULL 01/13] qtest/migration-test.c: Add tests with compress enabled

2023-05-08 Thread Juan Quintela
From: Lukas Straub There has never been tests for migration with compress enabled. Add suitable tests, testing with compress-wait-thread = false too. Signed-off-by: Lukas Straub Acked-by: Peter Xu Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- tests/qtest/migration-test.c | 10

[PULL 08/13] ram.c: Remove last ram.c dependency from the core compress code

2023-05-08 Thread Juan Quintela
From: Lukas Straub Make compression interfaces take send_queued_data() as an argument. Remove save_page_use_compression() from flush_compressed_data(). This removes the last ram.c dependency from the core compress code. Signed-off-by: Lukas Straub Reviewed-by: Juan Quintela Signed-off-by: Jua

[PULL 09/13] ram.c: Move core compression code into its own file

2023-05-08 Thread Juan Quintela
From: Lukas Straub No functional changes intended. Signed-off-by: Lukas Straub Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/meson.build| 5 +- migration/ram-compress.c | 274 +++ migration/ram-compress.h | 65 ++ mig

[PULL 02/13] qtest/migration-test.c: Add postcopy tests with compress enabled

2023-05-08 Thread Juan Quintela
From: Lukas Straub Add postcopy tests with compress enabled to ensure nothing breaks with the refactoring in the next commits. preempt+compress is blocked, so no test needed for that case. Signed-off-by: Lukas Straub Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- tests/qtest/mi

[PULL 00/13] Compression code patches

2023-05-08 Thread Juan Quintela
ompression-code-pull-request for you to fetch changes up to c323518a7aab1c01740a468671b7f2b517d3bca6: migration: Initialize and cleanup decompression in migration.c (2023-05-08 15:25:27 +0200) Migration PULL request (20230508 editi

[PULL 07/13] ram.c: Call update_compress_thread_counts from compress_send_queued_data

2023-05-08 Thread Juan Quintela
From: Lukas Straub This makes the core compress code more independend from ram.c. Signed-off-by: Lukas Straub Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/ram.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/migration/ram.c b/

[PULL 04/13] ram.c: Dont change param->block in the compress thread

2023-05-08 Thread Juan Quintela
From: Lukas Straub Instead introduce a extra parameter to trigger the compress thread. Now, when the compress thread is done, we know what RAMBlock and offset it did compress. This will be used in the next commits to move save_page_header() out of compress code. Signed-off-by: Lukas Straub Rev

[PULL 06/13] ram.c: Do not call save_page_header() from compress threads

2023-05-08 Thread Juan Quintela
From: Lukas Straub save_page_header() accesses several global variables, so calling it from multiple threads is pretty ugly. Instead, call save_page_header() before writing out the compressed data from the compress buffer to the migration stream. This also makes the core compress code more inde

[PULL 10/13] ram.c: Move core decompression code into its own file

2023-05-08 Thread Juan Quintela
From: Lukas Straub No functional changes intended. Signed-off-by: Lukas Straub Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/ram-compress.c | 203 ++ migration/ram-compress.h | 5 + migration/r

[PULL 03/13] ram.c: Let the compress threads return a CompressResult enum

2023-05-08 Thread Juan Quintela
From: Lukas Straub This will be used in the next commits to move save_page_header() out of compress code. Signed-off-by: Lukas Straub Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/ram.c | 34 ++ 1 file changed, 22 insertions(+), 12 dele

[PULL 05/13] ram.c: Reset result after sending queued data

2023-05-08 Thread Juan Quintela
From: Lukas Straub And take the param->mutex lock for the whole section to ensure thread-safety. Now, it is explicitly clear if there is no queued data to send. Before, this was handled by param->file stream being empty and thus qemu_put_qemu_file() not sending anything. This will be used in the

Re: Machine x-remote property auto-shutdown

2023-05-08 Thread Jag Raman
Hi Markus, Please see the comments inline below. > On May 5, 2023, at 10:58 AM, Markus Armbruster wrote: > > I stumbled over this property, looked closer, and now I'm confused. > > Like most QOM properties, x-remote.auto-shutdown is virtually > undocumented. All we have is this comment in vfi

[PATCH v3 2/3] target/arm: Select CONFIG_ARM_V7M when TCG is enabled

2023-05-08 Thread Fabiano Rosas
We cannot allow this config to be disabled at the moment as not all of the relevant code is protected by it. Commit 29d9efca16 ("arm/Kconfig: Do not build TCG-only boards on a KVM-only build") moved the CONFIGs of several boards to Kconfig, so it is now possible that nothing selects ARM_V7M (e.g.

[PATCH v3 0/3] target/arm: disable-tcg and without-default-devices fixes

2023-05-08 Thread Fabiano Rosas
Changed the cdrom test to apply to only the x86 and s390x cdrom boot tests. CI run: https://gitlab.com/farosas/qemu/-/pipelines/860488769 v2: https://lore.kernel.org/r/20230505123524.23401-1-faro...@suse.de v1: https://lore.kernel.org/r/20230503193833.29047-1-faro...@suse.de Here's the fix for

[PATCH v3 3/3] tests/qtest: Don't run cdrom boot tests if no accelerator is present

2023-05-08 Thread Fabiano Rosas
On a build configured with: --disable-tcg --enable-xen it is possible to produce a QEMU binary with no TCG nor KVM support. Skip the cdrom boot tests if that's the case. Fixes: 0c1ae3ff9d ("tests/qtest: Fix tests when no KVM or TCG are present") Signed-off-by: Fabiano Rosas --- tests/qtest/cdrom

[PATCH v3 1/3] target/arm: Select SEMIHOSTING when using TCG

2023-05-08 Thread Fabiano Rosas
Semihosting has been made a 'default y' entry in Kconfig, which does not work because when building --without-default-devices, the semihosting code would not be available. Make semihosting unconditional when TCG is present. Fixes: 29d9efca16 ("arm/Kconfig: Do not build TCG-only boards on a KVM-on

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

2023-05-08 Thread Michael S. Tsirkin
On Mon, May 08, 2023 at 07:31:35PM +0200, Eugenio Perez Martin wrote: > On Mon, May 8, 2023 at 12:22 PM Michael S. Tsirkin wrote: > > > > 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 M

Re: [PATCH 0/4] vhost-user-fs: Internal migration

2023-05-08 Thread Eugenio Perez Martin
On Mon, May 8, 2023 at 7:00 PM Hanna Czenczek wrote: > > On 05.05.23 16:37, Hanna Czenczek wrote: > > On 05.05.23 16:26, Eugenio Perez Martin wrote: > >> On Fri, May 5, 2023 at 11:51 AM Hanna Czenczek > >> wrote: > >>> (By the way, thanks for the explanations :)) > >>> > >>> On 05.05.23 11:03, Ha

Re: [PATCH v4 51/57] tcg/sparc64: Use atom_and_align_for_opc

2023-05-08 Thread Richard Henderson
On 5/5/23 14:20, Peter Maydell wrote: On Wed, 3 May 2023 at 08:13, Richard Henderson wrote: Signed-off-by: Richard Henderson --- tcg/sparc64/tcg-target.c.inc | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.in

Re: [PATCH v4 49/57] tcg/riscv: Use atom_and_align_for_opc

2023-05-08 Thread Richard Henderson
On 5/5/23 14:19, Peter Maydell wrote: On Wed, 3 May 2023 at 08:13, Richard Henderson wrote: Signed-off-by: Richard Henderson --- tcg/riscv/tcg-target.c.inc | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc in

Re: [PATCH v4 48/57] tcg/ppc: Use atom_and_align_for_opc

2023-05-08 Thread Richard Henderson
On 5/5/23 14:18, Peter Maydell wrote: On Wed, 3 May 2023 at 08:13, Richard Henderson wrote: Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.in

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

2023-05-08 Thread Eugenio Perez Martin
On Mon, May 8, 2023 at 12:22 PM Michael S. Tsirkin wrote: > > 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

Re: [PATCH RESEND] vhost: fix possible wrap in SVQ descriptor ring

2023-05-08 Thread Eugenio Perez Martin
On Sat, May 6, 2023 at 5:01 PM Hawkins Jiawei wrote: > > QEMU invokes vhost_svq_add() when adding a guest's element into SVQ. > In vhost_svq_add(), it uses vhost_svq_available_slots() to check > whether QEMU can add the element into the SVQ. If there is > enough space, then QEMU combines some out

Re: [PATCH 0/4] vhost-user-fs: Internal migration

2023-05-08 Thread Hanna Czenczek
On 05.05.23 16:37, Hanna Czenczek wrote: On 05.05.23 16:26, Eugenio Perez Martin wrote: On Fri, May 5, 2023 at 11:51 AM Hanna Czenczek wrote: (By the way, thanks for the explanations :)) On 05.05.23 11:03, Hanna Czenczek wrote: On 04.05.23 23:14, Stefan Hajnoczi wrote: [...] I think it's

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

2023-05-08 Thread Mads Ynddal
> > I was curious how Mads is using simpletrace for an internal (to > Samsung?) project. > I was just tracing the NVMe emulation to get some metrics. The code is all upstream or a part of this patchset. The rest is tracing configs.

Re: [PATCH 00/13] Migration PULL request (20230508 edition)

2023-05-08 Thread Richard Henderson
On 5/8/23 16:26, Juan Quintela wrote: Hi This is just the compression bits of the Migration PULL request for 20230428. Only change is that we don't run the compression tests by default. The problem already exist with compression code. The test just show that it don't work. Please apply, Juan

Re: [RFC v2 1/1] migration: Update error description whenever migration fails

2023-05-08 Thread Thomas Huth
Hi! On 08/05/2023 17.32, tejus.gk wrote: There are places in the code where the migration is marked failed with MIGRATION_STATUS_FAILED, but the failiure reason is never updated. Hence s/failiure/failure/ libvirt doesn't know why the migration failed when it queries for it. Signed-off-by:

Re: [PATCH v4 52/57] tcg/i386: Honor 64-bit atomicity in 32-bit mode

2023-05-08 Thread Richard Henderson
On 5/5/23 14:27, Peter Maydell wrote: On Wed, 3 May 2023 at 08:18, Richard Henderson wrote: Use the fpu to perform 64-bit loads and stores. Signed-off-by: Richard Henderson @@ -2091,7 +2095,20 @@ static void tcg_out_qemu_ld_direct(TCGContext *s, TCGReg datalo, TCGReg datahi,

Re: [PATCH] target/m68k: Fix gen_load_fp for OS_LONG

2023-05-08 Thread Laurent Vivier
Le 08/05/2023 à 16:08, Richard Henderson a écrit : 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 10

[RFC v2 1/1] migration: Update error description whenever migration fails

2023-05-08 Thread tejus.gk
There are places in the code where the migration is marked failed with MIGRATION_STATUS_FAILED, but the failiure reason is never updated. Hence libvirt doesn't know why the migration failed when it queries for it. Signed-off-by: tejus.gk --- migration/migration.c | 24 +++- 1

[RFC v2 0/1] migration: Update error description whenever migration fails

2023-05-08 Thread tejus.gk
Hi everyone, Thanks for the reviews. This is the v2 patchset based on the reviews recieved for the previous one. Links to previous patchsets: v1: https://lists.gnu.org/archive/html/qemu-devel/2023-05/msg00868.html tejus.gk (1): migration: Update error description whenever migration fails

[PATCH 04/13] ram.c: Dont change param->block in the compress thread

2023-05-08 Thread Juan Quintela
From: Lukas Straub Instead introduce a extra parameter to trigger the compress thread. Now, when the compress thread is done, we know what RAMBlock and offset it did compress. This will be used in the next commits to move save_page_header() out of compress code. Signed-off-by: Lukas Straub Rev

[PATCH 10/13] ram.c: Move core decompression code into its own file

2023-05-08 Thread Juan Quintela
From: Lukas Straub No functional changes intended. Signed-off-by: Lukas Straub Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/ram-compress.c | 203 ++ migration/ram-compress.h | 5 + migration/r

[PATCH 12/13] ram-compress.c: Make target independent

2023-05-08 Thread Juan Quintela
From: Lukas Straub Make ram-compress.c target independent. Signed-off-by: Lukas Straub Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/meson.build| 3 ++- migration/ram-compress.c | 17 ++--- 2 files changed, 12 inse

[PATCH 07/13] ram.c: Call update_compress_thread_counts from compress_send_queued_data

2023-05-08 Thread Juan Quintela
From: Lukas Straub This makes the core compress code more independend from ram.c. Signed-off-by: Lukas Straub Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/ram.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/migration/ram.c b/

[PATCH 05/13] ram.c: Reset result after sending queued data

2023-05-08 Thread Juan Quintela
From: Lukas Straub And take the param->mutex lock for the whole section to ensure thread-safety. Now, it is explicitly clear if there is no queued data to send. Before, this was handled by param->file stream being empty and thus qemu_put_qemu_file() not sending anything. This will be used in the

[PATCH 03/13] ram.c: Let the compress threads return a CompressResult enum

2023-05-08 Thread Juan Quintela
From: Lukas Straub This will be used in the next commits to move save_page_header() out of compress code. Signed-off-by: Lukas Straub Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/ram.c | 34 ++ 1 file changed, 22 insertions(+), 12 dele

[PATCH 13/13] migration: Initialize and cleanup decompression in migration.c

2023-05-08 Thread Juan Quintela
From: Lukas Straub This fixes compress with colo. Signed-off-by: Lukas Straub Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/migration.c | 9 + migration/ram.c | 5 - 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/migration/migration.c

[PATCH 11/13] ram compress: Assert that the file buffer matches the result

2023-05-08 Thread Juan Quintela
From: Lukas Straub Before this series, "nothing to send" was handled by the file buffer being empty. Now it is tracked via param->result. Assert that the file buffer state matches the result. Signed-off-by: Lukas Straub Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/q

[PATCH 09/13] ram.c: Move core compression code into its own file

2023-05-08 Thread Juan Quintela
From: Lukas Straub No functional changes intended. Signed-off-by: Lukas Straub Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/meson.build| 5 +- migration/ram-compress.c | 274 +++ migration/ram-compress.h | 65 ++ mig

  1   2   3   >