Introduce: Storage stability testing and DATA consistency verifying tools and system

2023-10-06 Thread 张友加
Dear All, I hope you are all well. I would like to introduce new tools I have developed, named "LBA tools" which including hd_write_verify & hd_write_verify_dump. github: https://github.com/zhangyoujia/hd_write_verify pdf: https://github.com/zhangyoujia/hd_write_verify/DISK stability

Re: [PATCH v2 22/53] migration/rdma: Drop dead qemu_rdma_data_init() code for !@host_port

2023-10-06 Thread Zhijian Li (Fujitsu)
On 28/09/2023 21:19, Markus Armbruster wrote: > qemu_rdma_data_init() neglects to set an Error when it fails because > @host_port is null. Fortunately, no caller passes null, so this is > merely a latent bug. Drop the flawed code handling null argument. > > Signed-off-by: Markus Armbruster

Re: [PATCH v2 16/53] migration/rdma: Fix or document problematic uses of errno

2023-10-06 Thread Zhijian Li (Fujitsu)
On 28/09/2023 21:19, Markus Armbruster wrote: > We use errno after calling Libibverbs functions that are not > documented to set errno (manual page does not mention errno), or where > the documentation is unclear ("returns [...] the value of errno on > failure"). While this could be read as

Re: [PATCH v2 53/53] migration/rdma: Replace flawed device detail dump by tracing

2023-10-06 Thread Zhijian Li (Fujitsu)
On 28/09/2023 21:20, Markus Armbruster wrote: > qemu_rdma_dump_id() dumps RDMA device details to stdout. > > rdma_start_outgoing_migration() calls it via qemu_rdma_source_init() > and qemu_rdma_resolve_host() to show source device details. > rdma_start_incoming_migration() arranges its call via

Re: [PATCH v2 52/53] migration/rdma: Use error_report() & friends instead of stderr

2023-10-06 Thread Zhijian Li (Fujitsu)
On 28/09/2023 21:20, Markus Armbruster wrote: > error_report() obeys -msg, reports the current error location if any, > and reports to the current monitor if any. Reporting to stderr > directly with fprintf() or perror() is wrong, because it loses all > this. > > Fix the offenders. Bonus:

Re: [PATCH v2 51/53] migration/rdma: Downgrade qemu_rdma_cleanup() errors to warnings

