Re: [PATCH 0/2] target/s390x: s390_probe_access fixes

2022-08-24 Thread David Hildenbrand
On 23.08.22 23:38, Richard Henderson wrote: > First, as pointed out by David; second by inspection. > > I really wish there were a better way to structure this, > but alas, I don't see any alternatives that aren't just > different but similar amounts of ugly. > The only feasible way would be hav

Re: [PATCH v8 02/12] s390x/cpu_topology: CPU topology objects and structures

2022-08-24 Thread Thomas Huth
On 23/08/2022 19.41, Pierre Morel wrote: On 8/23/22 15:30, Thomas Huth wrote: On 20/06/2022 16.03, Pierre Morel wrote: We use new objects to have a dynamic administration of the CPU topology. The highest level object in this implementation is the s390 book and in this first implementation of

Re: [PATCH 2/2] target/s390x: Align __excp_addr in s390_probe_access

2022-08-24 Thread David Hildenbrand
On 23.08.22 23:38, Richard Henderson wrote: > Per the comment in s390_cpu_record_sigsegv, the saved address > is always page aligned. > > Signed-off-by: Richard Henderson > --- > target/s390x/tcg/mem_helper.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/target/s390x/

Re: [PATCH 1/2] Revert "target/s390x: Use probe_access_flags in s390_probe_access"

2022-08-24 Thread David Hildenbrand
On 23.08.22 23:38, Richard Henderson wrote: > This reverts commit db9aab5783a2fb62250e12f0c4cfed5e1778c189. > > This patch breaks the contract of s390_probe_access, in that > it no longer returns an exception code, nor set __excp_addr. > > Reported-by: David Hildenbrand > Signed-off-by: Richard

Re: [PATCH 2/5] vdpa: Add vhost_vdpa_net_load_mq

2022-08-24 Thread Eugenio Perez Martin
On Wed, Aug 24, 2022 at 6:23 AM Jason Wang wrote: > > > 在 2022/8/20 01:13, Eugenio Pérez 写道: > > Same way as with the MAC, restore the expected number of queues at > > device's start. > > > > Signed-off-by: Eugenio Pérez > > --- > > net/vhost-vdpa.c | 33 + > >

Re: [PATCH v2 0/4] hw/arm/virt: Improve address assignment for high memory regions

2022-08-24 Thread Eric Auger
Hi Gavin, On 8/24/22 05:29, Gavin Shan wrote: > Hi Marc, > > On 8/15/22 4:29 PM, Gavin Shan wrote: >> There are three high memory regions, which are VIRT_HIGH_REDIST2, >> VIRT_HIGH_PCIE_ECAM and VIRT_HIGH_PCIE_MMIO. Their base addresses >> are floating on highest RAM address. However, they can be

[PATCH] tests/avocado: Fix trivial typo

2022-08-24 Thread Thomas Huth
The intention was likely to use "intend" instead of "indent" here. Signed-off-by: Thomas Huth --- tests/avocado/avocado_qemu/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado_qemu/__init__.py index ed48

Re: [PATCH v9 1/3] hw/intc: Move mtimer/mtimecmp to aclint

2022-08-24 Thread Atish Kumar Patra
On Tue, Aug 23, 2022 at 2:10 PM Alistair Francis wrote: > On Thu, Aug 11, 2022 at 4:57 AM Atish Patra wrote: > > > > Historically, The mtime/mtimecmp has been part of the CPU because > > they are per hart entities. However, they actually belong to aclint > > which is a MMIO device. > > > > Move

Re: [PATCH v5 1/2] Update AVX512 support for xbzrle_encode_buffer

2022-08-24 Thread Juan Quintela
ling xu wrote: > This commit updates code of avx512 support for xbzrle_encode_buffer function > to > accelerate xbzrle encoding speed. We add runtime check of avx512 and add > benchmark for this feature. Compared with C version of > xbzrle_encode_buffer function, avx512 version can achieve 50%-70

Re: [PATCH v8 02/12] s390x/cpu_topology: CPU topology objects and structures

2022-08-24 Thread Pierre Morel
On 8/24/22 09:30, Thomas Huth wrote: On 23/08/2022 19.41, Pierre Morel wrote: On 8/23/22 15:30, Thomas Huth wrote: On 20/06/2022 16.03, Pierre Morel wrote: We use new objects to have a dynamic administration of the CPU topology. The highest level object in this implementation is the s390

Re: [PATCH v5 1/9] parallels: Out of image offset in BAT leads to image inflation

2022-08-24 Thread Vladimir Sementsov-Ogievskiy
On 8/23/22 13:11, Denis V. Lunev wrote: On 23.08.2022 11:58, Vladimir Sementsov-Ogievskiy wrote: On 8/23/22 12:20, Denis V. Lunev wrote: On 23.08.2022 09:23, Alexander Ivanov wrote: On 23.08.2022 08:58, Vladimir Sementsov-Ogievskiy wrote: On 8/22/22 12:05, Alexander Ivanov wrote: data_end f

[PATCH v3 1/3] util/main-loop: Fix maximum number of wait objects for win32

2022-08-24 Thread Bin Meng
From: Bin Meng The maximum number of wait objects for win32 should be MAXIMUM_WAIT_OBJECTS, not MAXIMUM_WAIT_OBJECTS + 1. Signed-off-by: Bin Meng --- Changes in v3: - move the check of adding the same HANDLE twice to a separete patch Changes in v2: - fix the logic in qemu_add_wait_object() to

