Re: [PULL v2 00/82] pci,pc,virtio: features, tests, fixes, cleanups

2022-11-03 Thread Daniel P . Berrangé
On Thu, Nov 03, 2022 at 11:49:21AM -0400, Stefan Hajnoczi wrote: > gitlab-runner can run locally with minimal setup: > https://bagong.gitlab.io/posts/run-gitlab-ci-locally/ > > I haven't tried it yet, but that seems like the most reliable (and > easiest) way to reproduce the CI environment. IMHO

Re: [PATCH] gdb-xml: Fix size of EFER register on i386 architecture when debugged by GDB

2022-11-03 Thread Alex Bennée
TaiseiIto writes: > Before this commit, there were contradictory descriptions about size of EFER > register. > Line 113 says the size is 8 bytes. > Line 129 says the size is 4 bytes. > > As a result, when GDB is debugging an OS running on QEMU, the GDB cannot > read 'g' packets correctly. This

Re: [PATCH] tests/unit: simpler variable sequence for test-io-channel

2022-11-03 Thread Laurent Vivier
Le 03/11/2022 à 12:32, Alex Bennée a écrit : Laurent Vivier writes: Le 03/11/2022 à 11:23, Alex Bennée a écrit : This avoids some compilers complaining about a potentially un-initialised [src|dst]argv. In retrospect using GString was overkill for what we are constructing. Signed-off-by: Alex

[PATCH v3 01/17] migration: Remove res_compatible parameter

2022-11-03 Thread Avihai Horon
From: Juan Quintela It was only used for RAM, and in that case, it means that this amount of data was sent for memory. Just delete the field in all callers. Signed-off-by: Juan Quintela --- hw/s390x/s390-stattrib.c | 6 ++ hw/vfio/migration.c| 10 -- hw/vfio/tra

[PATCH v3 04/17] migration: Simplify migration_iteration_run()

2022-11-03 Thread Avihai Horon
From: Juan Quintela Signed-off-by: Juan Quintela Signed-off-by: Avihai Horon --- migration/migration.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index ffe868b86f..59cc3c309b 100644 --- a/migrati

[PATCH v3 05/17] vfio/migration: Fix wrong enum usage

2022-11-03 Thread Avihai Horon
vfio_migration_init() initializes VFIOMigration->device_state using enum of VFIO migration protocol v2. Current implemented protocol is v1 so v1 enum should be used. Fix it. Fixes: 429c72800654 ("vfio/migration: Fix incorrect initialization value for parameters in VFIOMigration") Signed-off-by: A

[PATCH v3 02/17] migration: No save_live_pending() method uses the QEMUFile parameter

2022-11-03 Thread Avihai Horon
From: Juan Quintela So remove it everywhere. Signed-off-by: Juan Quintela --- hw/s390x/s390-stattrib.c | 2 +- hw/vfio/migration.c| 6 ++ include/migration/register.h | 6 ++ migration/block-dirty-bitmap.c | 3 +-- migration/block.c | 2 +- migration/mi

[PATCH v3 00/17] vfio/migration: Implement VFIO migration protocol v2

2022-11-03 Thread Avihai Horon
Hello, A long time has passed since v2 of this series was posted. During this time we had several KVM calls discussing the problems that were needed to be solved in order to move forward. This version of the series includes quite some changes, and I believe that it addresses all the major problem

[PATCH v3 03/17] migration: Block migration comment or code is wrong

2022-11-03 Thread Avihai Horon
From: Juan Quintela And it appears that what is wrong is the code. During bulk stage we need to make sure that some block is dirty, but no games with max_size at all. Signed-off-by: Juan Quintela Reviewed-by: Stefan Hajnoczi --- migration/block.c | 4 ++-- 1 file changed, 2 insertions(+), 2 d

[PULL 00/10] Trivial branch for 7.2 patches

2022-11-03 Thread Laurent Vivier
ial-branch-for-7.2-pull-request for you to fetch changes up to 489db95896b86dacdde9dab1de84745880449e37: tests/unit: simpler variable sequence for test-io-channel (2022-11-03 17:16:34 +0100) Pull request trivial branc

[PATCH v3 06/17] vfio/migration: Fix NULL pointer dereference bug

2022-11-03 Thread Avihai Horon
As part of its error flow, vfio_vmstate_change() accesses MigrationState->to_dst_file without any checks. This can cause a NULL pointer dereference if the error flow is taken and MigrationState->to_dst_file is not set. For example, this can happen if VM is started or stopped not during migration a

[PATCH v3 07/17] vfio/migration: Allow migration without VFIO IOMMU dirty tracking support

2022-11-03 Thread Avihai Horon
Currently, if IOMMU of a VFIO container doesn't support dirty page tracking, migration is blocked. This is because a DMA-able VFIO device can dirty RAM pages without updating QEMU about it, thus breaking the migration. However, this doesn't mean that migration can't be done at all. In such case, a

[PATCH v3 10/17] vfio/migration: Move migration v1 logic to vfio_migration_init()

2022-11-03 Thread Avihai Horon
Move vfio_dev_get_region_info() logic from vfio_migration_probe() to vfio_migration_init(). This logic is specific to v1 protocol and moving it will make it easier to add the v2 protocol implementation later. No functional changes intended. Signed-off-by: Avihai Horon --- hw/vfio/migration.c |

[PULL 01/10] qapi: virtio: Fix the introduced version

2022-11-03 Thread Laurent Vivier
From: Han Han The items of qapi/virtio.json are introduced at a5ebce38576. They will be in the version 7.2 not 7.1. Signed-off-by: Han Han Reviewed-by: Laurent Vivier Message-Id: <20221101014647.3000801-1-h...@redhat.com> Signed-off-by: Laurent Vivier --- qapi/virtio.json | 34 ++