2023-10-06 Thread Zhijian Li (Fujitsu)
On 28/09/2023 21:20, Markus Armbruster wrote: > Functions that use an Error **errp parameter to return errors should > not also report them to the user, because reporting is the caller's > job. When the caller does, the error is reported twice. When it > doesn't (because it recovered from the

Re: [PATCH 39/52] migration/rdma: Convert qemu_rdma_write_one() to Error

2023-10-06 Thread Zhijian Li (Fujitsu)
+rdma-core Is global variable *errno* reliable when the documentation only states "returns 0 on success, or the value of errno on failure (which indicates the failure reason)." Someone read it as "assign error code to errno and return it.", I used to think the same way. but ibv_post_send()

Re: [PATCH v2 07/53] migration/rdma: Clean up two more harmless signed vs. unsigned issues

2023-10-06 Thread Zhijian Li (Fujitsu)
On 28/09/2023 21:19, Markus Armbruster wrote: > qemu_rdma_exchange_get_response() compares int parameter @expecting > with uint32_t head->type. Actual arguments are non-negative > enumeration constants, RDMAControlHeader uint32_t member type, or > qemu_rdma_exchange_recv() int parameter

Re: [Virtio-fs] (no subject)

2023-10-06 Thread Yajun Wu
On 10/6/2023 6:34 PM, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Fri, Oct 06, 2023 at 11:47:55AM +0200, Hanna Czenczek wrote: On 06.10.23 11:26, Michael S. Tsirkin wrote: On Fri, Oct 06, 2023 at 11:15:55AM +0200, Hanna Czenczek wrote: On 06.10.23

Re: [PATCH v2 06/53] migration/rdma: Fix unwanted integer truncation

2023-10-06 Thread Zhijian Li (Fujitsu)
On 28/09/2023 21:19, Markus Armbruster wrote: > qio_channel_rdma_readv() assigns the size_t value of qemu_rdma_fill() > to an int variable before it adds it to @done / subtracts it from > @want, both size_t. Truncation when qemu_rdma_fill() copies more than > INT_MAX bytes. Seems vanishingly

Introduce: Storage stability testing and DATA consistency verifying tools and system

2023-10-06 Thread 张友加
Dear All, I hope you are all well. I would like to introduce new tools I have developed, named "LBA tools" which including hd_write_verify & hd_write_verify_dump. github: https://github.com/zhangyoujia/hd_write_verify pdf: https://github.com/zhangyoujia/hd_write_verify/DISK stability

[PATCH v4] hw/cxl: Add QTG _DSM support for ACPI0017 device

2023-10-06 Thread Dave Jiang
Add a simple _DSM call support for the ACPI0017 device to return fake QTG ID values of 0 and 1 in all cases. This for _DSM plumbing testing from the OS. Following edited for readability Device (CXLM) { Name (_HID, "ACPI0017") // _HID: Hardware ID ... Method (_DSM, 4, Serialized) //

Re: [PATCH 2/3] hw/pci-host: Add emulation of Mai Logic Articia S

2023-10-06 Thread Volker Rümelin
Am 06.10.23 um 00:13 schrieb BALATON Zoltan: > The Articia S is a generic chipset supporting several different CPUs > that were used on some PPC boards. This is a minimal emulation of the > parts needed for emulating the AmigaOne board. > > Signed-off-by: BALATON Zoltan > --- >

Re: [PATCH 4/4] Python: Enable python3.12 support

2023-10-06 Thread John Snow
On Fri, Oct 6, 2023 at 4:40 PM Vladimir Sementsov-Ogievskiy wrote: > > On 06.10.23 22:52, John Snow wrote: > > Python 3.12 has released, so update the test infrastructure to test > > against this version. Update the configure script to look for it when an > > explicit Python interpreter isn't

Re: [Virtio-fs] (no subject)

2023-10-06 Thread Alex Bennée
Hanna Czenczek writes: > On 06.10.23 17:17, Alex Bennée wrote: >> Hanna Czenczek writes: >> >>> On 06.10.23 12:34, Michael S. Tsirkin wrote: On Fri, Oct 06, 2023 at 11:47:55AM +0200, Hanna Czenczek wrote: > On 06.10.23 11:26, Michael S. Tsirkin wrote: >> On Fri, Oct 06, 2023 at

Re: [PATCH 4/4] Python: Enable python3.12 support

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
On 06.10.23 23:39, Vladimir Sementsov-Ogievskiy wrote: On 06.10.23 22:52, John Snow wrote: Python 3.12 has released, so update the test infrastructure to test against this version. Update the configure script to look for it when an explicit Python interpreter isn't chosen. Signed-off-by: John

[PATCH] hw/display: fix memleak from virtio_add_resource

2023-10-06 Thread Matheus Tavares Bernardino
When the given uuid is already present in the hash table, virtio_add_resource() does not add the passed VirtioSharedObject. In this case, free it in the callers to avoid leaking memory. This fixed the following `make check` error, when built with --enable-sanitizers: 4/166 qemu:unit /

Re: [PATCH 4/4] Python: Enable python3.12 support

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
On 06.10.23 22:52, John Snow wrote: Python 3.12 has released, so update the test infrastructure to test against this version. Update the configure script to look for it when an explicit Python interpreter isn't chosen. Signed-off-by: John Snow --- configure | 3

Re: [PATCH 3/4] configure: fix error message to say Python 3.8

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
On 06.10.23 22:52, John Snow wrote: Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH 2/4] python/qmp: remove Server.wait_closed() call for Python 3.12

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
On 06.10.23 22:52, John Snow wrote: This patch is a backport from https://gitlab.com/qemu-project/python-qemu-qmp/-/commit/e03a3334b6a477beb09b293708632f2c06fe9f61 According to Guido in https://github.com/python/cpython/issues/104344 , this call was never meant to wait for the server to shut

[PATCH] hw/ppc: Add nest1 chiplet control scoms

2023-10-06 Thread Chalapathi V
-Create nest1 chiplet model and add nest1 chiplet control scoms. -Implementation of chiplet control scoms are put in pnv_pervasive.c as control scoms are common for all chiplets. Signed-off-by: Chalapathi V --- hw/ppc/meson.build| 2 + hw/ppc/pnv.c | 11

Re: [PATCH 1/4] Python/iotests: Add type hint for nbd module

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
On 06.10.23 22:52, John Snow wrote: The test bails gracefully if this module isn't installed, but linters need a little help understanding that. It's enough to just declare the type in this case. (Fixes pylint complaining about use of an uninitialized variable because it isn't wise enough to

[PATCH 2/4] qapi: introduce device-sync-config

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
Add command to sync config from vhost-user backend to the device. It may be helpful when VHOST_USER_SLAVE_CONFIG_CHANGE_MSG failed or not triggered interrupt to the guest or just not available (not supported by vhost-user server). Signed-off-by: Vladimir Sementsov-Ogievskiy ---

[PATCH 0/4] vhost-user-blk: live resize additional APIs

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
In vhost-user protocol we have VHOST_USER_BACKEND_CONFIG_CHANGE_MSG, which backend may send to notify Qemu, that we should re-read the config, and notify the guest. Still that's not always convenient: backend may not support this message. Also, having QMP command to force config sync is more

[PATCH 1/4] vhost-user-blk: simplify and fix vhost_user_blk_handle_config_change

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
Let's not care about what was changed and update the whole config, reasons: 1. config->geometry should be updated together with capacity, so we fix a bug. 2. Vhost-user protocol doesn't say anything about config change limitation. Silent ignore of changes doesn't seem to be correct. 3.

[PATCH 3/4] qapi: device-sync-config: check runstate

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
Command result is racy if allow it during migration. Let's allow the sync only in RUNNING state. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/sysemu/runstate.h | 1 + softmmu/qdev-monitor.c| 27 ++- softmmu/runstate.c| 5 + 3 files changed,

[PATCH 4/4] qapi: introduce CONFIG_READ event

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
Send a new event when guest reads virtio-pci config after virtio_notify_config() call. That's useful to check that guest fetched modified config, for example after resizing disk backend. Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/virtio/virtio-pci.c | 9 +

[PATCH 0/4] Python: Enable python3.12 support

2023-10-06 Thread John Snow
A few mostly trivial fixes, one backport from the qemu.qmp repo, and enabling the Python tests to run against Python3.12. John Snow (4): Python/iotests: Add type hint for nbd module python/qmp: remove Server.wait_closed() call for Python 3.12 configure: fix error message to say Python 3.8

[PATCH 1/4] Python/iotests: Add type hint for nbd module

2023-10-06 Thread John Snow
The test bails gracefully if this module isn't installed, but linters need a little help understanding that. It's enough to just declare the type in this case. (Fixes pylint complaining about use of an uninitialized variable because it isn't wise enough to understand the notrun call is noreturn.)

[PATCH 4/4] Python: Enable python3.12 support

2023-10-06 Thread John Snow
Python 3.12 has released, so update the test infrastructure to test against this version. Update the configure script to look for it when an explicit Python interpreter isn't chosen. Signed-off-by: John Snow --- configure | 3 ++- python/setup.cfg

[PATCH 2/4] python/qmp: remove Server.wait_closed() call for Python 3.12

2023-10-06 Thread John Snow
This patch is a backport from https://gitlab.com/qemu-project/python-qemu-qmp/-/commit/e03a3334b6a477beb09b293708632f2c06fe9f61 According to Guido in https://github.com/python/cpython/issues/104344 , this call was never meant to wait for the server to shut down - that is handled synchronously -

[PATCH 3/4] configure: fix error message to say Python 3.8

2023-10-06 Thread John Snow
Signed-off-by: John Snow --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index e08127045d..e9a921ffb0 100755 --- a/configure +++ b/configure @@ -944,7 +944,7 @@ then # If first_python is set, there was a binary somewhere even though

Re: [PATCH 15/19] parallels: Remove unnecessary data_end field

2023-10-06 Thread Mike Maslenkin
On Mon, Oct 2, 2023 at 12:01 PM Alexander Ivanov wrote: > > Since we have used bitmap, field data_end in BDRVParallelsState is > redundant and can be removed. > > Add parallels_data_end() helper and remove data_end handling. > > Signed-off-by: Alexander Ivanov > --- > block/parallels.c | 33

Re: [v3] Help wanted for enabling -Wshadow=local

2023-10-06 Thread Warner Losh
On Fri, Oct 6, 2023, 11:55 AM Thomas Huth wrote: > On 06/10/2023 18.18, Thomas Huth wrote: > > On 06/10/2023 16.45, Markus Armbruster wrote: > >> Local variables shadowing other local variables or parameters make the > >> code needlessly hard to understand. Bugs love to hide in such code. > >>

Re: [v3] Help wanted for enabling -Wshadow=local

2023-10-06 Thread Markus Armbruster
Markus Armbruster writes: > Local variables shadowing other local variables or parameters make the > code needlessly hard to understand. Bugs love to hide in such code. > Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to fail > on polling error". > > Enabling -Wshadow would

[Stable-8.1.2 53/57] vdpa net: zero vhost_vdpa iova_tree pointer at cleanup

2023-10-06 Thread Michael Tokarev
From: Eugenio Pérez Not zeroing it causes a SIGSEGV if the live migration is cancelled, at net device restart. This is caused because CVQ tries to reuse the iova_tree that is present in the first vhost_vdpa device at the end of vhost_vdpa_net_cvq_start. As a consequence, it tries to access an

[Stable-8.1.2 56/57] vdpa net: follow VirtIO initialization properly at cvq isolation probing

2023-10-06 Thread Michael Tokarev
From: Eugenio Pérez This patch solves a few issues. The most obvious is that the feature set was done previous to ACKNOWLEDGE | DRIVER status bit set. Current vdpa devices are permissive with this, but it is better to follow the standard. Fixes: 152128d646 ("vdpa: move CVQ isolation check to

[Stable-8.1.2 51/57] chardev/char-pty: Avoid losing bytes when the other side just (re-)connected

2023-10-06 Thread Michael Tokarev
From: Thomas Huth When starting a guest via libvirt with "virsh start --console ...", the first second of the console output is missing. This is especially annoying on s390x that only has a text console by default and no graphical output - if the bios fails to boot here, the information about

[Stable-8.1.2 54/57] vdpa net: fix error message setting virtio status

2023-10-06 Thread Michael Tokarev
From: Eugenio Pérez It incorrectly prints "error setting features", probably because a copy paste miss. Fixes: 152128d646 ("vdpa: move CVQ isolation check to net_init_vhost_vdpa") Reported-by: Peter Maydell Signed-off-by: Eugenio Pérez Message-Id:

[Stable-8.1.2 46/57] subprojects/berkeley-testfloat-3: Update to fix a problem with compiler warnings

2023-10-06 Thread Michael Tokarev
From: Thomas Huth Update the berkeley-testfloat-3 wrap to include a patch provided by Olaf Hering. This fixes a problem with "control reaches end of non-void function [-Werror=return-type]" compiler warning/errors that are now enabled by default in certain versions of GCC. Reported-by: Olaf

[Stable-8.1.2 50/57] hw/display/ramfb: plug slight guest-triggerable leak on mode setting

2023-10-06 Thread Michael Tokarev
From: Laszlo Ersek The fw_cfg DMA write callback in ramfb prepares a new display surface in QEMU; this new surface is put to use ("swapped in") upon the next display update. At that time, the old surface (if any) is released. If the guest triggers the fw_cfg DMA write callback at least twice

[Stable-8.1.2 57/57] amd_iommu: Fix APIC address check

2023-10-06 Thread Michael Tokarev
From: Akihiko Odaki An MSI from I/O APIC may not exactly equal to APIC_DEFAULT_ADDRESS. In fact, Windows 17763.3650 configures I/O APIC to set the dest_mode bit. Cover the range assigned to APIC. Fixes: 577c470f43 ("x86_iommu/amd: Prepare for interrupt remap support") Signed-off-by: Akihiko

[Stable-8.1.2 49/57] win32: avoid discarding the exception handler

2023-10-06 Thread Michael Tokarev
From: Marc-André Lureau In all likelihood, the compiler with lto doesn't see the function being used, from assembly macro __try1. Help it by marking the function has being used. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1904 Fixes: commit d89f30b4df ("win32: wrap socket close()

[Stable-8.1.2 52/57] linux-user/hppa: Fix struct target_sigcontext layout

2023-10-06 Thread Michael Tokarev
From: Richard Henderson Use abi_ullong not uint64_t so that the alignment of the field and therefore the layout of the struct is correct. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson (cherry picked from commit 33bc4fa78b06fc4e5fe22e5576811a97707e0cc6) Signed-off-by:

[Stable-8.1.2 48/57] target/i386: fix memory operand size for CVTPS2PD

2023-10-06 Thread Michael Tokarev
From: Paolo Bonzini CVTPS2PD only loads a half-register for memory, unlike the other operations under 0x0F 0x5A. "Unpack" the group into separate emission functions instead of using gen_unary_fp_sse. Signed-off-by: Paolo Bonzini (cherry picked from commit

[Stable-8.1.2 47/57] target/i386: generalize operand size "ph" for use in CVTPS2PD

2023-10-06 Thread Michael Tokarev
From: Paolo Bonzini CVTPS2PD only loads a half-register for memory, like CVTPH2PS. It can reuse the "ph" packed half-precision size to load a half-register, but rename it to "xh" because it is now a variation of "x" (it is not used only for half-precision values). Signed-off-by: Paolo Bonzini

[Stable-8.1.2 55/57] vdpa net: stop probing if cannot set features

2023-10-06 Thread Michael Tokarev
From: Eugenio Pérez Otherwise it continues the CVQ isolation probing. Fixes: 152128d646 ("vdpa: move CVQ isolation check to net_init_vhost_vdpa") Reported-by: Peter Maydell Signed-off-by: Eugenio Pérez Message-Id: <20230915170836.3078172-3-epere...@redhat.com> Tested-by: Lei Yang

[Stable-8.1.2 00/57] Patch Round-up for stable 8.1.2, freeze on 2023-10-14

2023-10-06 Thread Michael Tokarev
The following patches are queued for QEMU stable v8.1.2: https://gitlab.com/qemu-project/qemu/-/commits/staging-8.1 Patch freeze is 2023-10-14, and the release is planned for 2023-10-16: https://wiki.qemu.org/Planning/8.1 Please respond here or CC qemu-sta...@nongnu.org on any additional

Re: [PATCH v2 03/21] preallocate: Don't poll during permission updates

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
On 06.10.23 11:56, Kevin Wolf wrote: Am 05.10.2023 um 21:55 hat Vladimir Sementsov-Ogievskiy geschrieben: On 11.09.23 12:46, Kevin Wolf wrote: When the permission related BlockDriver callbacks are called, we are in the middle of an operation traversing the block graph. Polling in such a place

Re: [PATCH v4 01/15] hw/pci: Add a pci_setup_iommu_ops() helper

2023-10-06 Thread Joao Martins
On 06/10/2023 18:09, Cédric Le Goater wrote: >>> Getting acks from everyone will be difficultsince some PHBs are orphans. >> >> [...] This is what gets me a bit hesitant > > orphans shouldn't be an issue, nor the PPC emulated machines. We will see > what other maintainers have to say. How about

Re: [v3] Help wanted for enabling -Wshadow=local

2023-10-06 Thread Thomas Huth
On 06/10/2023 18.18, Thomas Huth wrote: On 06/10/2023 16.45, Markus Armbruster wrote: Local variables shadowing other local variables or parameters make the code needlessly hard to understand.  Bugs love to hide in such code. Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to

Re: [PATCH v3] hw/cxl: Add QTG _DSM support for ACPI0017 device

2023-10-06 Thread Dan Williams
Jonathan Cameron wrote: [..] > > > > > > > > what does "a WORD" mean is unclear - do you match what hardware does > > > > when you use aml_buffer? pls mention this in commit log, and > > > > show actual hardware dump for comparison. > > > The CXL spec says WORD without much qualification. It's

Re: [PATCH v7 14/15] scripts: add python_qmp_updater.py

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
On 06.10.23 20:01, Eric Blake wrote: On Fri, Oct 06, 2023 at 06:41:24PM +0300, Vladimir Sementsov-Ogievskiy wrote: A script, to update the pattern result = self.vm.qmp(...) self.assert_qmp(result, 'return', {}) (and some similar ones) into self.vm.cmd(...) Used in the next

[PATCH] contrib/vhost-user-gpu: Fix compiler warning when compiling with -Wshadow

2023-10-06 Thread Thomas Huth
Rename some variables to avoid compiler warnings when compiling with -Wshadow=local. Signed-off-by: Thomas Huth --- contrib/vhost-user-gpu/vugpu.h | 8 contrib/vhost-user-gpu/vhost-user-gpu.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git

Re: [PULL 00/21] vfio queue

2023-10-06 Thread Eric Auger
;>>>> >>>>>>     Merge tag 'for_upstream' of >>>>>> https://git.kernel.org/pub/scm/virt/kvm/mst/qemu into staging >>>>>> (2023-10-05 09:01:01 -0400) >>>>>> >>>>>> are available in the Git repository at: >>>&g

Re: [PATCH v2 1/2] migration: Fix rdma migration failed

2023-10-06 Thread Peter Xu
On Fri, Oct 06, 2023 at 11:52:10AM -0400, Peter Xu wrote: > On Tue, Oct 03, 2023 at 08:57:07PM +0200, Juan Quintela wrote: > > commit c638f66121ce30063fbf68c3eab4d7429cf2b209 > > Author: Juan Quintela > > Date: Tue Oct 3 20:53:38 2023 +0200 > > > > migration: Non multifd migration don't

Re: [PATCH v4 01/15] hw/pci: Add a pci_setup_iommu_ops() helper

2023-10-06 Thread Cédric Le Goater
Hello Joao, I think you should first convert all PHBs to PCIIOMMUOps to avoid all the tests as below and adapt pci_setup_iommu_ops() with the new parameter. OK, that's Yi's original patch: https://lore.kernel.org/all/20210302203827.437645-5-yi.l@intel.com/ I went with this one is that

Re: [PULL 00/21] vfio queue

2023-10-06 Thread Cédric Le Goater
2f3913f4b2ad74baeb5a6f1d36efbd9ecdf1057d:    Merge tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu into staging (2023-10-05 09:01:01 -0400) are available in the Git repository at:    https://github.com/legoater/qemu/ tags/pull-vfio-20231006 for you to fetch changes up

Re: [PATCH v7 15/15] python: use vm.cmd() instead of vm.qmp() where appropriate

2023-10-06 Thread Eric Blake
On Fri, Oct 06, 2023 at 06:41:25PM +0300, Vladimir Sementsov-Ogievskiy wrote: > In many cases we just want an effect of qmp command and want to raise > on failure. Use vm.cmd() method which does exactly this. > > The commit is generated by command > > git grep -l '\.qmp(' | xargs

Re: [PATCH v7 14/15] scripts: add python_qmp_updater.py

2023-10-06 Thread Eric Blake
On Fri, Oct 06, 2023 at 06:41:24PM +0300, Vladimir Sementsov-Ogievskiy wrote: > A script, to update the pattern > > result = self.vm.qmp(...) > self.assert_qmp(result, 'return', {}) > > (and some similar ones) into > > self.vm.cmd(...) > > Used in the next commit > "python: use

[PATCH] hw/virtio/virtio-gpu: Fix compiler warning when compiling with -Wshadow

2023-10-06 Thread Thomas Huth
Avoid using trivial variable names in macros, otherwise we get the following compiler warning when compiling with -Wshadow=local: In file included from ../../qemu/hw/display/virtio-gpu-virgl.c:19: ../../home/thuth/devel/qemu/hw/display/virtio-gpu-virgl.c: In function ‘virgl_cmd_submit_3d’:

Re: [PATCH v4 21/21] i386: Add new property to control L2 cache topo in CPUID.04H

2023-10-06 Thread Zhao Liu
Hi Michael, On Tue, Oct 03, 2023 at 08:57:27AM -0400, Michael S. Tsirkin wrote: > Date: Tue, 3 Oct 2023 08:57:27 -0400 > From: "Michael S. Tsirkin" > Subject: Re: [PATCH v4 21/21] i386: Add new property to control L2 cache > topo in CPUID.04H > > On Fri, Sep 15, 2023 at 03:53:25PM +0800, Zhao

Re: [v3] Help wanted for enabling -Wshadow=local

2023-10-06 Thread Thomas Huth
On 06/10/2023 16.45, Markus Armbruster wrote: Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Bugs love to hide in such code. Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to fail on polling error". Enabling -Wshadow

Re: [PATCH v11 00/10] migration: Modify 'migrate' and 'migrate-incoming' QAPI commands for migration

2023-10-06 Thread Het Gala
On 10/4/2023 7:33 PM, Fabiano Rosas wrote: Het Gala writes: On 04/10/23 7:03 pm, Fabiano Rosas wrote: Het Gala writes: This is v11 patchset of modified 'migrate' and 'migrate-incoming' QAPI design for upstream review. Update: Daniel has reviewed all patches and is okay with them. Markus

RE: [PATCH v2 3/3] target/hexagon: avoid shadowing globals

2023-10-06 Thread ltaylorsimpson
> -Original Message- > From: Brian Cain > Sent: Thursday, October 5, 2023 4:22 PM > To: qemu-devel@nongnu.org > Cc: bc...@quicinc.com; arm...@redhat.com; richard.hender...@linaro.org; > phi...@linaro.org; peter.mayd...@linaro.org; quic_mathb...@quicinc.com; > stefa...@redhat.com;

Re: [PATCH v3 0/4] block: clean up coroutine versions of bdrv_{is_allocated,block_status}*

2023-10-06 Thread Kevin Wolf
Am 04.09.2023 um 12:03 hat Paolo Bonzini geschrieben: > Provide coroutine versions of bdrv_is_allocated* and bdrv_block_status*, > since the underlying BlockDriver API is coroutine-based, and use > automatically-generated wrappers for the "mixed" versions. > > v2->v3: cleaned up formatting

Re: [PATCH v2 1/2] migration: Fix rdma migration failed

2023-10-06 Thread Peter Xu
On Tue, Oct 03, 2023 at 08:57:07PM +0200, Juan Quintela wrote: > commit c638f66121ce30063fbf68c3eab4d7429cf2b209 > Author: Juan Quintela > Date: Tue Oct 3 20:53:38 2023 +0200 > > migration: Non multifd migration don't care about multifd flushes > > RDMA was having trouble because

Re: [Virtio-fs] (no subject)

2023-10-06 Thread Hanna Czenczek
On 06.10.23 17:17, Alex Bennée wrote: Hanna Czenczek writes: On 06.10.23 12:34, Michael S. Tsirkin wrote: On Fri, Oct 06, 2023 at 11:47:55AM +0200, Hanna Czenczek wrote: On 06.10.23 11:26, Michael S. Tsirkin wrote: On Fri, Oct 06, 2023 at 11:15:55AM +0200, Hanna Czenczek wrote: On

[PATCH v7 13/15] tests/vm/basevm.py: use cmd() instead of qmp()

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
We don't expect failure here and need 'result' object. cmd() is better in this case. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- tests/vm/basevm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index

[PATCH v7 11/15] iotests: drop some extra ** in qmp() call

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
qmp() method supports passing dict (if it doesn't need substituting '_' to '-' in keys). So, drop some extra '**' operators. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- tests/qemu-iotests/040| 4 +- tests/qemu-iotests/041

[PATCH v7 09/15] iotests: refactor some common qmp result checks into generic pattern

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
To simplify further conversion. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- tests/qemu-iotests/040 | 3 ++- tests/qemu-iotests/147 | 3 ++- tests/qemu-iotests/155 | 4 ++-- tests/qemu-iotests/218 | 4 ++-- tests/qemu-iotests/296 | 3 ++- 5 files changed, 10

[PATCH v7 08/15] iotests: add some missed checks of qmp result

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- tests/qemu-iotests/041| 1 + tests/qemu-iotests/151| 1 + tests/qemu-iotests/152| 2 ++ tests/qemu-iotests/tests/migrate-bitmaps-test | 2 ++ 4 files

[PATCH v7 06/15] python/machine.py: upgrade vm.cmd() method

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
The method is not popular in iotests, we prefer use vm.qmp() and then check success by hand. But that's not optimal. To simplify movement to vm.cmd() let's support same interface improvements like in vm.qmp(). Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake ---

[PATCH v7 03/15] scripts/cpu-x86-uarch-abi.py: use .command() instead of .cmd()

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
Here we don't expect a failure. In case of failure we'll crash on trying to access ['return']. Better is to use .command() that clearly raises on failure. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- scripts/cpu-x86-uarch-abi.py | 12 ++-- 1 file changed, 6

[PATCH v7 05/15] python/qemu: rename command() to cmd()

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
Use a shorter name. We are going to move in iotests from qmp() to command() where possible. But command() is longer than qmp() and don't look better. Let's rename. You can simply grep for '\.command(' and for 'def command(' to check that everything is updated (command() in tests/docker/docker.py

[PATCH v7 14/15] scripts: add python_qmp_updater.py

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
A script, to update the pattern result = self.vm.qmp(...) self.assert_qmp(result, 'return', {}) (and some similar ones) into self.vm.cmd(...) Used in the next commit "python: use vm.cmd() instead of vm.qmp() where appropriate" Signed-off-by: Vladimir Sementsov-Ogievskiy ---

[PATCH v7 12/15] iotests.py: pause_job(): drop return value

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
The returned value is unused. It's simple to check by command git grep -B 3 '\.pause_job(' Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- tests/qemu-iotests/iotests.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/qemu-iotests/iotests.py

[PATCH v7 02/15] qmp_shell.py: _fill_completion() use .command() instead of .cmd()

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
We just want to ignore failure, so we don't need low level .cmd(). This helps further renaming .command() to .cmd(). Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- python/qemu/qmp/qmp_shell.py | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-)

[PATCH v7 07/15] iotests: QemuStorageDaemon: add cmd() method like in QEMUMachine.

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
Add similar method for consistency. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- tests/qemu-iotests/iotests.py | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index

[PATCH v7 10/15] iotests: drop some extra semicolons

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- tests/qemu-iotests/041 | 2 +- tests/qemu-iotests/196 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041 index 4d7a829b65..550e4dc391 100755 ---

[PATCH v7 00/15] iotests: use vm.cmd()

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
Hi all! Let's get rid of pattern result = self.vm.qmp(...) self.assert_qmp(result, 'return', {}) And switch to just self.vm.cmd(...) v7: add r-bs and small wording/grammar fixes by Eric 05: handle missed tests/avocado/machine_aspeed.py, keep r-bs 10: patch renamed:

[PATCH v7 01/15] python/qemu/qmp/legacy: cmd(): drop cmd_id unused argument

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
The argument is unused, let's drop it for now, as we are going to refactor the interface and don't want to refactor unused things. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- python/qemu/qmp/legacy.py | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff

[PATCH v7 04/15] python: rename QEMUMonitorProtocol.cmd() to cmd_raw()

2023-10-06 Thread Vladimir Sementsov-Ogievskiy
Having cmd() and command() methods in one class doesn't look good. Rename cmd() to cmd_raw(), to show its meaning better. We also want to rename command() to cmd() in future, so this commit is a necessary step. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake ---

Re: [Virtio-fs] (no subject)

2023-10-06 Thread Alex Bennée
Hanna Czenczek writes: > On 06.10.23 12:34, Michael S. Tsirkin wrote: >> On Fri, Oct 06, 2023 at 11:47:55AM +0200, Hanna Czenczek wrote: >>> On 06.10.23 11:26, Michael S. Tsirkin wrote: On Fri, Oct 06, 2023 at 11:15:55AM +0200, Hanna Czenczek wrote: > On 06.10.23 10:45, Michael S.

RE: [PATCH v2 2/3] target/hexagon: fix some occurrences of -Wshadow=local

2023-10-06 Thread ltaylorsimpson
> -Original Message- > From: Brian Cain > Sent: Thursday, October 5, 2023 4:22 PM > To: qemu-devel@nongnu.org > Cc: bc...@quicinc.com; arm...@redhat.com; richard.hender...@linaro.org; > phi...@linaro.org; peter.mayd...@linaro.org; quic_mathb...@quicinc.com; > stefa...@redhat.com;

[v3] Help wanted for enabling -Wshadow=local

2023-10-06 Thread Markus Armbruster
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Bugs love to hide in such code. Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to fail on polling error". Enabling -Wshadow would prevent bugs like this one. But we have to

Re: [PATCH 4/5] migration: Provide QMP access to downtime stats

2023-10-06 Thread Peter Xu
On Fri, Oct 06, 2023 at 12:37:15PM +0100, Joao Martins wrote: > I added the statistics mainly for observability (e.g. you would grep in the > libvirt logs for a non developer and they can understand how downtime is > explained). I wasn't specifically thinking about management app using this, >

Re: [Virtio-fs] [PATCH v4 2/8] vhost-user.rst: Improve [GS]ET_VRING_BASE doc

2023-10-06 Thread Hanna Czenczek
On 06.10.23 15:55, Hanna Czenczek wrote: On 06.10.23 10:49, Michael S. Tsirkin wrote: On Fri, Oct 06, 2023 at 09:53:53AM +0200, Hanna Czenczek wrote: On 05.10.23 19:38, Stefan Hajnoczi wrote: On Wed, Oct 04, 2023 at 02:58:58PM +0200, Hanna Czenczek wrote: [...]   

Re: [Virtio-fs] [PATCH v4 2/8] vhost-user.rst: Improve [GS]ET_VRING_BASE doc

2023-10-06 Thread Hanna Czenczek
On 06.10.23 10:49, Michael S. Tsirkin wrote: On Fri, Oct 06, 2023 at 09:53:53AM +0200, Hanna Czenczek wrote: On 05.10.23 19:38, Stefan Hajnoczi wrote: On Wed, Oct 04, 2023 at 02:58:58PM +0200, Hanna Czenczek wrote: GET_VRING_BASE does not mention that it stops the respective ring. Fix that.

[PATCH v2 07/10] target/riscv/tcg: add MISA user options hash

2023-10-06 Thread Daniel Henrique Barboza
We already track user choice for multi-letter extensions because we needed to honor user choice when enabling/disabling extensions during realize(). We refrained from adding the same mechanism for MISA extensions since we didn't need it. Profile support requires tne need to check for user choice

[PATCH v2 04/10] target/riscv/kvm: add 'rva22u64' flag as unavailable

2023-10-06 Thread Daniel Henrique Barboza
KVM does not have the means to support enabling the rva22u64 profile. The main reasons are: - we're missing support for some mandatory rva22u64 extensions in the KVM module; - we can't make promises about enabling a profile since it all depends on host support in the end. We'll revisit this

[PATCH v2 09/10] target/riscv/tcg: handle MISA bits on profile commit

2023-10-06 Thread Daniel Henrique Barboza
The profile support is handling multi-letter extensions only. Let's add support for MISA bits as well. We'll go through every known MISA bit. If the user set the bit, doesn't matter if to 'true' or 'false', ignore it. If the profile doesn't declare the bit as mandatory, ignore it. Otherwise, set

[PATCH v2 02/10] target/riscv/cpu.c: add zihpm extension flag

2023-10-06 Thread Daniel Henrique Barboza
zihpm is the Hardware Performance Counters extension described in chapter 12 of the unprivileged spec. It describes support for 29 unprivileged performance counters, hpmcounter3-hpmcounter21. As with zicntr, QEMU already implements zihpm before it was even an extension. zihpm is also part of the

[PATCH v2 05/10] target/riscv/tcg: add user flag for profile support

2023-10-06 Thread Daniel Henrique Barboza
The TCG emulation implements all the extensions described in the RVA22U64 profile, both mandatory and optional. The mandatory extensions will be enabled via the profile flag. We'll leave the optional extensions to be enabled by hand. Given that this is the first profile we're implementing in TCG

[PATCH v2 08/10] target/riscv/tcg: add riscv_cpu_write_misa_bit()

2023-10-06 Thread Daniel Henrique Barboza
We have two instances of the setting/clearing a MISA bit from env->misa_ext and env->misa_ext_mask pattern. And the next patch will end up adding one more. Create a helper to avoid code repetition. Signed-off-by: Daniel Henrique Barboza --- target/riscv/tcg/tcg-cpu.c | 44

[PATCH v2 00/10] riscv: RVA22U64 profile support

2023-10-06 Thread Daniel Henrique Barboza
Hi, Several design changes were made in this version after the reviews and feedback in the v1 [1]. The high-level summary is: - we'll no longer allow users to set profile flags for vendor CPUs. If we're to adhere to the current policy of not allowing users to enable extensions for vendor

[PATCH v2 03/10] target/riscv: add rva22u64 profile definition

2023-10-06 Thread Daniel Henrique Barboza
The rva22U64 profile, described in: https://github.com/riscv/riscv-profiles/blob/main/profiles.adoc#rva22-profiles Contains a set of CPU extensions aimed for 64-bit userspace applications. Enabling this set to be enabled via a single user flag makes it convenient to enable a predictable set of

[PATCH v2 06/10] target/riscv/tcg: commit profiles during realize()

2023-10-06 Thread Daniel Henrique Barboza
To 'commit' a profile means enabling/disabling all its mandatory extensions after taking into account individual user choice w.r.t MISA and multi-letter extensions. We'll handle multi-letter extennsions now - MISA extensions needs additional steps that we'll take care later.

[PATCH v2 10/10] target/riscv/tcg: add hash table insert helpers

2023-10-06 Thread Daniel Henrique Barboza
Latest patches added several g_hash_table_insert() patterns. Add two helpers, one for each user hash, to make the code cleaner. Signed-off-by: Daniel Henrique Barboza --- target/riscv/tcg/tcg-cpu.c | 29 + 1 file changed, 17 insertions(+), 12 deletions(-) diff --git

[PATCH v2 01/10] target/riscv/cpu.c: add zicntr extension flag

2023-10-06 Thread Daniel Henrique Barboza
zicntr is the Base Counters and Timers extension described in chapter 12 of the unprivileged spec. It describes support for RDCYCLE, RDTIME and RDINSTRET. QEMU already implements it way before it was a discrete extension. zicntr is part of the RVA22 profile, so let's add it to QEMU to make the

  1   2   3   4   >