[PATCH v3 2/3] util/main-loop: Avoid adding the same HANDLE twice

2022-08-24 Thread Bin Meng
From: Bin Meng Fix the logic in qemu_add_wait_object() to avoid adding the same HANDLE twice, as the behavior is undefined when passing an array that contains same HANDLEs to WaitForMultipleObjects() API. Signed-off-by: Bin Meng --- Changes in v3: - new patch: avoid adding the same HANDLE twic

Re: [PATCH 2/5] vdpa: Add vhost_vdpa_net_load_mq

2022-08-24 Thread Jason Wang
On Wed, Aug 24, 2022 at 3:47 PM Eugenio Perez Martin wrote: > > On Wed, Aug 24, 2022 at 6:23 AM Jason Wang wrote: > > > > > > 在 2022/8/20 01:13, Eugenio Pérez 写道: > > > Same way as with the MAC, restore the expected number of queues at > > > device's start. > > > > > > Signed-off-by: Eugenio Pére

Re: [PATCH v2 11/24] vhost-net: vhost-kernel: introduce vhost_net_virtqueue_stop()

2022-08-24 Thread Jason Wang
在 2022/8/24 11:33, Kangjie Xu 写道: 在 2022/8/24 10:40, Jason Wang 写道: 在 2022/8/16 09:06, Kangjie Xu 写道: Introduce vhost_virtqueue_stop(), which can reset the virtqueue in the device. Then it will unmap vrings and the desc of the virtqueue. This patch only considers the case for vhost-kernel,

[PATCH v3 3/3] util/aio-win32: Correct the event array size in aio_poll()