[PULL 07/10] target/m68k: Rename qregs.def -> qregs.h.inc

2022-11-03 Thread Laurent Vivier
From: Philippe Mathieu-Daudé We use the .h.inc extension to include C headers. To be consistent with the rest of the codebase, rename the C headers using the .def extension. IDE/tools using our .editorconfig / .gitattributes will leverage this consistency. Signed-off-by: Philippe Mathieu-Daudé

[PULL 10/10] tests/unit: simpler variable sequence for test-io-channel

2022-11-03 Thread Laurent Vivier
From: Alex Bennée This avoids some compilers complaining about a potentially un-initialised [src|dst]argv. In retrospect using GString was overkill for what we are constructing. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Laurent Vivier Message-Id: <20221103102

[PULL 02/10] Fix some typos in documentation and comments

2022-11-03 Thread Laurent Vivier
From: Stefan Weil Most of them were found and fixed using codespell. Signed-off-by: Stefan Weil Reviewed-by: Peter Maydell Reviewed-by: Thomas Huth Reviewed-by: Stefan Hajnoczi Message-Id: <20221030105944.311940-1...@weilnetz.de> Signed-off-by: Laurent Vivier --- docs/devel/testing.rst

[PULL 04/10] libvhost-user: Fix wrong type of argument to formatting function (reported by LGTM)

2022-11-03 Thread Laurent Vivier
From: Stefan Weil Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Stefan Weil Message-Id: <20220422070144.1043697-2...@weilnetz.de> Signed-off-by: Laurent Vivier --- subprojects/libvhost-user/libvhost-user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/li

[PATCH v3 09/17] vfio/common: Change vfio_devices_all_running_and_saving() logic to equivalent one

2022-11-03 Thread Avihai Horon
vfio_devices_all_running_and_saving() is used to check if migration is in pre-copy phase. This is done by checking if migration is in setup or active states and if all VFIO devices are in pre-copy state, i.e. _SAVING | _RUNNING. VFIO migration v2 protocol currently doesn't support pre-copy, so it

[PULL 09/10] target/tricore: Rename csfr.def -> csfr.h.inc

2022-11-03 Thread Laurent Vivier
From: Philippe Mathieu-Daudé We use the .h.inc extension to include C headers. To be consistent with the rest of the codebase, rename the C headers using the .def extension. IDE/tools using our .editorconfig / .gitattributes will leverage this consistency. Signed-off-by: Philippe Mathieu-Daudé

[PULL 06/10] libvhost-user: Add format attribute to local function vu_panic

2022-11-03 Thread Laurent Vivier
From: Stefan Weil Signed-off-by: Stefan Weil Reviewed-by: Marc-André Lureau Message-Id: <20220422070144.1043697-4...@weilnetz.de> Signed-off-by: Laurent Vivier --- subprojects/libvhost-user/libvhost-user.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/subpr

[PULL 08/10] target/s390x: Rename insn-data/format.def -> insn-data/format.h.inc

2022-11-03 Thread Laurent Vivier
From: Philippe Mathieu-Daudé We use the .h.inc extension to include C headers. To be consistent with the rest of the codebase, rename the C headers using the .def extension. IDE/tools using our .editorconfig / .gitattributes will leverage this consistency. Signed-off-by: Philippe Mathieu-Daudé

[PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2

2022-11-03 Thread Avihai Horon
Add implementation of VFIO migration protocol v2. The two protocols, v1 and v2, will co-exist and in next patch v1 protocol will be removed. There are several main differences between v1 and v2 protocols: - VFIO device state is now represented as a finite state machine instead of a bitmap. - Mi

[PULL 03/10] xen/pt: fix syntax error that causes FTBFS in some configurations

2022-11-03 Thread Laurent Vivier
From: Chuck Zmudzinski When Qemu is built with --enable-xen and --disable-xen-pci-passthrough and the target os is linux, the build fails with: meson.build:3477:2: ERROR: File xen_pt_stub.c does not exist. Fixes: 582ea95f5f93 ("meson: convert hw/xen") Signed-off-by: Chuck Zmudzinski Reviewed-

[PATCH v3 15/17] vfio: Alphabetize migration section of VFIO trace-events file

2022-11-03 Thread Avihai Horon
Sort the migration section of VFIO trace events file alphabetically and move two misplaced traces to common.c section. Signed-off-by: Avihai Horon --- hw/vfio/trace-events | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/vfio/trace-events b/hw/vfio/tr

[PATCH v3 11/17] vfio/migration: Rename functions/structs related to v1 protocol

2022-11-03 Thread Avihai Horon
To avoid name collisions, rename functions and structs related to VFIO migration protocol v1. This will allow the two protocols to co-exist when v2 protocol is added, until v1 is removed. No functional changes intended. Signed-off-by: Avihai Horon --- hw/vfio/common.c | 6 +-- hw/v

[PULL 05/10] libvhost-user: Fix format strings

2022-11-03 Thread Laurent Vivier
From: Stefan Weil Signed-off-by: Stefan Weil Reviewed-by: Marc-André Lureau Message-Id: <20220422070144.1043697-3...@weilnetz.de> Signed-off-by: Laurent Vivier --- subprojects/libvhost-user/libvhost-user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subprojects/lib

[PATCH v3 17/17] vfio/migration: Query device data size in vfio_save_pending()

2022-11-03 Thread Avihai Horon
Use VFIO_DEVICE_FEATURE_MIG_DATA_SIZE uAPI to query the device data size and report it in vfio_save_pending() instead of the hardcoded value that is currently used. Signed-off-by: Avihai Horon --- hw/vfio/migration.c| 27 --- linux-headers/linux/vfio.h | 13 ++

[PATCH v3 16/17] docs/devel: Align vfio-migration docs to VFIO migration v2

2022-11-03 Thread Avihai Horon
Align the vfio-migration documentation to VFIO migration protocol v2. Signed-off-by: Avihai Horon --- docs/devel/vfio-migration.rst | 68 --- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/docs/devel/vfio-migration.rst b/docs/devel/vfio-migration.

[PATCH v3 08/17] migration/qemu-file: Add qemu_file_get_to_fd()

2022-11-03 Thread Avihai Horon
Add new function qemu_file_get_to_fd() that allows reading data from QEMUFile and writing it straight into a given fd. This will be used later in VFIO migration code. Signed-off-by: Avihai Horon --- migration/qemu-file.c | 34 ++ migration/qemu-file.h | 1 + 2 f

[PATCH v3 13/17] vfio/migration: Remove VFIO migration protocol v1

2022-11-03 Thread Avihai Horon
Now that v2 protocol implementation has been added, remove the deprecated v1 implementation. Signed-off-by: Avihai Horon --- hw/vfio/common.c | 19 +- hw/vfio/migration.c | 697 +- hw/vfio/trace-events | 6 - include/hw/vfio/vfio

[PATCH v3 14/17] vfio/migration: Reset device if setting recover state fails

2022-11-03 Thread Avihai Horon
If vfio_migration_set_state() fails to set the device in the requested state it tries to put it in a recover state. If setting the device in the recover state fails as well, hw_error is triggered and the VM is aborted. To improve user experience and avoid VM data loss, reset the device with VFIO_R

Re: [PATCH 1/2] file-posix: fix Linux alignment probing when EIO is returned

2022-11-03 Thread Eric Biggers
On Thu, Nov 03, 2022 at 10:52:43AM +0100, Kevin Wolf wrote: > Am 02.11.2022 um 03:49 hat Eric Biggers geschrieben: > > On Tue, Nov 01, 2022 at 07:27:16PM -0700, Eric Biggers wrote: > > > On Tue, Nov 01, 2022 at 03:00:30PM -0400, Stefan Hajnoczi wrote: > > > > Linux dm-crypt returns errno EIO from u

Re: [PULL v2 00/82] pci,pc,virtio: features, tests, fixes, cleanups

2022-11-03 Thread Stefan Hajnoczi
On Thu, 3 Nov 2022 at 11:59, Daniel P. Berrangé wrote: > > On Thu, Nov 03, 2022 at 11:49:21AM -0400, Stefan Hajnoczi wrote: > > gitlab-runner can run locally with minimal setup: > > https://bagong.gitlab.io/posts/run-gitlab-ci-locally/ > > > > I haven't tried it yet, but that seems like the most r

Re: [PULL v2 00/82] pci,pc,virtio: features, tests, fixes, cleanups

2022-11-03 Thread Stefan Hajnoczi
On Thu, 3 Nov 2022 at 11:59, Michael S. Tsirkin wrote: > > On Thu, Nov 03, 2022 at 11:49:21AM -0400, Stefan Hajnoczi wrote: > > gitlab-runner can run locally with minimal setup: > > https://bagong.gitlab.io/posts/run-gitlab-ci-locally/ > > > > I haven't tried it yet, but that seems like the most r

Re: [PATCH v8 1/8] mm/memfd: Introduce userspace inaccessible memfd

2022-11-03 Thread Vishal Annapurve
On Mon, Oct 24, 2022 at 8:30 PM Kirill A . Shutemov wrote: > > On Fri, Oct 21, 2022 at 04:18:14PM +, Sean Christopherson wrote: > > On Fri, Oct 21, 2022, Chao Peng wrote: > > > > > > > > In the context of userspace inaccessible memfd, what would be a > > > > suggested way to enforce NUMA memor

Re: [PATCH v9 1/8] mm: Introduce memfd_restricted system call to create restricted user memory

2022-11-03 Thread Kirill A. Shutemov
On Wed, Nov 02, 2022 at 05:07:00PM -0500, Michael Roth wrote: > On Thu, Nov 03, 2022 at 12:14:04AM +0300, Kirill A. Shutemov wrote: > > On Mon, Oct 31, 2022 at 12:47:38PM -0500, Michael Roth wrote: > > > > > > In v8 there was some discussion about potentially passing the page/folio > > > and order

Re: [RFC PATCH] virtio: re-order vm_running and use_started checks

2022-11-03 Thread Michael S. Tsirkin
On Fri, Oct 14, 2022 at 02:21:08PM +0100, Alex Bennée wrote: > During migration the virtio device state can be restored before we > restart the VM. As no devices can be running while the VM is paused it > makes sense to bail out early in that case. > > This returns the order introduced in: > > 9

Re: [PATCH] migration: check magic value for deciding the mapping of channels

2022-11-03 Thread manish.mishra
On 03/11/22 2:59 pm, Daniel P. Berrangé wrote: On Thu, Nov 03, 2022 at 02:50:25PM +0530, manish.mishra wrote: On 01/11/22 9:15 pm, Daniel P. Berrangé wrote: On Tue, Nov 01, 2022 at 09:10:14PM +0530, manish.mishra wrote: On 01/11/22 8:21 pm, Daniel P. Berrangé wrote: On Tue, Nov 01, 2022 at 0

Re: [PATCH] virtio-blk: simplify virtio_blk_dma_restart_cb()

2022-11-03 Thread Emanuele Giuseppe Esposito
Am 02/11/2022 um 19:23 schrieb Stefan Hajnoczi: > virtio_blk_dma_restart_cb() is tricky because the BH must deal with > virtio_blk_data_plane_start()/virtio_blk_data_plane_stop() being called. > > There are two issues with the code: > > 1. virtio_blk_realize() should use qdev_add_vm_change_sta

Re: [PULL v2 00/82] pci,pc,virtio: features, tests, fixes, cleanups

2022-11-03 Thread Daniel P . Berrangé
On Thu, Nov 03, 2022 at 12:25:49PM -0400, Stefan Hajnoczi wrote: > On Thu, 3 Nov 2022 at 11:59, Daniel P. Berrangé wrote: > > > > On Thu, Nov 03, 2022 at 11:49:21AM -0400, Stefan Hajnoczi wrote: > > > gitlab-runner can run locally with minimal setup: > > > https://bagong.gitlab.io/posts/run-gitlab

Re: [PATCH v4 10/22] hw/virtio: move vm_running check to virtio_device_started

2022-11-03 Thread Michael S. Tsirkin
On Tue, Aug 02, 2022 at 10:49:58AM +0100, Alex Bennée wrote: > All the boilerplate virtio code does the same thing (or should at > least) of checking to see if the VM is running before attempting to > start VirtIO. Push the logic up to the common function to avoid > getting a copy and paste wrong.

Re: [PATCH v4 11/22] hw/virtio: move vhd->started check into helper and add FIXME

2022-11-03 Thread Michael S. Tsirkin
On Tue, Aug 02, 2022 at 10:49:59AM +0100, Alex Bennée wrote: > The `started` field is manipulated internally within the vhost code > except for one place, vhost-user-blk via f5b22d06fb (vhost: recheck > dev state in the vhost_migration_log routine). Mark that as a FIXME > because it introduces a po

Re: [PATCH v6 0/3] ppc/e500: Add support for eSDHC

2022-11-03 Thread Philippe Mathieu-Daudé
On 3/11/22 16:13, Daniel Henrique Barboza wrote: On 11/3/22 09:51, BALATON Zoltan wrote: On Wed, 2 Nov 2022, Daniel Henrique Barboza wrote: Queued in gitlab.com/danielhb/qemu/tree/ppc-8.0 (since we missed the freeze for 7.2). Could you please always use ppc-next to queue patches for the nex

Re: [PULL v2 00/82] pci,pc,virtio: features, tests, fixes, cleanups

2022-11-03 Thread Daniel P . Berrangé
On Thu, Nov 03, 2022 at 04:38:35PM +, Daniel P. Berrangé wrote: > On Thu, Nov 03, 2022 at 12:25:49PM -0400, Stefan Hajnoczi wrote: > > On Thu, 3 Nov 2022 at 11:59, Daniel P. Berrangé wrote: > > > > > > On Thu, Nov 03, 2022 at 11:49:21AM -0400, Stefan Hajnoczi wrote: > > > > gitlab-runner can r

Re: [PULL v2 00/82] pci,pc,virtio: features, tests, fixes, cleanups

2022-11-03 Thread Ani Sinha
On Thu, Nov 3, 2022 at 9:12 PM Ani Sinha wrote: > > > To pull this image: > > > $ docker pull registry.gitlab.com/qemu-project/qemu/fedora:latest > > Actually the URL is: > > $ docker pull registry.gitlab.com/qemu-project/qemu/qemu/fedora:latest > > > (or to be sure to pull the very same:) > > > $

Re: [PULL v2 00/82] pci,pc,virtio: features, tests, fixes, cleanups

2022-11-03 Thread Peter Maydell
On Thu, 3 Nov 2022 at 16:38, Daniel P. Berrangé wrote: > On Thu, Nov 03, 2022 at 12:25:49PM -0400, Stefan Hajnoczi wrote: > > 2. The GitLab output does not contain the full command lines because > > environment variables are hidden (e.g. $QEMU_CONFIGURE_OPTS). > > Note, $QEMU_CONFIGURE_OPTS is set

Re: [PULL v2 00/82] pci,pc,virtio: features, tests, fixes, cleanups

2022-11-03 Thread Ani Sinha
On Thu, Nov 3, 2022 at 10:17 PM Ani Sinha wrote: > > On Thu, Nov 3, 2022 at 9:12 PM Ani Sinha wrote: > > > > > To pull this image: > > > > > $ docker pull registry.gitlab.com/qemu-project/qemu/fedora:latest > > > > Actually the URL is: > > > > $ docker pull registry.gitlab.com/qemu-project/qemu/q

Re: [PULL v2 00/82] pci,pc,virtio: features, tests, fixes, cleanups

2022-11-03 Thread Daniel P . Berrangé
On Thu, Nov 03, 2022 at 04:47:03PM +, Peter Maydell wrote: > On Thu, 3 Nov 2022 at 16:38, Daniel P. Berrangé wrote: > > On Thu, Nov 03, 2022 at 12:25:49PM -0400, Stefan Hajnoczi wrote: > > > 2. The GitLab output does not contain the full command lines because > > > environment variables are hi

Re: [PATCH 1/2] file-posix: fix Linux alignment probing when EIO is returned

2022-11-03 Thread Eric Biggers
On Thu, Nov 03, 2022 at 04:26:14PM +, Eric Biggers wrote: > > In other words, STATX_DIOALIGN is unusable from the start because we > > don't know whether the information it returns is actually correct? :-/ > > That's a silly point of view. STATX_DIOALIGN has only been in a released > kernel

Re: [PATCH 2/9] block-copy: add missing coroutine_fn annotations

2022-11-03 Thread Paolo Bonzini
On 11/3/22 14:41, Emanuele Giuseppe Esposito wrote: block_copy_reset_unallocated and block_copy_is_cluster_allocated are only called by backup_run, a corotuine_fn itself. Same applies to block_copy_block_status, called by block_copy_dirty_clusters. Therefore mark them as coroutine too. Signed-

Re: [PULL v2 00/82] pci,pc,virtio: features, tests, fixes, cleanups

2022-11-03 Thread Ani Sinha
On Thu, Nov 3, 2022 at 10:18 PM Ani Sinha wrote: > > On Thu, Nov 3, 2022 at 10:17 PM Ani Sinha wrote: > > > > On Thu, Nov 3, 2022 at 9:12 PM Ani Sinha wrote: > > > > > > > To pull this image: > > > > > > > $ docker pull registry.gitlab.com/qemu-project/qemu/fedora:latest > > > > > > Actually the

Re: [PATCH 3/9] nbd/server.c: add missing coroutine_fn annotations

2022-11-03 Thread Paolo Bonzini
On 11/3/22 14:42, Emanuele Giuseppe Esposito wrote: There are probably more missing, but right now it is necessary that we extend coroutine_fn to block{allock/status}_to_extents, because they use bdrv_* functions calling the generated_co_wrapper API, which checks for the qemu_in_coroutine() case.

Re: [PATCH 6/9] block/vmdk: add missing coroutine_fn annotations

2022-11-03 Thread Paolo Bonzini
On 11/3/22 14:42, Emanuele Giuseppe Esposito wrote: vmdk_co_create_opts() is a coroutine_fn, and calls vmdk_co_do_create() which in turn can call two callbacks: vmdk_co_create_opts_cb and vmdk_co_create_cb. Mark all these functions as coroutine_fn, since vmdk_co_create_opts() is the only caller.

Re: [PATCH 7/9] block: bdrv_create_file is a coroutine_fn

2022-11-03 Thread Paolo Bonzini
On 11/3/22 14:42, Emanuele Giuseppe Esposito wrote: It is always called in coroutine_fn callbacks, therefore it can directly call bdrv_co_create(). Signed-off-by: Emanuele Giuseppe Esposito --- block.c| 6 -- include/block/block-global-state.h | 3 ++- 2 file

[PATCH v11 10/11] s390x/cpu_topology: activating CPU topology

2022-11-03 Thread Pierre Morel
The KVM capability, KVM_CAP_S390_CPU_TOPOLOGY is used to activate the S390_FEAT_CONFIGURATION_TOPOLOGY feature and the topology facility for the guest in the case the topology is available in QEMU and in KVM. Signed-off-by: Pierre Morel --- target/s390x/kvm/kvm.c | 16 1 file ch

[PATCH v11 03/11] s390x/cpu topology: core_id sets s390x CPU topology

2022-11-03 Thread Pierre Morel
In the S390x CPU topology the core_id specifies the CPU address and the position of the core withing the topology. Let's build the topology based on the core_id. Signed-off-by: Pierre Morel --- include/hw/s390x/cpu-topology.h| 41 ++ include/hw/s390x/s390-virtio-ccw.h | 1 + targ

[PATCH v11 06/11] s390x/cpu_topology: CPU topology migration

2022-11-03 Thread Pierre Morel
The migration can only take place if both source and destination of the migration both use or both do not use the CPU topology facility. We indicate a change in topology during migration postload for the case the topology changed between source and destination. Signed-off-by: Pierre Morel --- t

[PATCH v11 05/11] s390x/cpu_topology: resetting the Topology-Change-Report

2022-11-03 Thread Pierre Morel
During a subsystem reset the Topology-Change-Report is cleared by the machine. Let's ask KVM to clear the Modified Topology Change Report (MTCR) bit of the SCA in the case of a subsystem reset. Signed-off-by: Pierre Morel Reviewed-by: Nico Boehr Reviewed-by: Janis Schoetterl-Glausch --- targe

[PATCH v11 09/11] s390x/cpu topology: add topology machine property

2022-11-03 Thread Pierre Morel
We keep the possibility to switch on/off the topology on newer machines with the property topology=[on|off]. Signed-off-by: Pierre Morel --- include/hw/boards.h| 3 +++ include/hw/s390x/cpu-topology.h| 8 +++- include/hw/s390x/s390-virtio-ccw.h | 1 + hw/core/machine.c

[PATCH v11 02/11] s390x/cpu topology: add max_threads machine class attribute

2022-11-03 Thread Pierre Morel
The S390 CPU topology accepts the smp.threads argument while in reality it does not effectively allow multthreading. Let's keep this behavior for machines older than 7.3 and refuse to use threads in newer machines until multithreading is really proposed to the guest by the machine. Signed-off-by:

[PATCH v11 08/11] s390x/cpu topology: add topology_capable QEMU capability

2022-11-03 Thread Pierre Morel
S390 CPU topology is only allowed for s390-virtio-ccw-7.2 and newer S390 machines. Signed-off-by: Pierre Morel --- include/hw/s390x/s390-virtio-ccw.h | 1 + hw/s390x/s390-virtio-ccw.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/

[PATCH v11 00/11] s390x: CPU Topology

2022-11-03 Thread Pierre Morel
Hi, The implementation of the CPU Topology in QEMU has been drastically modified since the last patch series and the number of LOCs has been greatly reduced. 0) Two new patches in front of the series: - A preliminary patch to move the machine properties to the class_init routine - The

[PATCH v11 04/11] s390x/cpu topology: reporting the CPU topology to the guest

2022-11-03 Thread Pierre Morel
The guest can use the STSI instruction to get a buffer filled with the CPU topology description. Let us implement the STSI instruction for the basis CPU topology level, level 2. Signed-off-by: Pierre Morel --- include/hw/s390x/cpu-topology.h | 6 ++ target/s390x/cpu.h | 77 +

[PATCH v11 01/11] s390x: Register TYPE_S390_CCW_MACHINE properties as class properties

2022-11-03 Thread Pierre Morel
Signed-off-by: Pierre Morel --- hw/s390x/s390-virtio-ccw.c | 127 + 1 file changed, 72 insertions(+), 55 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 1cc20d8717..567498e780 100644 --- a/hw/s390x/s390-virtio-ccw.c +++

Re: [PULL v2 00/82] pci,pc,virtio: features, tests, fixes, cleanups

2022-11-03 Thread Stefan Hajnoczi
On Thu, Nov 3, 2022, 12:49 Daniel P. Berrangé wrote: > On Thu, Nov 03, 2022 at 04:47:03PM +, Peter Maydell wrote: > > On Thu, 3 Nov 2022 at 16:38, Daniel P. Berrangé > wrote: > > > On Thu, Nov 03, 2022 at 12:25:49PM -0400, Stefan Hajnoczi wrote: > > > > 2. The GitLab output does not contain