2022-08-24 Thread Bin Meng
From: Bin Meng WaitForMultipleObjects() can only wait for MAXIMUM_WAIT_OBJECTS object handles. Correct the event array size in aio_poll() and add a assert() to ensure it does not cause out of bound access. Signed-off-by: Bin Meng Reviewed-by: Stefan Weil Reviewed-by: Marc-André Lureau --- (n

Re: [PATCH v2 07/24] virtio-pci: support queue enable

2022-08-24 Thread Jason Wang
在 2022/8/23 16:20, Kangjie Xu 写道: 在 2022/8/23 15:44, Jason Wang 写道: 在 2022/8/16 09:06, Kangjie Xu 写道: PCI devices support vq enable. Nit: it might be "support device specific vq enable" Get it. Based on this function, the driver can re-enable the virtqueue after the virtqueue is r

Re: [PATCH v2 06/24] virtio-pci: support queue reset

2022-08-24 Thread Jason Wang
在 2022/8/23 15:52, Kangjie Xu 写道: 在 2022/8/23 15:40, Jason Wang 写道: 在 2022/8/16 09:06, Kangjie Xu 写道: From: Xuan Zhuo PCI devices support vq reset. Based on this function, the driver can adjust the size of the ring, and quickly recycle the buffer in the ring. The migration of the virtio

Re: [PATCH v2 18/24] vhost-net: vhost-user: update vhost_net_virtqueue_stop()

2022-08-24 Thread Jason Wang
在 2022/8/24 12:57, Kangjie Xu 写道: 在 2022/8/24 12:05, Jason Wang 写道: 在 2022/8/16 09:06, Kangjie Xu 写道: Update vhost_net_virtqueue_stop() for vhost-user scenario. Let's explain why it is needed now or why it doesn't cause any issue or it's a bug fix or not. Thanks This patch is to sup

Re: [PATCH v2 12/24] vhost-net: vhost-kernel: introduce vhost_net_virtqueue_restart()

2022-08-24 Thread Jason Wang
在 2022/8/24 10:53, Kangjie Xu 写道: 在 2022/8/24 10:44, Jason Wang 写道: 在 2022/8/16 09:06, Kangjie Xu 写道: Introduce vhost_net_virtqueue_restart(), which can restart the virtqueue when the vhost net started running before. If it fails to restart the virtqueue, the device will be stopped. This p

Re: [PATCH v2 12/24] vhost-net: vhost-kernel: introduce vhost_net_virtqueue_restart()

2022-08-24 Thread Kangjie Xu
在 2022/8/24 17:01, Jason Wang 写道: 在 2022/8/24 10:53, Kangjie Xu 写道: 在 2022/8/24 10:44, Jason Wang 写道: 在 2022/8/16 09:06, Kangjie Xu 写道: Introduce vhost_net_virtqueue_restart(), which can restart the virtqueue when the vhost net started running before. If it fails to restart the virtqueue,

Re: [PATCH 2/5] vdpa: Add vhost_vdpa_net_load_mq

2022-08-24 Thread Jason Wang
On Wed, Aug 24, 2022 at 5:06 PM Eugenio Perez Martin wrote: > > On Wed, Aug 24, 2022 at 10:52 AM Jason Wang wrote: > > > > On Wed, Aug 24, 2022 at 3:47 PM Eugenio Perez Martin > > wrote: > > > > > > On Wed, Aug 24, 2022 at 6:23 AM Jason Wang wrote: > > > > > > > > > > > > 在 2022/8/20 01:13, Eug

Re: [PATCH v2 15/24] vhost-user: add op to enable or disable a single vring

2022-08-24 Thread Jason Wang
在 2022/8/24 11:09, Kangjie Xu 写道: 在 2022/8/24 10:53, Jason Wang 写道: 在 2022/8/16 09:06, Kangjie Xu 写道: The interface to set enable status for a single vring is lacked in VhostOps, since the vhost_set_vring_enable_op will manipulate all virtqueues in a device. Resetting a single vq will rely

Re: [PATCH v2 18/24] vhost-net: vhost-user: update vhost_net_virtqueue_stop()

2022-08-24 Thread Kangjie Xu
在 2022/8/24 17:04, Jason Wang 写道: 在 2022/8/24 12:57, Kangjie Xu 写道: 在 2022/8/24 12:05, Jason Wang 写道: 在 2022/8/16 09:06, Kangjie Xu 写道: Update vhost_net_virtqueue_stop() for vhost-user scenario. Let's explain why it is needed now or why it doesn't cause any issue or it's a bug fix or

Re: [PATCH 2/5] vdpa: Add vhost_vdpa_net_load_mq

2022-08-24 Thread Eugenio Perez Martin
On Wed, Aug 24, 2022 at 11:08 AM Jason Wang wrote: > > On Wed, Aug 24, 2022 at 5:06 PM Eugenio Perez Martin > wrote: > > > > On Wed, Aug 24, 2022 at 10:52 AM Jason Wang wrote: > > > > > > On Wed, Aug 24, 2022 at 3:47 PM Eugenio Perez Martin > > > wrote: > > > > > > > > On Wed, Aug 24, 2022 at 6

Re: [PATCH 2/5] vdpa: Add vhost_vdpa_net_load_mq

2022-08-24 Thread Eugenio Perez Martin
On Wed, Aug 24, 2022 at 10:52 AM Jason Wang wrote: > > On Wed, Aug 24, 2022 at 3:47 PM Eugenio Perez Martin > wrote: > > > > On Wed, Aug 24, 2022 at 6:23 AM Jason Wang wrote: > > > > > > > > > 在 2022/8/20 01:13, Eugenio Pérez 写道: > > > > Same way as with the MAC, restore the expected number of q

[PULL v2 for 7.1 0/6] testing and doc updates

2022-08-24 Thread Alex Bennée
The following changes since commit a8cc5842b5cb863e46a2d009151c6ccbdecadaba: Merge tag 'for-upstream' of git://repo.or.cz/qemu/kevin into staging (2022-08-23 10:37:21 -0700) are available in the Git repository at: https://github.com/stsquad/qemu.git tags/pull-for-7.1-fixes-240822-3 for you

[PATCH v1 4/5] vhost-user-blk: make 'config_wce' part of 'host_features'

2022-08-24 Thread Daniil Tatianin
No reason to have this be a separate field. This also makes it more akin to what the virtio-blk device does. Signed-off-by: Daniil Tatianin --- hw/block/vhost-user-blk.c | 6 ++ include/hw/virtio/vhost-user-blk.h | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/

[PATCH v1 3/5] vhost-user-blk: make it possible to disable write-zeroes/discard

2022-08-24 Thread Daniil Tatianin
It is useful to have the ability to disable these features for compatibility with older VMs that don't have these implemented. Signed-off-by: Daniil Tatianin --- hw/block/vhost-user-blk.c | 8 ++-- include/hw/virtio/vhost-user-blk.h | 2 ++ 2 files changed, 8 insertions(+), 2 deleti

Re: [PATCH v2 15/24] vhost-user: add op to enable or disable a single vring

2022-08-24 Thread Kangjie Xu
在 2022/8/24 17:02, Jason Wang 写道: 在 2022/8/24 11:09, Kangjie Xu 写道: 在 2022/8/24 10:53, Jason Wang 写道: 在 2022/8/16 09:06, Kangjie Xu 写道: The interface to set enable status for a single vring is lacked in VhostOps, since the vhost_set_vring_enable_op will manipulate all virtqueues in a devi

Re: [PULL 1/6] tests/avocado: push default timeout to QemuBaseTest

2022-08-24 Thread Alex Bennée
Richard Henderson writes: > On 8/23/22 08:25, Alex Bennée wrote: >> All of the QEMU tests eventually end up derrived from this class. Move >> the default timeout from LinuxTest to ensure we catch them all. As 15 >> minutes is fairly excessive we drop the default down to 2 minutes >> which is a

[PATCH v1 5/5] vhost-user-blk: dynamically resize config space based on features

2022-08-24 Thread Daniil Tatianin
Make vhost-user-blk backwards compatible when migrating from older VMs running with modern features turned off, the same way it was done for virtio-blk in 20764be0421c ("virtio-blk: set config size depending on the features enabled") It's currently impossible to migrate from an older VM with vhos

[PATCH 03/51] block: Unify the get_tmp_filename() implementation

2022-08-24 Thread Bin Meng
From: Bin Meng At present get_tmp_filename() has platform specific implementations to get the directory to use for temporary files. Switch over to use g_get_tmp_dir() which works on all supported platforms. Signed-off-by: Bin Meng --- block.c | 16 ++-- 1 file changed, 2 insertion

[PATCH v1 0/5] vhost-user-blk: dynamically resize config space based on features

2022-08-24 Thread Daniil Tatianin
This patch set attempts to align vhost-user-blk with virtio-blk in terms of backward compatibility and flexibility. In particular it adds the following things: - Ability to disable modern features like discard/write-zeroes. - Dynamic configuration space resizing based on enabled features, by reu

[PATCH v1 2/5] virtio-blk: move config space sizing code to virtio-blk-common

2022-08-24 Thread Daniil Tatianin
This way we can reuse it for other virtio-blk devices, e.g vhost-user-blk, which currently does not control its config space size dynamically. Signed-off-by: Daniil Tatianin --- MAINTAINERS | 4 +++ hw/block/meson.build | 4 +-- hw/block/virtio-blk-co

[PATCH 01/51] tests/qtest: Use g_setenv()

2022-08-24 Thread Bin Meng
From: Bin Meng Windows does not provide a setenv() API, but glib does. Replace setenv() call with the glib version. Signed-off-by: Bin Meng --- tests/qtest/fuzz/generic_fuzz.c | 8 tests/qtest/libqtest.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/

[PATCH 10/51] hw/usb: dev-mtp: Use g_mkdir_with_parents()

2022-08-24 Thread Bin Meng
From: Bin Meng Use the same g_mkdir_with_parents() call to create a directory on all platforms. Signed-off-by: Bin Meng --- hw/usb/dev-mtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 5831395cef..97c894f231 100644 --- a/hw/usb

[PATCH v1 1/5] virtio-blk: decouple config size determination code from VirtIOBlock

2022-08-24 Thread Daniil Tatianin
Make it more stand-alone so that we can reuse it for other virtio-blk devices that are not VirtIOBlock in the future commits. Signed-off-by: Daniil Tatianin --- hw/block/virtio-blk.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/block/virtio-blk.c b/hw/block/vir

[PATCH 04/51] semihosting/arm-compat-semi: Avoid using hardcoded /tmp

2022-08-24 Thread Bin Meng
From: Bin Meng Use g_get_tmp_dir() to get the directory to use for temporary files. Signed-off-by: Bin Meng --- semihosting/arm-compat-semi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index e741674238..d

[PATCH 11/51] qga/commands-posix-ssh: Use g_mkdir_with_parents()

2022-08-24 Thread Bin Meng
From: Bin Meng g_mkdir() is a deprecated API and newer codes should use g_mkdir_with_parents(). Signed-off-by: Bin Meng --- qga/commands-posix-ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/commands-posix-ssh.c b/qga/commands-posix-ssh.c index f3a580b8cc..246011

[PATCH 00/51] tests/qtest: Enable running qtest on Windows

2022-08-24 Thread Bin Meng
In prepartion to adding virtio-9p support on Windows, this series enables running qtest on Windows, so that we can run the virtio-9p tests on Windows to make sure it does not break accidently. Patch 1-22 updates various components (mostly test cases) so that they can build on Windows with the same

[PATCH 18/51] tests/qtest: Build cases that use memory-backend-file for posix only

2022-08-24 Thread Bin Meng
From: Bin Meng As backends/meson.build tells us, hostmem-file.c is only supported on POSIX platforms, hence any test case that utilizes the memory backend file should be guarded by CONFIG_POSIX too. Signed-off-by: Bin Meng --- tests/qtest/bios-tables-test.c | 10 ++ tests/qtest/cxl-te

[PATCH 06/51] util/qemu-sockets: Use g_get_tmp_dir() to get the directory for temporary files

2022-08-24 Thread Bin Meng
From: Bin Meng Replace the existing logic to get the directory for temporary files with g_get_tmp_dir(), which works for win32 too. Signed-off-by: Bin Meng --- util/qemu-sockets.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/util/qemu-sockets.c b/util/qemu-sockets.

[PATCH 15/51] tests/qtest: Adapt {m48t59,rtc}-test cases for win32

2022-08-24 Thread Bin Meng
From: Bin Meng There is no tm_gmtoff member in 'struct tm' on Windows. Update rtc-test.c and m48t59-test.c accordingly. Signed-off-by: Bin Meng --- tests/qtest/m48t59-test.c | 2 +- tests/qtest/rtc-test.c| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qtest/m4

[PATCH 02/51] tests/qtest: Use g_mkdtemp()

2022-08-24 Thread Bin Meng
From: Bin Meng Windows does not provide a mkdtemp() API, but glib does. Replace mkdtemp() call with the glib version. Signed-off-by: Bin Meng --- tests/qtest/fuzz/generic_fuzz_configs.h | 2 +- tests/qtest/cdrom-test.c| 2 +- tests/qtest/cxl-test.c | 6 +++---

[PATCH 16/51] tests/qtest: Build e1000e-test for posix only

2022-08-24 Thread Bin Meng
From: Bin Meng The whole e1000e-test test case relies on socketpair() which does not exist on win32. Signed-off-by: Bin Meng --- tests/qtest/meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index be4b30dea2..9

[PATCH 32/51] tests/qtest: Fix ERROR_SHARING_VIOLATION for win32

2022-08-24 Thread Bin Meng
From: Bin Meng On Windows, the MinGW provided mkstemp() API opens the file with exclusive access, denying other processes to read/write the file. Such behavior prevents the QEMU executable from opening the file, (e.g.: CreateFile returns ERROR_SHARING_VIOLATION). This can be fixed by closing the

[PATCH 09/51] fsdev/virtfs-proxy-helper: Use g_mkdir_with_parents()

2022-08-24 Thread Bin Meng
From: Bin Meng Use the same g_mkdir_with_parents() call to create a directory on all platforms. Signed-off-by: Bin Meng --- fsdev/virtfs-proxy-helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c index 2dde27922

[PATCH 05/51] tcg: Avoid using hardcoded /tmp

2022-08-24 Thread Bin Meng
From: Bin Meng Use g_get_tmp_dir() to get the directory to use for temporary files. Signed-off-by: Bin Meng --- tcg/tcg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 0f9cfe96f2..932156a352 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -4729,1

[PATCH 19/51] tests/qtest: Build test-filter-{mirror, redirector} cases for posix only

2022-08-24 Thread Bin Meng
From: Bin Meng The test-filter-{mirror,redirector} cases use socketpair() API that is only available on POSIX and should only be built for POSIX. Signed-off-by: Bin Meng --- tests/qtest/meson.build | 28 ++-- 1 file changed, 18 insertions(+), 10 deletions(-) diff --gi

[PATCH 12/51] tests: Use g_mkdir_with_parents()

2022-08-24 Thread Bin Meng
From: Bin Meng Use the same g_mkdir_with_parents() call to create a directory on all platforms. Signed-off-by: Bin Meng --- tests/migration/stress.c | 2 +- tests/qtest/migration-test.c | 6 +++--- tests/unit/test-crypto-tlscredsx509.c | 4 ++-- tests/unit/test-crypto-tl

[PATCH 36/51] tests/qtest: machine-none-test: Use double quotes to pass the cpu option

2022-08-24 Thread Bin Meng
From: Bin Meng Single quotes in the arguments (e.g.: -cpu 'qemu64,apic-id=0') are not removed in the Windows environment before it is passed to the QEMU executable. Such argument causes a failure in the QEMU CPU option parser codes. Change to use double quotes which works fine on all platforms.

[PATCH 07/51] tests: Avoid using hardcoded /tmp in test cases

2022-08-24 Thread Bin Meng
From: Bin Meng Use g_get_tmp_dir() to get the directory to use for temporary files. Signed-off-by: Bin Meng --- tests/qtest/fuzz/generic_fuzz_configs.h | 6 -- tests/qtest/ahci-test.c | 15 +++ tests/qtest/aspeed_smc-test.c | 4 +++- tests/qtest/boo

[PATCH 20/51] tests/qtest: i440fx-test: Skip running request_{bios, pflash} for win32

2022-08-24 Thread Bin Meng
From: Bin Meng The request_{bios,pflash} test cases call mmap() which does not exist on win32. Exclude them. Signed-off-by: Bin Meng --- tests/qtest/i440fx-test.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tests/qtest/i440fx-test.c b/tests/qtest/i440fx-test.c index 6d7d4d8d8f..

[PATCH 13/51] tests/qtest: migration-test: Handle link() for win32

2022-08-24 Thread Bin Meng
From: Bin Meng Windows does not provide a link() API like POSIX. Instead it provides a similar API CreateHardLink() that does the same thing, but with different argument order and return value. Signed-off-by: Bin Meng --- tests/qtest/migration-test.c | 8 1 file changed, 8 insertions

[PATCH 37/51] tests/qtest: migration-test: Disable IO redirection for win32

2022-08-24 Thread Bin Meng
From: Bin Meng On Windows the QEMU executable is created via CreateProcess() and IO redirection does not work, so we need to set MigrateStart::hide_stderr to false to disable adding IO redirection to the command line. Signed-off-by: Bin Meng --- tests/qtest/migration-test.c | 39 +

[PATCH 08/51] block/vvfat: Unify the mkdir() call

2022-08-24 Thread Bin Meng
From: Bin Meng There is a difference in the mkdir() call for win32 and non-win32 platforms, and currently is handled in the codes with #ifdefs. glib provides a portable g_mkdir_with_parents() API and we can use it to unify the codes without #ifdefs. Signed-off-by: Bin Meng --- block/vvfat.c

[PATCH 25/51] tests/qtest: libqos: Rename malloc.h to libqos-malloc.h

2022-08-24 Thread Bin Meng
From: Xuzhou Cheng The qtest/libqos directory is included via the "-I" option to search for header files when building qtest. Unfortunately the malloc.h has a name conflict with the standard libc header, leading to a build failure on the Windows host, due to the MinGW libc stdlib.h header file in

[PATCH 14/51] backends/tpm: Exclude headers and macros that don't exist on win32

2022-08-24 Thread Bin Meng
From: Bin Meng These headers and macros do not exist on Windows. Exclude them. Signed-off-by: Bin Meng --- backends/tpm/tpm_ioctl.h | 4 1 file changed, 4 insertions(+) diff --git a/backends/tpm/tpm_ioctl.h b/backends/tpm/tpm_ioctl.h index bd6c12cb86..d67bf0283b 100644 --- a/backends/tp

[PATCH 40/51] chardev/char-file: Add FILE_SHARE_WRITE when openning the file for win32

2022-08-24 Thread Bin Meng
From: Xuzhou Cheng The combination of GENERIC_WRITE and FILE_SHARE_READ options does not allow the same file to be opened again by CreateFile() from another QEMU process with the same options when the previous QEMU process still holds the file handle openned. As per [1] we should add FILE_SHARE_

[PATCH 17/51] tests/qtest: Build virtio-net-test for posix only

2022-08-24 Thread Bin Meng
From: Bin Meng All of the virtio-net-test test cases require socketpair() to do the test setup. Signed-off-by: Bin Meng --- tests/qtest/virtio-net-test.c | 6 -- tests/qtest/meson.build | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/tests/qtest/virtio-net-tes

[PATCH 27/51] tests/qtest: Use send/recv for socket communication

2022-08-24 Thread Bin Meng
From: Xuzhou Cheng Socket communication in the libqtest and libqmp codes uses read() and write() which work on any file descriptor on *nix, and sockets in *nix are an example of a file descriptor. However sockets on Windows do not use *nix-style file descriptors, so read() and write() cannot be

[PATCH 41/51] tests/qtest: migration-test: Kill "to" after migration is canceled

2022-08-24 Thread Bin Meng
From: Xuzhou Cheng Make sure QEMU process "to" is killed before launching another target for migration in the test_multifd_tcp_cancel case. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng --- tests/qtest/migration-test.c | 4 1 file changed, 4 insertions(+) diff --git a/tests/qtest

[PATCH 23/51] accel/qtest: Support qtest accelerator for Windows

2022-08-24 Thread Bin Meng
From: Xuzhou Cheng Currently signal SIGIPI [=SIGUSR1] is used to kick the dummy CPU when qtest accelerator is used. However SIGUSR1 is unsupported on Windows. To support Windows, we add a QemuSemaphore CPUState::sem to kick the dummy CPU instead for Windows. Signed-off-by: Xuzhou Cheng Signed-o

[PATCH 21/51] tests/qtest: migration-test: Skip running test_migrate_fd_proto on win32

2022-08-24 Thread Bin Meng
From: Bin Meng The test case 'test_migrate_fd_proto' calls socketpair() which does not exist on win32. Exclude it. The helper function wait_command_fd() is not needed anymore, hence exclude it too. Signed-off-by: Bin Meng --- tests/qtest/migration-helpers.h | 2 ++ tests/qtest/migration-helpe

[PATCH 48/51] io/channel-watch: Drop a superfluous '#ifdef WIN32'

2022-08-24 Thread Bin Meng
From: Bin Meng In the win32 version qio_channel_create_socket_watch() body there is no need to do a '#ifdef WIN32'. Signed-off-by: Bin Meng --- io/channel-watch.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/io/channel-watch.c b/io/channel-watch.c index 0289b3647c..89f3c8a88a 100644 -

[PATCH 22/51] tests/qtest: qmp-test: Skip running test_qmp_oob for win32

2022-08-24 Thread Bin Meng
From: Bin Meng The test_qmp_oob test case calls mkfifo() which does not exist on win32. Exclude it. Signed-off-by: Bin Meng --- tests/qtest/qmp-test.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tests/qtest/qmp-test.c b/tests/qtest/qmp-test.c index b950dbafaf..4a165447f8 100644

[PATCH 28/51] tests/qtest: libqtest: Exclude the *_fds APIs for win32

2022-08-24 Thread Bin Meng
From: Bin Meng libqmp.c::qmp_fd_vsend_fds() is not available on Windows, hence any APIs in libqtest that call libqmp.c::qmp_fd_vsend_fds() should be excluded for win32 too. This includes the following: * qtest_qmp_vsend_fds() * qtest_vqmp_fds() * qtest_qmp_fds() * qtest_qmp_add_client()

[PATCH 26/51] tests/qtest: libqtest: Move global_qtest definition back to libqtest.c

2022-08-24 Thread Bin Meng
From: Xuzhou Cheng Commit dd2107497275 ("tests/libqtest: Use libqtest-single.h in tests that require global_qtest") moved global_qtest to libqtest-single.h, by declaring global_qtest attribute to be common and weak. This trick unfortunately does not work on Windows, and building qtest test case

Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-08-24 Thread Chao Peng
On Tue, Aug 23, 2022 at 04:05:27PM +, Sean Christopherson wrote: > On Tue, Aug 23, 2022, David Hildenbrand wrote: > > On 19.08.22 05:38, Hugh Dickins wrote: > > > On Fri, 19 Aug 2022, Sean Christopherson wrote: > > >> On Thu, Aug 18, 2022, Kirill A . Shutemov wrote: > > >>> On Wed, Aug 17, 2022

[PATCH 43/51] tests/qtest: npcm7xx_emc-test: Skip running test_{tx, rx} on win32

2022-08-24 Thread Bin Meng
From: Bin Meng The test cases 'test_{tx,rx}' call socketpair() which does not exist on win32. Exclude them. Signed-off-by: Bin Meng --- tests/qtest/npcm7xx_emc-test.c | 8 1 file changed, 8 insertions(+) diff --git a/tests/qtest/npcm7xx_emc-test.c b/tests/qtest/npcm7xx_emc-test.c in

[PATCH 24/51] tests/qtest: libqos: Drop inclusion of

2022-08-24 Thread Bin Meng
From: Xuzhou Cheng There is no in the Windows build environment. Actually this is not needed in the non-win32 builds too. Drop it. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng --- tests/qtest/libqos/libqos.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/qtest/libqos/libq

[PATCH 31/51] tests/qtest: Support libqtest to build and run on Windows

2022-08-24 Thread Bin Meng
From: Bin Meng At present the libqtest codes were written to depend on several POSIX APIs, including fork(), kill() and waitpid(). Unfortunately these APIs are not available on Windows. This commit implements the corresponding functionalities using win32 native APIs. With this change, all qtest

[PATCH v5 0/2] block: add missed block_acct_setup with new block device init procedure

2022-08-24 Thread Denis V. Lunev
Commit 5f76a7aac156ca75680dad5df4a385fd0b58f6b1 is looking harmless from the first glance, but it has changed things a lot. 'libvirt' uses it to detect that it should follow new initialization way and this changes things considerably. With this procedure followed, blockdev_init() is not called anym

[PATCH 29/51] tests/qtest: libqtest: Install signal handler via signal()

2022-08-24 Thread Bin Meng
From: Bin Meng At present the codes uses sigaction() to install signal handler with a flag SA_RESETHAND. Such usage can be covered by the signal() API that is a simplified interface to the general sigaction() facility. Update to use signal() to install the signal handler, as it is avaiable on Wi

[PATCH 49/51] io/channel-watch: Fix socket watch on Windows

2022-08-24 Thread Bin Meng
From: Bin Meng Random failure was observed when running qtests on Windows due to "Broken pipe" detected by qmp_fd_receive(). What happened is that the qtest executable sends testing data over a socket to the QEMU under test but no response is received. The errno of the recv() call from the qtest

Re: [PULL 1/6] tests/avocado: push default timeout to QemuBaseTest

2022-08-24 Thread Thomas Huth
On 24/08/2022 11.19, Alex Bennée wrote: Richard Henderson writes: On 8/23/22 08:25, Alex Bennée wrote: All of the QEMU tests eventually end up derrived from this class. Move the default timeout from LinuxTest to ensure we catch them all. As 15 minutes is fairly excessive we drop the default

[PATCH 50/51] .gitlab-ci.d/windows.yml: Increase the timeout to the runner limit

2022-08-24 Thread Bin Meng
From: Bin Meng commit 9f8e6cad65a6 ("gitlab-ci: Speed up the msys2-64bit job by using --without-default-devices" changed to compile QEMU with the --without-default-devices switch for the msys2-64bit job, due to the build could not complete within the project timeout (1h), and also mentioned that

[PATCH 30/51] tests: Skip iotests and qtest when '--without-default-devices'

2022-08-24 Thread Bin Meng
From: Bin Meng When QEMU is configured with '--without-default-devices', we should not build and run iotests and qtest because devices used by these test cases are not built in. Signed-off-by: Bin Meng --- tests/qemu-iotests/meson.build | 5 + tests/qtest/meson.build| 5 + 2 f

[PATCH 33/51] tests/qtest: {ahci, ide}-test: Use relative path for temporary files

2022-08-24 Thread Bin Meng
From: Bin Meng These test cases uses "blkdebug:path/to/config:path/to/image" for testing. On Windows, absolute file paths contain the delimiter ':' which causes the blkdebug filename parser fail to parse filenames. Signed-off-by: Bin Meng --- tests/qtest/ahci-test.c | 19 ---

Re: [PATCH v7 11/14] KVM: Register/unregister the guest private memory regions

2022-08-24 Thread Chao Peng
On Fri, Aug 19, 2022 at 12:37:42PM -0700, Vishal Annapurve wrote: > > ... > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > > index 230c8ff9659c..bb714c2a4b06 100644 > > --- a/virt/kvm/kvm_main.c > > +++ b/virt/kvm/kvm_main.c > > @@ -914,6 +914,35 @@ static int kvm_init_mmu_notifier(stru

[PATCH 51/51] docs/devel: testing: Document writing portable test cases

2022-08-24 Thread Bin Meng
From: Bin Meng Update the best practices of how to write portable test cases that can be built and run successfully on both Linux and Windows hosts. Signed-off-by: Bin Meng --- docs/devel/testing.rst | 30 ++ 1 file changed, 30 insertions(+) diff --git a/docs/deve

[PATCH 35/51] tests/qtest: device-plug-test: Reverse the usage of double/single quotes

2022-08-24 Thread Bin Meng
From: Bin Meng The usage of double/single quotes in test_pci_unplug_json_request() should be reversed to work on both win32 and non-win32 platforms: - The value of -device parameter needs to be surrounded by "" as Windows does not drop '' when passing it to QEMU which causes QEMU command lin

[PATCH 34/51] tests/qtest: bios-tables-test: Adapt the case for win32

2022-08-24 Thread Bin Meng
From: Bin Meng Single quotes in the arguments (oem_id='CRASH ') are not removed in the Windows environment before it is passed to the QEMU executable. The space in the argument causes the "-acpitable" option parser to think that all of its parameters are done, hence it complains: '-acpitable'

[PATCH 2/2] block: add missed block_acct_setup with new block device init procedure

2022-08-24 Thread Denis V. Lunev
Commit 5f76a7aac156ca75680dad5df4a385fd0b58f6b1 is looking harmless from the first glance, but it has changed things a lot. 'libvirt' uses it to detect that it should follow new initialization way and this changes things considerably. With this procedure followed, blockdev_init() is not called anym

[PATCH 38/51] tests/qtest: {ahci,ide}-test: Open file in binary mode

2022-08-24 Thread Bin Meng
From: Xuzhou Cheng By default Windows opens file in text mode, while a POSIX compliant implementation treats text files and binary files the same. The fopen() 'mode' string can include the letter 'b' to indicate binary mode shall be used. POSIX spec says the character 'b' shall have no effect, b

[PATCH 46/51] tests/qtest: libqtest: Replace the call to close a socket with closesocket()

2022-08-24 Thread Bin Meng
From: Bin Meng close() is a *nix function. It works on any file descriptor, and sockets in *nix are an example of a file descriptor. closesocket() is a Windows-specific function, which works only specifically with sockets. Sockets on Windows do not use *nix-style file descriptors, and socket() r

[PATCH 39/51] tests/qtest: virtio-net-failover: Disable migration tests for win32

2022-08-24 Thread Bin Meng
From: Xuzhou Cheng These tests use the exec migration protocol, which is unsupported on Windows as of today. Disable these tests for now. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng --- tests/qtest/virtio-net-failover.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) d

[PATCH 42/51] hw/ppc: spapr: Use qemu_vfree() to free spapr->htab

2022-08-24 Thread Bin Meng
From: Xuzhou Cheng spapr->htab is allocated by qemu_memalign(), hence we should use qemu_vfree() to free it. Fixes: c5f54f3e31bf ("pseries: Move hash page table allocation to reset time") Fixes: b4db54132ffe ("target/ppc: Implement H_REGISTER_PROCESS_TABLE H_CALL"") Signed-off-by: Xuzhou Cheng

Re: [PATCH v7 01/14] mm: Add F_SEAL_AUTO_ALLOCATE seal to memfd

2022-08-24 Thread Chao Peng
On Tue, Aug 23, 2022 at 09:36:57AM +0200, David Hildenbrand wrote: > On 18.08.22 01:41, Kirill A. Shutemov wrote: > > On Fri, Aug 05, 2022 at 07:55:38PM +0200, Paolo Bonzini wrote: > >> On 7/21/22 11:44, David Hildenbrand wrote: > >>> > >>> Also, I*think* you can place pages via userfaultfd into s

[PATCH 44/51] tests/qtest: microbit-test: Fix socket access for win32

2022-08-24 Thread Bin Meng
From: Bin Meng Sockets on Windows do not use *nix-style file descriptors, so write()/read()/close() do not work on Windows. Switch over to use send()/recv()/closesocket() which work with sockets on all platforms. Signed-off-by: Bin Meng --- tests/qtest/microbit-test.c | 10 +- 1 file

[PATCH 45/51] tests/qtest: prom-env-test: Use double quotes to pass the prom-env option

2022-08-24 Thread Bin Meng
From: Bin Meng Single quotes like -prom-env 'nvramrc=cafec0de 4000 l!' in the arguments are not removed in the Windows environment before it is passed to the QEMU executable. Such argument causes a failure in the QEMU prom-env option parser codes. Change to use double quotes which works fine on

[PATCH 47/51] tests/qtest: libqtest: Correct the timeout unit of blocking receive calls for win32

2022-08-24 Thread Bin Meng
From: Bin Meng Some qtest cases don't get response from the the QEMU executable under test in time on Windows. It turns out that the socket receive call got timeout before it receive the complete response. The timeout value is supposed to be set to 50 seconds via the setsockopt() call, but there

Re: [PATCH 4/4] hw/nvme: add MSI-x mask handlers for irqfd

2022-08-24 Thread Klaus Jensen
On Aug 23 22:43, Jinhao Fan wrote: > On 8/16/2022 6:46 PM, Klaus Jensen wrote: > > Did qtest work out for you for testing? If so, it would be nice to add a > > simple test case as well. > > Since MSI-x masking handlers are only implemented for IO queues, if we want > to use qtest we need to implem

Re: [PATCH 01/51] tests/qtest: Use g_setenv()

2022-08-24 Thread Thomas Huth
On 24/08/2022 11.39, Bin Meng wrote: From: Bin Meng Windows does not provide a setenv() API, but glib does. Replace setenv() call with the glib version. Signed-off-by: Bin Meng --- tests/qtest/fuzz/generic_fuzz.c | 8 tests/qtest/libqtest.c | 2 +- 2 files changed, 5 in

[PATCH 1/2] block: pass OnOffAuto instead of bool to block_acct_setup()

2022-08-24 Thread Denis V. Lunev
We would have one more place for block_acct_setup() calling, which should not corrupt original value. Signed-off-by: Denis V. Lunev Reviewed-by: Vladimir Sementsov-Ogievskiy CC: Peter Krempa CC: Markus Armbruster CC: John Snow CC: Kevin Wolf CC: Hanna Reitz --- block/accounting.c |

[RFC] hw/net/vmxnet3: allow VMXNET3_MAX_MTU itself as a value

2022-08-24 Thread Fiona Ebner
Fixes: d05dcd94ae ("net: vmxnet3: validate configuration values during activate (CVE-2021-20203)") Signed-off-by: Fiona Ebner --- I'm not familiar with this code, so really I'm asking: is the change justified? I tested the change and it seems to work, but I only have some rough rationale for it

Re: [PATCH v2 07/24] virtio-pci: support queue enable

2022-08-24 Thread Kangjie Xu
在 2022/8/24 16:59, Jason Wang 写道: 在 2022/8/23 16:20, Kangjie Xu 写道: 在 2022/8/23 15:44, Jason Wang 写道: 在 2022/8/16 09:06, Kangjie Xu 写道: PCI devices support vq enable. Nit: it might be "support device specific vq enable" Get it. Based on this function, the driver can re-enable the v

Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-08-24 Thread Chao Peng
On Sun, Aug 21, 2022 at 11:27:44AM +0100, Matthew Wilcox wrote: > On Thu, Aug 18, 2022 at 08:00:41PM -0700, Hugh Dickins wrote: > > tmpfs and hugetlbfs and page cache are designed around sharing memory: > > TDX is designed around absolutely not sharing memory; and the further > > uses which Sean fo

Re: [PATCH] virtiofsd: use g_date_time_get_microsecond to get subsecond

2022-08-24 Thread Dr. David Alan Gilbert
* Yusuke Okada (yokada@gmail.com) wrote: > From: Yusuke Okada > > The "%f" specifier in g_date_time_format() is only available in glib > 2.65.2 or later. If combined with older glib, the function returns null > and the timestamp displayed as "(null)". Well spotted; thanks for the patch. I no

  1   2   3   >