Re: [PATCH 8/9] block: bdrv_create is never called in non-coroutine context

2022-11-03 Thread Paolo Bonzini
On 11/3/22 14:42, Emanuele Giuseppe Esposito wrote: Delete the if case and make sure it won't be called again in coroutines. Signed-off-by: Emanuele Giuseppe Esposito --- block.c | 37 - 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/block

[PATCH v11 07/11] target/s390x: interception of PTF instruction

2022-11-03 Thread Pierre Morel
When the host supports the CPU topology facility, the PTF instruction with function code 2 is interpreted by the SIE, provided that the userland hypervizor activates the interpretation by using the KVM_CAP_S390_CPU_TOPOLOGY KVM extension. The PTF instructions with function code 0 and 1 are interce

Re: [PATCH 1/9] block: call bdrv_co_drain_begin in a coroutine

2022-11-03 Thread Paolo Bonzini
On 11/3/22 14:41, Emanuele Giuseppe Esposito wrote: -for (i = 0; i < bs->quiesce_counter; i++) { -if (drv->bdrv_co_drain_begin) { -drv->bdrv_co_drain_begin(bs); -} +if (drv->bdrv_co_drain_begin) { +co = qemu_coroutine_create(bdrv_co_drain_begin, &dco);

[PATCH v11 11/11] docs/s390x: document s390x cpu topology

2022-11-03 Thread Pierre Morel
Add some basic examples for the definition of cpu topology in s390x. Signed-off-by: Pierre Morel --- docs/system/s390x/cpu-topology.rst | 80 ++ 1 file changed, 80 insertions(+) create mode 100644 docs/system/s390x/cpu-topology.rst diff --git a/docs/system/s390x/cpu

Re: [PATCH v2] linux-user: implement execveat

2022-11-03 Thread Laurent Vivier
Le 03/11/2022 à 15:57, Drew DeVault a écrit : References: https://gitlab.com/qemu-project/qemu/-/issues/1007 Signed-off-by: Drew DeVault --- linux-user/syscall.c | 204 +++ 1 file changed, 111 insertions(+), 93 deletions(-) diff --git a/linux-user/sysc

Re: [PATCH for 7.2] Fix broken configure with -Wunused-parameter

2022-11-03 Thread Paolo Bonzini
On 11/3/22 09:58, Daniel P. Berrangé wrote: On Wed, Nov 02, 2022 at 09:22:58PM +0100, Stefan Weil via wrote: The configure script fails because it tries to compile small C programs with a main function which is declared with arguments argc and argv although those arguments are unused. Running `

Re: [PATCH v11 09/11] s390x/cpu topology: add topology machine property

2022-11-03 Thread Cornelia Huck
On Thu, Nov 03 2022, Pierre Morel wrote: > We keep the possibility to switch on/off the topology on newer > machines with the property topology=[on|off]. > > Signed-off-by: Pierre Morel > --- > include/hw/boards.h| 3 +++ > include/hw/s390x/cpu-topology.h| 8 +++- > in

[PATCH] meson: avoid unused arguments of main() in compiler tests

2022-11-03 Thread Paolo Bonzini
meson.build has one test where "main" is declared unnecessarily with argc and argv arguments, but does not use them. Because the test needs -Werror too, HAVE_BROKEN_SIZE_MAX is defined incorrectly. Fix the test and, for consistency, remove argc and argv whenever they are not needed. Signed-off-b

Re: [PATCH for 7.2] Fix broken configure with -Wunused-parameter

2022-11-03 Thread Paolo Bonzini
On 11/2/22 21:22, Stefan Weil via wrote: != "no"; then cat > $TMPC << EOF int main(int argc, char *argv[]) { +(void)argc; char arr[64], *p = arr, *c = argv[0]; You could use argv[argc - 1] instead. Paolo while (*c) { *p++ = *c++;

Re: [PATCH] migration: check magic value for deciding the mapping of channels

2022-11-03 Thread Daniel P . Berrangé
On Thu, Nov 03, 2022 at 10:04:54PM +0530, manish.mishra wrote: > > On 03/11/22 2:59 pm, Daniel P. Berrangé wrote: > > On Thu, Nov 03, 2022 at 02:50:25PM +0530, manish.mishra wrote: > > > On 01/11/22 9:15 pm, Daniel P. Berrangé wrote: > > > > On Tue, Nov 01, 2022 at 09:10:14PM +0530, manish.mishra

[PATCH 2/2] gitlab: show configure/make args before running

2022-11-03 Thread Daniel P . Berrangé
When debugging failed jobs it is helpful to see the full configure/make args used, without having to search the gitlab config file to figure it out. Signed-off-by: Daniel P. Berrangé --- .gitlab-ci.d/buildtest-template.yml | 4 .gitlab-ci.d/crossbuild-template.yml | 15 +++ 2

[PATCH 0/2] gitlab: improve debuggability of jobs

2022-11-03 Thread Daniel P . Berrangé
This ensures that the main configure/make commands run have their args echoed into the build logs. Daniel P. Berrangé (2): gitlab: remove redundant setting of PKG_CONFIG_PATH gitlab: show configure/make args before running .gitlab-ci.d/buildtest-template.yml | 4 .gitlab-ci.d/crossbui

[PATCH 1/2] gitlab: remove redundant setting of PKG_CONFIG_PATH

2022-11-03 Thread Daniel P . Berrangé
The PKG_CONFIG_PATH variable is not defined in GitLab CI envs and even if it was, we don't need to set it to its existing value. Signed-off-by: Daniel P. Berrangé --- .gitlab-ci.d/crossbuild-template.yml | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.d/cr

[PATCH v3] linux-user: implement execveat

2022-11-03 Thread Drew DeVault
References: https://gitlab.com/qemu-project/qemu/-/issues/1007 Signed-off-by: Drew DeVault --- v2 => v3: - Rebase to address the is_proc_myself fix - Drop the ifdefs linux-user/syscall.c | 203 ++- 1 file changed, 105 insertions(+), 98 deletions(-) diff -

Re: [PATCH] migration: check magic value for deciding the mapping of channels

2022-11-03 Thread manish.mishra
On 03/11/22 10:57 pm, Daniel P. Berrangé wrote: On Thu, Nov 03, 2022 at 10:04:54PM +0530, manish.mishra wrote: On 03/11/22 2:59 pm, Daniel P. Berrangé wrote: On Thu, Nov 03, 2022 at 02:50:25PM +0530, manish.mishra wrote: On 01/11/22 9:15 pm, Daniel P. Berrangé wrote: On Tue, Nov 01, 2022 at

Re: [PULL v2 00/82] pci,pc,virtio: features, tests, fixes, cleanups

2022-11-03 Thread Daniel P . Berrangé
On Thu, Nov 03, 2022 at 10:26:26PM +0530, Ani Sinha wrote: > On Thu, Nov 3, 2022 at 10:18 PM Ani Sinha wrote: > > > > On Thu, Nov 3, 2022 at 10:17 PM Ani Sinha wrote: > > > > > > On Thu, Nov 3, 2022 at 9:12 PM Ani Sinha wrote: > > > > > > > > > To pull this image: > > > > > > > > > $ docker pull

Re: [PULL v2 00/82] pci,pc,virtio: features, tests, fixes, cleanups

2022-11-03 Thread Ani Sinha
On Thu, Nov 3, 2022 at 23:11 Daniel P. Berrangé wrote: > On Thu, Nov 03, 2022 at 10:26:26PM +0530, Ani Sinha wrote: > > On Thu, Nov 3, 2022 at 10:18 PM Ani Sinha wrote: > > > > > > On Thu, Nov 3, 2022 at 10:17 PM Ani Sinha wrote: > > > > > > > > On Thu, Nov 3, 2022 at 9:12 PM Ani Sinha wrote:

Re: [PATCH 1/2] file-posix: fix Linux alignment probing when EIO is returned

2022-11-03 Thread Stefan Hajnoczi
On Thu, Nov 03, 2022 at 04:54:09PM +, Eric Biggers wrote: > On Thu, Nov 03, 2022 at 04:26:14PM +, Eric Biggers wrote: > > > In other words, STATX_DIOALIGN is unusable from the start because we > > > don't know whether the information it returns is actually correct? :-/ > > > > That's a sil

Re: [PATCH] migration: check magic value for deciding the mapping of channels

2022-11-03 Thread Daniel P . Berrangé
On Thu, Nov 03, 2022 at 11:06:23PM +0530, manish.mishra wrote: > > On 03/11/22 10:57 pm, Daniel P. Berrangé wrote: > > On Thu, Nov 03, 2022 at 10:04:54PM +0530, manish.mishra wrote: > > > On 03/11/22 2:59 pm, Daniel P. Berrangé wrote: > > > > On Thu, Nov 03, 2022 at 02:50:25PM +0530, manish.mishra

Re: [PATCH 2/9] block-copy: add missing coroutine_fn annotations

2022-11-03 Thread Kevin Wolf
Am 03.11.2022 um 17:56 hat Paolo Bonzini geschrieben: > On 11/3/22 14:41, Emanuele Giuseppe Esposito wrote: > > block_copy_reset_unallocated and block_copy_is_cluster_allocated are > > only called by backup_run, a corotuine_fn itself. s/corotuine_fn/coroutine_fn/ > > > > Same applies to block_co

Re: [PATCH 1/2] hw/cxl: set cxl-type3 device type to PCI_CLASS_MEMORY_CXL

2022-11-03 Thread Jonathan Cameron via
On Wed, 26 Oct 2022 17:07:53 -0400 Gregory Price wrote: > On Wed, Oct 26, 2022 at 04:11:29PM -0400, Michael S. Tsirkin wrote: > > He does but in the end he sends patches not pull requests. > > I don't care really as long as someone will send it up. > > > > Jonathan will submit this, it's not

Re: [PATCH v2 1/2] hw/i386/postcard.c: New ISA POST card device

2022-11-03 Thread Paolo Bonzini
On 7/7/22 02:37, Lev Kujawski wrote: @@ -1139,12 +1120,10 @@ void pc_basic_device_init(struct PCMachineState *pcms, qemu_irq pit_alt_irq = NULL; qemu_irq rtc_irq = NULL; ISADevice *pit = NULL; -MemoryRegion *ioport80_io = g_new(MemoryRegion, 1); MemoryRegion *ioportF0_io =

Re: [PATCH] migration: check magic value for deciding the mapping of channels

2022-11-03 Thread manish.mishra
On 03/11/22 11:27 pm, Daniel P. Berrangé wrote: On Thu, Nov 03, 2022 at 11:06:23PM +0530, manish.mishra wrote: On 03/11/22 10:57 pm, Daniel P. Berrangé wrote: On Thu, Nov 03, 2022 at 10:04:54PM +0530, manish.mishra wrote: On 03/11/22 2:59 pm, Daniel P. Berrangé wrote: On Thu, Nov 03, 2022 a

Re: [PULL 0/7] loongarch-to-apply queue

2022-11-03 Thread Stefan Hajnoczi
The cross-win32-system GitLab CI job fails to build with the following error: i686-w64-mingw32-gcc -m32 -Ilibqemu-loongarch64-softmmu.fa.p -I. -I.. -Itarget/loongarch -I../target/loongarch -I../dtc/libfdt -Iqapi -Itrace -Iui -Iui/shader -I/usr/i686-w64-mingw32/sys-root/mingw/include/pixman-1 -I/us

[PATCH v2 0/2] file-posix: alignment probing improvements

2022-11-03 Thread Stefan Hajnoczi
v2: - Make sure that XFS_IOC_DIOINFO takes priority over logical blocksize [Eric Biggers] - Included a link to Eric's linux-block regression email These patches fix alignment probing with dm-crypt and add support for the new Linux statx(STATX_DIOALIGN) interface. Given that Linux v6.0 kernels wi

[PATCH v2 2/2] file-posix: add statx(STATX_DIOALIGN) support

2022-11-03 Thread Stefan Hajnoczi
Linux v6.1 commit 825cf206ed51 ("statx: add direct I/O alignment information") added an interface to fetch O_DIRECT alignment values for block devices and file systems. Prefer STATX_DIOALIGN to older interfaces and probing, but keep them as fallbacks in case STATX_DIOALIGN cannot provide the infor

[PATCH v2 1/2] file-posix: fix Linux alignment probing when EIO is returned

2022-11-03 Thread Stefan Hajnoczi
Linux v6.0 dm-crypt returns errno EIO from unaligned O_DIRECT pread(2) calls. Alignment probing fails on dm-crypt devices because the code expects EINVAL. This is a kernel regression that is expected to be fixed upstream: https://lore.kernel.org/linux-block/20221103193837.3b5b4...@xps.demsh.org/T/#

Re: [PATCH 2/9] block-copy: add missing coroutine_fn annotations

2022-11-03 Thread Paolo Bonzini
On 11/3/22 19:06, Kevin Wolf wrote: I think it can make sense to have coroutine_fn as a documentation for things that are only ever called in a coroutine even if they could theoretically also work outside of coroutine context. Otherwise, when we want to introduce a coroutine_fn call somewhere, i

Re: [PATCH] gdb-xml: Fix size of EFER register on i386 architecture when debugged by GDB

2022-11-03 Thread Paolo Bonzini
On 9/13/22 14:06, TaiseiIto wrote: Before this commit, there were contradictory descriptions about size of EFER register. Line 113 says the size is 8 bytes. Line 129 says the size is 4 bytes. As a result, when GDB is debugging an OS running on QEMU, the GDB cannot read 'g' packets correctly. Thi

Re: [PATCH v3] target/i386: Fix calculation of LOCK NEG eflags

2022-11-03 Thread Paolo Bonzini
On 11/3/22 12:22, Qi Hu wrote: ping On 2022/10/24 16:41, Qi Hu wrote: In sequence: --- lock negl -0x14(%rbp) pushf pop    %rax --- %rax will obtain the wrong value becasue the "lock neg" calculates the wrong eflags. The "s->T0" is updated by the wrong value. You can use this to do some test:

Re: [PATCH] Add missing include statement for global xml_builtin

2022-11-03 Thread Paolo Bonzini
Queued, thanks. Paolo

Re: [PATCH] migration: check magic value for deciding the mapping of channels

2022-11-03 Thread manish.mishra
On 03/11/22 11:47 pm, manish.mishra wrote: On 03/11/22 11:27 pm, Daniel P. Berrangé wrote: On Thu, Nov 03, 2022 at 11:06:23PM +0530, manish.mishra wrote: On 03/11/22 10:57 pm, Daniel P. Berrangé wrote: On Thu, Nov 03, 2022 at 10:04:54PM +0530, manish.mishra wrote: On 03/11/22 2:59 pm, Dani

Re: [PATCH] migration: check magic value for deciding the mapping of channels

2022-11-03 Thread manish.mishra
On 03/11/22 11:47 pm, manish.mishra wrote: On 03/11/22 11:27 pm, Daniel P. Berrangé wrote: On Thu, Nov 03, 2022 at 11:06:23PM +0530, manish.mishra wrote: On 03/11/22 10:57 pm, Daniel P. Berrangé wrote: On Thu, Nov 03, 2022 at 10:04:54PM +0530, manish.mishra wrote: On 03/11/22 2:59 pm, Dani

Re: [PATCH 1/2] gitlab: remove redundant setting of PKG_CONFIG_PATH

2022-11-03 Thread Stefan Hajnoczi
On Thu, 3 Nov 2022 at 13:30, Daniel P. Berrangé wrote: > > The PKG_CONFIG_PATH variable is not defined in GitLab CI > envs and even if it was, we don't need to set it to its > existing value. > > Signed-off-by: Daniel P. Berrangé > --- > .gitlab-ci.d/crossbuild-template.yml | 9 +++-- > 1 fi

<    1   2   3   >