Re: [PATCH 6/8] virtio-blk: remove unnecessary AioContext lock from function already safe

2022-11-11 Thread Emanuele Giuseppe Esposito
Am 08/11/2022 um 22:19 schrieb Stefan Hajnoczi: > From: Emanuele Giuseppe Esposito > > AioContext lock was introduced in b9e413dd375 and in this instance > it is used to protect these 3 functions: > - virtio_blk_handle_rw_error > - virtio_blk_req_complete > - block_acct_done > > Now that all th

Re: [PATCH v3 1/2] vhost-user: Refactor vhost acked features saving

2022-11-11 Thread Hyman Huang
在 2022/11/11 2:56, Michael S. Tsirkin 写道: On Sun, Oct 30, 2022 at 09:52:38PM +0800, huang...@chinatelecom.cn wrote: From: Hyman Huang(黄勇) Abstract vhost acked features saving into vhost_user_save_acked_features, export it as util function. Signed-off-by: Hyman Huang(黄勇) Signed-off-by: Guo

[PATCH v2] acpi/tests/avocado/bits: some misc fixes

2022-11-11 Thread Ani Sinha
Most of the changes are trivial. The bits test timeout has now been increased to 110 seconds in order to accommodate slower systems and fewer unnecessary failures. Removed of the reference to non-existent README file in docs. CC: Thomas Huth CC: qemu-triv...@nongnu.org Signed-off-by: Ani Sinha -

Re: [PATCH v3 2/2] hw/nvme: cleanup error reporting in nvme_init_pci()

2022-11-11 Thread Klaus Jensen
On Nov 11 12:40, Philippe Mathieu-Daudé wrote: > On 10/11/22 23:08, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Replace the local Error variable with errp and ERRP_GUARD() and change > > the return value to bool. > > > > Signed-off-by: Klaus Jensen > > --- > > hw/nvme/ctrl.c | 23 +

Re: should ioapic_service really be modelling cpu writes?

2022-11-11 Thread Alex Bennée
Peter Xu writes: > Hi, Alex, > > On Thu, Nov 10, 2022 at 05:55:51PM +, Alex Bennée wrote: >> >> Alex Bennée writes: >> >> > Hi, >> > >> > I've been trying to remove current_cpu hacks from our hw/ emulation and >> > replace them with an explicit cpu_index derived from MemTxAttrs. So far >

Re: [PATCH 7/8] virtio-blk: don't acquire AioContext in virtio_blk_handle_vq()

2022-11-11 Thread Emanuele Giuseppe Esposito
Am 08/11/2022 um 22:19 schrieb Stefan Hajnoczi: > There is no need to acquire AioContext in virtio_blk_handle_vq() because > no APIs used in the function require it and nothing else in the > virtio-blk code requires mutual exclusion anymore. > > Signed-off-by: Stefan Hajnoczi > --- > hw/block

Re: [PATCH 8/8] virtio-blk: minimize virtio_blk_reset() AioContext lock region

2022-11-11 Thread Emanuele Giuseppe Esposito
Am 08/11/2022 um 22:19 schrieb Stefan Hajnoczi: > blk_drain() needs the lock because it calls AIO_WAIT_WHILE(). > > The s->rq loop doesn't need the lock because dataplane has been stopped > when virtio_blk_reset() is called. > > Signed-off-by: Stefan Hajnoczi > Reviewed-by: Emanuele Giuseppe

[PATCH-for-7.2 v2] libvduse: Avoid warning about dangerous use of strncpy()

2022-11-11 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé GCC 8 added a -Wstringop-truncation warning: The -Wstringop-truncation warning added in GCC 8.0 via r254630 for bug 81117 is specifically intended to highlight likely unintended uses of the strncpy function that truncate the terminating NUL character from the

[PATCH for-8.0] hw: Add compat machines for 8.0

2022-11-11 Thread Cornelia Huck
Add 8.0 machine types for arm/i440fx/m68k/q35/s390x/spapr. Signed-off-by: Cornelia Huck --- hw/arm/virt.c | 9 - hw/core/machine.c | 3 +++ hw/i386/pc.c | 3 +++ hw/i386/pc_piix.c | 14 +- hw/i386/pc_q35.c | 13 +++

Re: [PATCH v3 2/2] hw/nvme: cleanup error reporting in nvme_init_pci()

2022-11-11 Thread Philippe Mathieu-Daudé
On 11/11/22 13:32, Klaus Jensen wrote: On Nov 11 12:40, Philippe Mathieu-Daudé wrote: On 10/11/22 23:08, Klaus Jensen wrote: From: Klaus Jensen Replace the local Error variable with errp and ERRP_GUARD() and change the return value to bool. Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c

Re: [PATCH v6 05/10] vdpa: move SVQ vring features check to net/

2022-11-11 Thread Eugenio Perez Martin
On Fri, Nov 11, 2022 at 9:07 AM Jason Wang wrote: > > On Fri, Nov 11, 2022 at 3:56 PM Eugenio Perez Martin > wrote: > > > > On Fri, Nov 11, 2022 at 8:34 AM Jason Wang wrote: > > > > > > > > > 在 2022/11/10 21:09, Eugenio Perez Martin 写道: > > > > On Thu, Nov 10, 2022 at 6:40 AM Jason Wang wrote:

Re: [PATCH v1] block/rbd: Add support for layered encryption

2022-11-11 Thread Ilya Dryomov
On Wed, Oct 26, 2022 at 10:48 AM Or Ozeri wrote: > > Starting from ceph Reef, RBD has built-in support for layered encryption, > where each ancestor image (in a cloned image setting) can be possibly > encrypted using a unique passphrase. > > A new function, rbd_encryption_load2, was added to librb

Re: [PATCH v6 07/10] vdpa: Add asid parameter to vhost_vdpa_dma_map/unmap

2022-11-11 Thread Eugenio Perez Martin
On Fri, Nov 11, 2022 at 8:41 AM Jason Wang wrote: > > > 在 2022/11/10 21:22, Eugenio Perez Martin 写道: > > On Thu, Nov 10, 2022 at 6:51 AM Jason Wang wrote: > >> On Wed, Nov 9, 2022 at 1:08 AM Eugenio Pérez wrote: > >>> So the caller can choose which ASID is destined. > >>> > >>> No need to update

Re: [PATCH v6 09/10] vdpa: Add listener_shadow_vq to vhost_vdpa

2022-11-11 Thread Eugenio Perez Martin
On Fri, Nov 11, 2022 at 8:49 AM Jason Wang wrote: > > > 在 2022/11/10 21:47, Eugenio Perez Martin 写道: > > On Thu, Nov 10, 2022 at 7:01 AM Jason Wang wrote: > >> On Wed, Nov 9, 2022 at 1:08 AM Eugenio Pérez wrote: > >>> The memory listener that thells the device how to convert GPA to qemu's > >>>

Re: should ioapic_service really be modelling cpu writes?

2022-11-11 Thread Paolo Bonzini
On 11/11/22 13:26, Alex Bennée wrote: if (addr > 0xfff || !index) { switch (attrs.requester_type) { } MSIMessage msi = { .address = addr, .data = val }; apic_send_msi(&msi); return MEMTX_OK; } which at least gets things booting pro

Re: [BUG] hw/i386/pc.c: CXL Fixed Memory Window should not reserve e820 in bios

2022-11-11 Thread Igor Mammedov
On Fri, 11 Nov 2022 12:40:59 +0100 Gerd Hoffmann wrote: > On Fri, Nov 11, 2022 at 11:51:23AM +0100, Igor Mammedov wrote: > > On Tue, 8 Nov 2022 12:21:11 +0100 > > Gerd Hoffmann wrote: > > > > > > >> > diff --git a/hw/i386/pc.c b/hw/i386/pc.c > > > > >> > index 566accf7e6..5bf5465a21 100644 >

Re: [PATCH v3 01/15] hw: encode accessing CPU index in MemTxAttrs

2022-11-11 Thread Philippe Mathieu-Daudé
On 31/10/22 14:03, Peter Maydell wrote: On Mon, 31 Oct 2022 at 12:08, Philippe Mathieu-Daudé wrote: On 4/10/22 16:54, Peter Maydell wrote: On Tue, 4 Oct 2022 at 14:33, Alex Bennée wrote: Peter Maydell writes: The MSC is in the address map like most other stuff, and thus there is no rest

Re: [BUG] hw/i386/pc.c: CXL Fixed Memory Window should not reserve e820 in bios

2022-11-11 Thread Gerd Hoffmann
> if (pcmc->has_reserved_memory && machine->device_memory->base) { > > [...] > > if (pcms->cxl_devices_state.is_enabled) { > > res_mem_end = cxl_resv_end; > > that s

Re: How about increasing max_cpus for q35 ?

2022-11-11 Thread Igor Mammedov
On Fri, 11 Nov 2022 10:47:20 + Daniel P. Berrangé wrote: > On Wed, Nov 09, 2022 at 01:36:07PM +, Dario Faggioli wrote: > > Hello, > > > > Sorry for the potentially naive question, but I'm not clear what the > > process would be if, say, I'd like to raise the number of maximum CPUs > > a

Re: [PATCH v2] acpi/tests/avocado/bits: some misc fixes

2022-11-11 Thread Thomas Huth
On 11/11/2022 13.31, Ani Sinha wrote: Most of the changes are trivial. The bits test timeout has now been increased to 110 seconds in order to accommodate slower systems and fewer unnecessary failures. Removed of the reference to non-existent README file in docs. CC: Thomas Huth CC: qemu-triv..

Re: [PATCH v3 01/15] hw: encode accessing CPU index in MemTxAttrs

2022-11-11 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > On 31/10/22 14:03, Peter Maydell wrote: >> On Mon, 31 Oct 2022 at 12:08, Philippe Mathieu-Daudé >> wrote: >>> >>> On 4/10/22 16:54, Peter Maydell wrote: On Tue, 4 Oct 2022 at 14:33, Alex Bennée wrote: > > > Peter Maydell writes: >> The M

Re: should ioapic_service really be modelling cpu writes?

2022-11-11 Thread Alex Bennée
Paolo Bonzini writes: > On 11/11/22 13:26, Alex Bennée wrote: >> if (addr > 0xfff || !index) { >> switch (attrs.requester_type) { >> } >> MSIMessage msi = { .address = addr, .data = val }; >> apic_send_msi(&msi); >> return MEMTX_OK; >>

[PATCH v2] util/qemu-config: Fix "query-command-line-options" to provide the right values

2022-11-11 Thread Thomas Huth
The "query-command-line-options" command uses a hand-crafted list of options that should be returned for the "machine" parameter. This is pretty much out of sync with reality, for example settings like "kvm_shadow_mem" or "accel" are not parameters for the machine anymore. Also, there is no distinc

Re: [PATCH v2] acpi/tests/avocado/bits: some misc fixes

2022-11-11 Thread Michael S. Tsirkin
On Fri, Nov 11, 2022 at 06:01:08PM +0530, Ani Sinha wrote: > Most of the changes are trivial. The bits test timeout has now been increased > to 110 seconds in order to accommodate slower systems and fewer unnecessary > failures. Removed of the reference to non-existent README file in docs. > > CC:

Re: [BUG] hw/i386/pc.c: CXL Fixed Memory Window should not reserve e820 in bios

2022-11-11 Thread Michael S. Tsirkin
On Fri, Nov 11, 2022 at 02:36:02PM +0100, Gerd Hoffmann wrote: > > if (pcmc->has_reserved_memory && machine->device_memory->base) { > > > > [...] > > > > if (pcms->cxl_devices_state.is_enabled) {

Re: [PATCH v6 10/10] vdpa: Always start CVQ in SVQ mode

2022-11-11 Thread Eugenio Perez Martin
On Fri, Nov 11, 2022 at 9:03 AM Jason Wang wrote: > > > 在 2022/11/11 00:07, Eugenio Perez Martin 写道: > > On Thu, Nov 10, 2022 at 7:25 AM Jason Wang wrote: > >> > >> 在 2022/11/9 01:07, Eugenio Pérez 写道: > >>> Isolate control virtqueue in its own group, allowing to intercept control > >>> commands

Re: [PATCH v2] acpi/tests/avocado/bits: some misc fixes

2022-11-11 Thread Ani Sinha
On Fri, Nov 11, 2022 at 20:05 Michael S. Tsirkin wrote: > On Fri, Nov 11, 2022 at 06:01:08PM +0530, Ani Sinha wrote: > > Most of the changes are trivial. The bits test timeout has now been > increased > > to 110 seconds in order to accommodate slower systems and fewer > unnecessary > > failures.

Re: [PATCH v2] acpi/tests/avocado/bits: some misc fixes

2022-11-11 Thread Michael S. Tsirkin
On Fri, Nov 11, 2022 at 08:16:22PM +0530, Ani Sinha wrote: > > > On Fri, Nov 11, 2022 at 20:05 Michael S. Tsirkin wrote: > > On Fri, Nov 11, 2022 at 06:01:08PM +0530, Ani Sinha wrote: > > Most of the changes are trivial. The bits test timeout has now been > increased > > to 110

Re: [PATCH v2 1/3] accel: introduce accelerator blocker API

2022-11-11 Thread Emanuele Giuseppe Esposito
Am 11/11/2022 um 11:48 schrieb Paolo Bonzini: > On 11/10/22 17:48, Emanuele Giuseppe Esposito wrote: >> +/* >> + * QEMU accel blocker class > > "Lock to inhibit accelerator ioctls" > >> + * >> + * Copyright (c) 2014 Red Hat Inc. > > 2022, you can also add an Author line. > >> +static int acc

Re: [PATCH v2] util/qemu-config: Fix "query-command-line-options" to provide the right values

2022-11-11 Thread Markus Armbruster
Thomas Huth writes: > The "query-command-line-options" command uses a hand-crafted list > of options that should be returned for the "machine" parameter. > This is pretty much out of sync with reality, for example settings > like "kvm_shadow_mem" or "accel" are not parameters for the machine > an

[PATCH for 7.2-rc1 v2 00/12] testing, docs, plugins, arm pre-PR

2022-11-11 Thread Alex Bennée
Hi, This is my pre-PR series for the pull request I'm going to send on Monday in time for Tuesday tagging of rc1. Anything not reviewed will get dropped from the PR (which probably includes the GICD_IIDR which was just an annoyance I noticed while debugging Xen for another series). The following s

[PATCH v2 05/12] docs/devel: add a maintainers section to development process

2022-11-11 Thread Alex Bennée
We don't currently have a clear place in the documentation to describe the roles and responsibilities of a maintainer. Lets create one so we can. I've moved a few small bits out of other files to try and keep everything in one place. Signed-off-by: Alex Bennée Reviewed-by: Stefan Hajnoczi Review

[PATCH v2 09/12] tests/plugins: add a new vcpu state tracking plugin

2022-11-11 Thread Alex Bennée
Although we call qemu_plugin_register_vcpu_idle_cb() in the bb test we don't really exercise the rest of the state change callbacks. Add a new test that tests the whole API. [AJB: I wrote this in an attempt to flush out a reproducer for #1195 although so far no joy.] Signed-off-by: Alex Bennée C

[PATCH v2 03/12] tests/avocado/machine_aspeed.py: Reduce noise on the console for SDK tests

2022-11-11 Thread Alex Bennée
From: Cédric Le Goater The Aspeed SDK images are based on OpenBMC which starts a lot of services. The output noise on the console can break from time to time the test waiting for the logging prompt. Change the U-Boot bootargs variable to add "quiet" to the kernel command line and reduce the outp

[PATCH v2 07/12] docs/devel: simplify the minimal checklist

2022-11-11 Thread Alex Bennée
The bullet points are quite long and contain process tips. Move those bits of the bullet to the relevant sections and link to them. Use a table for nicer formatting of the checklist. Signed-off-by: Alex Bennée Reviewed-by: Stefan Hajnoczi Reviewed-by: Paolo Bonzini Message-Id: <20221012121152.1

[PATCH v2 11/12] gitlab: integrate coverage report

2022-11-11 Thread Alex Bennée
This should hopefully give is nice coverage information about what our tests (or at least the subset we are running) have hit. Ideally we would want a way to trigger coverage on tests likely to be affected by the current commit. Signed-off-by: Alex Bennée Acked-by: Stefan Hajnoczi --- .gitlab-c

[PATCH v2 08/12] docs/devel: try and improve the language around patch review

2022-11-11 Thread Alex Bennée
It is important that contributors take the review process seriously and we collaborate in a respectful way while avoiding personal attacks. Try and make this clear in the language. Signed-off-by: Alex Bennée Reviewed-by: Markus Armbruster Reviewed-by: Stefan Hajnoczi Reviewed-by: Paolo Bonzini

[PATCH v2 12/12] hw/intc: add implementation of GICD_IIDR to Arm GIC

2022-11-11 Thread Alex Bennée
a66a24585f (hw/intc/arm_gic: Implement read of GICC_IIDR) implemented this for the CPU interface register. The fact we don't implement it shows up when running Xen with -d guest_error which is definitely wrong because the guest is perfectly entitled to read it. Lightly re-factor this region of reg

[PATCH v2 01/12] Run docker probe only if docker or podman are available

2022-11-11 Thread Alex Bennée
From: Stefan Weil The docker probe uses "sudo -n" which can cause an e-mail with a security warning each time when configure is run. Therefore run docker probe only if either docker or podman are available. That avoids the problematic "sudo -n" on build environments which have neither docker n

[PATCH v2 06/12] docs/devel: make language a little less code centric

2022-11-11 Thread Alex Bennée
We welcome all sorts of patches. Signed-off-by: Alex Bennée Reviewed-by: Stefan Hajnoczi Reviewed-by: Paolo Bonzini Message-Id: <20221012121152.1179051-3-alex.ben...@linaro.org> --- docs/devel/submitting-a-patch.rst | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a

[PATCH v2 10/12] tests/avocado: Raise timeout for boot_linux.py:BootLinuxPPC64.test_pseries_tcg

2022-11-11 Thread Alex Bennée
From: Peter Maydell On my machine, a debug build of QEMU takes about 260 seconds to complete this test, so with the current timeout value of 180 seconds it always times out. Double the timeout value to 360 so the test definitely has enough time to complete. Signed-off-by: Peter Maydell Signed-

[PATCH v2 04/12] tests/docker: allow user to override check target

2022-11-11 Thread Alex Bennée
This is useful when trying to bisect a particular failing test behind a docker run. For example: make docker-test-clang@fedora \ TARGET_LIST=arm-softmmu \ TEST_COMMAND="meson test qtest-arm/qos-test" \ J=9 V=1 Signed-off-by: Alex Bennée --- v1 - fix s/target /target./ - CHECK_TA

[PATCH v2 02/12] tests/avocado: improve behaviour waiting for login prompts

2022-11-11 Thread Alex Bennée
This attempts to deal with the problem of login prompts not being guaranteed to be terminated with a newline. The solution to this is to peek at the incoming data looking to see if we see an up-coming match before we fall back to the old readline() logic. The reason to mostly rely on readline is be

[PATCH] MAINTAINERS: add mst to list of biosbits maintainers

2022-11-11 Thread Ani Sinha
Adding Michael's name to the list of bios bits maintainers so that all changes and fixes into biosbits framework can go through his tree and he is notified. Suggested-by: Michael S. Tsirkin Signed-off-by: Ani Sinha --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS

[PULL 07/11] block/blkio: Set BlockDriver::has_variable_length to false

2022-11-11 Thread Kevin Wolf
From: Alberto Faria Setting it to true can cause the device size to be queried from libblkio in otherwise fast paths, degrading performance. Set it to false and require users to refresh the device size explicitly instead. Fixes: 4c8f4fda0504 ("block/blkio: Tolerate device size changes") Suggeste

[PULL 11/11] tests/stream-under-throttle: New test

2022-11-11 Thread Kevin Wolf
From: Hanna Reitz Test streaming a base image into the top image underneath two throttle nodes. This was reported to make qemu 7.1 hang (https://gitlab.com/qemu-project/qemu/-/issues/1215), so this serves as a regression test. Signed-off-by: Hanna Reitz Message-Id: <20221110160921.33158-1-hre.

[PULL 06/11] qapi/block-core: Fix BlockdevOptionsNvmeIoUring @path description

2022-11-11 Thread Kevin Wolf
From: Alberto Faria The nvme-io_uring BlockDriver's path option must point at the character device of an NVMe namespace, not at an image file. Fixes: fd66dbd424f5 ("blkio: add libblkio block driver") Suggested-by: Stefano Garzarella Signed-off-by: Alberto Faria Message-Id: <20221108142347.1322

[PULL 00/11] Block layer patches

2022-11-11 Thread Kevin Wolf
The following changes since commit 2ccad61746ca7de5dd3e25146062264387e43bd4: Merge tag 'pull-tcg-20221109' of https://gitlab.com/rth7680/qemu into staging (2022-11-09 13:26:45 -0500) are available in the Git repository at: https://repo.or.cz/qemu/kevin.git tags/for-upstream for you to fetc

[PULL 04/11] iotests/151: Test that active mirror progresses

2022-11-11 Thread Kevin Wolf
From: Hanna Reitz Before this series, a mirror job in write-blocking mode would pause issuing background requests while active requests are in flight. Thus, if the source is constantly in use by active requests, no actual progress can be made. This series should have fixed that, making the mirr

[PULL 05/11] iotests/151: Test active requests on mirror start

2022-11-11 Thread Kevin Wolf
From: Hanna Reitz Have write requests happen to the source node right when we start a mirror job. The mirror filter node may encounter MirrorBDSOpaque.job being NULL, but this should not cause a segfault. Signed-off-by: Hanna Reitz Message-Id: <20221109165452.67927-6-hre...@redhat.com> Reviewe

[PULL 10/11] block: Start/end drain on correct AioContext

2022-11-11 Thread Kevin Wolf
From: Hanna Reitz bdrv_parent_drained_{begin,end}_single() are supposed to operate on the parent, not on the child, so they should not attempt to get the context to poll from the child but the parent instead. BDRV_POLL_WHILE(c->bs) does get the context from the child, so we should replace it wit

[PULL 01/11] block/mirror: Do not wait for active writes

2022-11-11 Thread Kevin Wolf
From: Hanna Reitz Waiting for all active writes to settle before daring to create a background copying operation means that we will never do background operations while the guest does anything (in write-blocking mode), and therefore cannot converge. Yes, we also will not diverge, but actually co

[PULL 03/11] block/mirror: Fix NULL s->job in active writes

2022-11-11 Thread Kevin Wolf
From: Hanna Reitz There is a small gap in mirror_start_job() before putting the mirror filter node into the block graph (bdrv_append() call) and the actual job being created. Before the job is created, MirrorBDSOpaque.job is NULL. It is possible that requests come in when bdrv_drained_end() is

[PULL 02/11] block/mirror: Drop mirror_wait_for_any_operation()

2022-11-11 Thread Kevin Wolf
From: Hanna Reitz mirror_wait_for_free_in_flight_slot() is the only remaining user of mirror_wait_for_any_operation(), so inline the latter into the former. Signed-off-by: Hanna Reitz Message-Id: <20221109165452.67927-3-hre...@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf ---

[PULL 08/11] block: Make bdrv_child_get_parent_aio_context I/O

2022-11-11 Thread Kevin Wolf
From: Hanna Reitz We want to use bdrv_child_get_parent_aio_context() from bdrv_parent_drained_{begin,end}_single(), both of which are "I/O or GS" functions. Prior to 3ed4f708fe1, all the implementations were I/O code anyway. 3ed4f708fe1 has put block jobs' AioContext field under the job mutex, s

[PULL 09/11] block-backend: Update ctx immediately after root

2022-11-11 Thread Kevin Wolf
From: Hanna Reitz blk_get_aio_context() asserts that blk->ctx is always equal to the root BDS's context (if there is a root BDS). Therefore, blk_do_set_aio_context() must update blk->ctx immediately after the root BDS's context has changed. Without this patch, the next patch would break iotest

[PATCH v3 3/3] kvm: Atomic memslot updates

2022-11-11 Thread Emanuele Giuseppe Esposito
From: David Hildenbrand If we update an existing memslot (e.g., resize, split), we temporarily remove the memslot to re-add it immediately afterwards. These updates are not atomic, especially not for KVM VCPU threads, such that we can get spurious faults. Let's inhibit most KVM ioctls while perf

[PATCH v3 0/3] KVM: allow listener to stop all vcpus before

2022-11-11 Thread Emanuele Giuseppe Esposito
QEMU needs to perform memslots operations like merging and splitting, and each operation requires more than a single ioctl. Therefore if a vcpu is concurrently reading the same memslots, it could end up reading something that was temporarly deleted. For example, merging two memslots into one would

[PATCH v3 2/3] KVM: keep track of running ioctls

2022-11-11 Thread Emanuele Giuseppe Esposito
Using the new accel-blocker API, mark where ioctls are being called in KVM. Next, we will implement the critical section that will take care of performing memslots modifications atomically, therefore preventing any new ioctl from running and allowing the running ones to finish. Signed-off-by: Davi

[PATCH v3 1/3] accel: introduce accelerator blocker API

2022-11-11 Thread Emanuele Giuseppe Esposito
This API allows the accelerators to prevent vcpus from issuing new ioctls while execting a critical section marked with the accel_ioctl_inhibit_begin/end functions. Note that all functions submitting ioctls must mark where the ioctl is being called with accel_{cpu_}ioctl_begin/end(). This API req

[PATCH v3] acpi/tests/avocado/bits: some misc fixes

2022-11-11 Thread Ani Sinha
Most of the changes are trivial. The bits test timeout has now been increased to 110 seconds in order to accommodate slower systems and fewer unnecessary failures. Removed of the reference to non-existent README file in docs. Some minor corrections in the doc file. CC: Thomas Huth CC: Michael S.

Re: should ioapic_service really be modelling cpu writes?

2022-11-11 Thread Paolo Bonzini
Il ven 11 nov 2022, 15:03 Alex Bennée ha scritto: > > Paolo Bonzini writes: > > > On 11/11/22 13:26, Alex Bennée wrote: > >> if (addr > 0xfff || !index) { > >> switch (attrs.requester_type) { > >> } > >> MSIMessage msi = { .address = addr, .data = val }; > >>

Re: [PATCH-for-7.2 v2] libvduse: Avoid warning about dangerous use of strncpy()

2022-11-11 Thread Bin Meng
> From: Philippe Mathieu-Daudé > > GCC 8 added a -Wstringop-truncation warning: > > The -Wstringop-truncation warning added in GCC 8.0 via r254630 for > bug 81117 is specifically intended to highlight likely unintended > uses of the strncpy function that truncate the terminating NUL > ch

Re: [PATCH v2] util/qemu-config: Fix "query-command-line-options" to provide the right values

2022-11-11 Thread Thomas Huth
On 11/11/2022 15.53, Markus Armbruster wrote: Thomas Huth writes: The "query-command-line-options" command uses a hand-crafted list of options that should be returned for the "machine" parameter. This is pretty much out of sync with reality, for example settings like "kvm_shadow_mem" or "accel

Re: [PATCH 04/13] block: Remove drained_end_counter

2022-11-11 Thread Kevin Wolf
Am 09.11.2022 um 15:44 hat Vladimir Sementsov-Ogievskiy geschrieben: > On 11/8/22 15:37, Kevin Wolf wrote: > > drained_end_counter is unused now, nobody changes its value any more. It > > can be removed. > > > > In cases where we had two almost identical functions that only differed > > in whether

Re: [PATCH v2 01/12] Run docker probe only if docker or podman are available

2022-11-11 Thread Thomas Huth
On 11/11/2022 15.55, Alex Bennée wrote: From: Stefan Weil The docker probe uses "sudo -n" which can cause an e-mail with a security warning each time when configure is run. Therefore run docker probe only if either docker or podman are available. That avoids the problematic "sudo -n" on buil

Re: [PATCH-for-7.2 v2] libvduse: Avoid warning about dangerous use of strncpy()

2022-11-11 Thread Stefan Hajnoczi
Reviewed-by: Stefan Hajnoczi

Re: [PATCH 06/13] block: Drain invidual nodes during reopen

2022-11-11 Thread Kevin Wolf
Am 09.11.2022 um 17:00 hat Vladimir Sementsov-Ogievskiy geschrieben: > In subject: individual > > On 11/8/22 15:37, Kevin Wolf wrote: > > bdrv_reopen() and friends use subtree drains as a lazy way of covering > > all the nodes they touch. Turns out that this lazy way is a lot more > > complicated

Re: [PATCH v2 04/12] tests/docker: allow user to override check target

2022-11-11 Thread Philippe Mathieu-Daudé
On 11/11/22 15:55, Alex Bennée wrote: This is useful when trying to bisect a particular failing test behind a docker run. For example: make docker-test-clang@fedora \ TARGET_LIST=arm-softmmu \ TEST_COMMAND="meson test qtest-arm/qos-test" \ J=9 V=1 Signed-off-by: Alex Bennée

[PATCH v5 08/20] hw/timer: convert mptimer access to attrs to derive cpu index

2022-11-11 Thread Alex Bennée
This removes the hacks to deal with empty current_cpu. Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée --- v2 - update for new fields - bool asserts v3 - properly fail memory transactions from non-CPU sources --- hw/timer/arm_mptimer.c | 49 +

[PATCH v5 03/20] target/arm: ensure HVF traps set appropriate MemTxAttrs

2022-11-11 Thread Alex Bennée
As most HVF devices are done purely in software we need to make sure we properly encode the source CPU in MemTxAttrs. This will allow the device emulations to use those attributes rather than relying on current_cpu (although current_cpu will still be correct in this case). Signed-off-by: Alex Benn

[PATCH for 8.0 v5 00/20] use MemTxAttrs to avoid current_cpu in hw/

2022-11-11 Thread Alex Bennée
Hi, This series attempts to improve the modelling of non-CPU writes to peripherals by expanding the MemTxAttrs to carry more details about the requester. There are only 3 requester types, the CPU, the PCI bus and the MACHINE. The last is intended for machine specific buses and leaves the details o

[PATCH v5 04/20] target/arm: ensure KVM traps set appropriate MemTxAttrs

2022-11-11 Thread Alex Bennée
Although most KVM users will use the in-kernel GIC emulation it is perfectly possible not to. In this case we need to ensure the MemTxAttrs are correctly populated so the GIC can divine the source CPU of the operation. Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée --- v3 - new for

[PATCH v5 01/20] hw: encode accessing CPU index in MemTxAttrs

2022-11-11 Thread Alex Bennée
We currently have hacks across the hw/ to reference current_cpu to work out what the current accessing CPU is. This breaks in some cases including using gdbstub to access HW state. As we have MemTxAttrs to describe details about the access lets extend it so CPU accesses can be explicitly marked. T

[PATCH v5 05/20] target/arm: ensure m-profile helpers set appropriate MemTxAttrs

2022-11-11 Thread Alex Bennée
There are a number of helpers for M-profile that deal with CPU initiated access to the vector and stack areas. While it is unlikely these coincided with memory mapped IO devices it is not inconceivable. Embedded targets tend to attract all sorts of interesting code and for completeness we should ta

[PATCH v5 15/20] hw/i386: update vapic_write to use MemTxAttrs

2022-11-11 Thread Alex Bennée
This allows us to drop the current_cpu hack and properly model an invalid access to the vapic. Signed-off-by: Alex Bennée --- hw/i386/kvmvapic.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c index 43f8a8f679..a76e

[PATCH v5 02/20] target/arm: ensure TCG IO accesses set appropriate MemTxAttrs

2022-11-11 Thread Alex Bennée
Both arm_cpu_tlb_fill (for normal IO) and arm_cpu_get_phys_page_attrs_debug (for debug access) come through get_phys_addr which is setting the other memory attributes for the transaction. As these are all by definition CPU accesses we can also set the requested_type/index as appropriate. We also h

[PATCH v5 16/20] include: add MEMTXATTRS_MACHINE helper

2022-11-11 Thread Alex Bennée
We will need this shortly for machine specific transactions for the PC IOAPIC. Signed-off-by: Alex Bennée --- include/exec/memattrs.h | 8 1 file changed, 8 insertions(+) diff --git a/include/exec/memattrs.h b/include/exec/memattrs.h index 8359fc448b..b92f11aaa4 100644 --- a/include/ex

[PATCH v5 10/20] target/microblaze: initialise MemTxAttrs for CPU access

2022-11-11 Thread Alex Bennée
Both of these functions deal with CPU based access (as is evidenced by the secure check straight after). Use the new MEMTXATTRS_CPU constructor to ensure the correct CPU id is filled in should it ever be needed by any devices later. Signed-off-by: Alex Bennée --- target/microblaze/helper.c | 4 +

[PATCH v5 12/20] target/riscv: initialise MemTxAttrs for CPU access

2022-11-11 Thread Alex Bennée
get_physical_address works in the CPU context. Use the new MEMTXATTRS_CPU constructor to ensure the correct CPU id is filled in should it ever be needed by any devices later. Currently the tlb_fill function isn't using the set with attributes function so IO accesses from the softmmu slow-path will

[PATCH v5 07/20] hw/intc/gic: use MxTxAttrs to divine accessing CPU

2022-11-11 Thread Alex Bennée
Now that MxTxAttrs encodes a CPU we should use that to figure it out. This solves edge cases like accessing via gdbstub or qtest. As we should only be processing accesses from CPU cores we can push the CPU extraction logic out to the main access functions. If the access does not come from a CPU we

[PATCH] s390x: Fix spelling errors

2022-11-11 Thread Thomas Huth
Fix typos (discovered with the 'codespell' utility). Signed-off-by: Thomas Huth --- hw/s390x/ipl.h | 2 +- pc-bios/s390-ccw/cio.h | 2 +- pc-bios/s390-ccw/iplb.h | 2 +- target/s390x/cpu_models.h | 4 ++-- hw/s390x/s390-pci-vfio.c

[PATCH v5 06/20] qtest: make read/write operation appear to be from CPU

2022-11-11 Thread Alex Bennée
The point of qtest is to simulate how running code might interact with the system. However because it's not a real system we have places in the code which especially handle check qtest_enabled() before referencing current_cpu. Now we can encode these details in the MemTxAttrs lets do that so we can

[PATCH v5 19/20] hw/isa: derive CPUState from MemTxAttrs in apm_ioport_writeb

2022-11-11 Thread Alex Bennée
Some of the callbacks need a CPUState so extend the interface so we can pass that down rather than relying on current_cpu hacks. Signed-off-by: Alex Bennée --- include/hw/isa/apm.h | 2 +- hw/acpi/ich9.c | 1 - hw/acpi/piix4.c | 2 +- hw/isa/apm.c | 21 +

[PATCH v5 09/20] hw/arm: remove current_cpu hack from pxa2xx access

2022-11-11 Thread Alex Bennée
We can derive the correct CPU from CPUARMState so lets not rely on current_cpu. Signed-off-by: Alex Bennée --- hw/arm/pxa2xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index 93dda83d7a..065392a8bc 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/

[PATCH v5 18/20] hw/i386: convert apic access to use MemTxAttrs

2022-11-11 Thread Alex Bennée
This allows us to correctly model invalid accesses to the interrupt controller as well as avoiding the use of current_cpu hacks to find the APIC structure. We have to ensure we check for MSI signals first which shouldn't arrive from the CPU but are either triggered by PCI or internal IOAPIC writes.

[PATCH v5 14/20] hw/audio: explicitly set .requester_type for intel-hda

2022-11-11 Thread Alex Bennée
This is simulating a bus master writing data back into system memory. Mark it as such. Signed-off-by: Alex Bennée --- hw/audio/intel-hda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index f38117057b..95c28b315c 100644 --- a/hw/

[PATCH v5 11/20] target/sparc: initialise MemTxAttrs for CPU access

2022-11-11 Thread Alex Bennée
Both of the TLB fill functions and the cpu_sparc_get_phys_page deal with CPU based access. Use the new MEMTXATTRS_CPU constructor to ensure the correct CPU id is filled in should it ever be needed by any devices later. Signed-off-by: Alex Bennée --- target/sparc/mmu_helper.c | 6 +++--- 1 file c

[PATCH v5 17/20] hw/intc: properly model IOAPIC MSI messages

2022-11-11 Thread Alex Bennée
On the real HW the IOAPIC is wired directly to the APIC and doesn't really generate memory accesses on the main bus of the system. To model this we can use the MTRT_MACHINE requester type and set the id as a magic number to represent the IOAPIC as the source. Signed-off-by: Alex Bennée Cc: Paolo

[PATCH v5 20/20] include/hw: add commentary to current_cpu export

2022-11-11 Thread Alex Bennée
Document the intended use of current_cpu and discourage its use in new HW emulation code. Once we have fully converted the tree we should probably move this extern to another header. Signed-off-by: Alex Bennée --- include/hw/core/cpu.h | 14 ++ 1 file changed, 14 insertions(+) diff

[PATCH v5 13/20] target/i386: add explicit initialisation for MexTxAttrs

2022-11-11 Thread Alex Bennée
Where appropriate initialise with MEMTXATTRS_CPU otherwise use MEMTXATTRS_UNSPECIFIED instead of the null initialiser. Signed-off-by: Alex Bennée --- target/i386/cpu.h | 4 +++- target/i386/hax/hax-all.c | 2 +- target/i386/nvmm/nvmm-all.c | 2 +- target/i386/sev.c | 2 +-

Re: [PATCH] s390x: Fix spelling errors

2022-11-11 Thread Stefan Weil via
Am 11.11.22 um 19:28 schrieb Thomas Huth: Fix typos (discovered with the 'codespell' utility). Signed-off-by: Thomas Huth --- hw/s390x/ipl.h | 2 +- pc-bios/s390-ccw/cio.h | 2 +- pc-bios/s390-ccw/iplb.h | 2 +- target/s390x/cpu_models.h

Re: [PATCH v3 2/2] vhost-net: Fix the virtio features negotiation flaw

2022-11-11 Thread Hyman
在 2022/11/11 3:00, Michael S. Tsirkin 写道: On Sun, Oct 30, 2022 at 09:52:39PM +0800, huang...@chinatelecom.cn wrote: From: Hyman Huang(黄勇) Save the acked_features once it be configured by guest virtio driver so it can't miss any features. Note that this patch also change the features saving

Re: [PATCH v3 2/2] vhost-net: Fix the virtio features negotiation flaw

2022-11-11 Thread Hyman
The previous reply email has an text format error, please ignore and 在 2022/11/11 3:00, Michael S. Tsirkin 写道: On Sun, Oct 30, 2022 at 09:52:39PM +0800, huang...@chinatelecom.cn wrote: From: Hyman Huang(黄勇) Save the acked_features once it be configured by guest virtio driver so it can't miss

Re: [PULL 00/11] Block layer patches

2022-11-11 Thread Stefan Hajnoczi
On Fri, 11 Nov 2022 at 10:29, Kevin Wolf wrote: > > The following changes since commit 2ccad61746ca7de5dd3e25146062264387e43bd4: > > Merge tag 'pull-tcg-20221109' of https://gitlab.com/rth7680/qemu into > staging (2022-11-09 13:26:45 -0500) > > are available in the Git repository at: > > http

Re: [PATCH v2 11/12] gitlab: integrate coverage report

2022-11-11 Thread Philippe Mathieu-Daudé
On 11/11/22 15:55, Alex Bennée wrote: This should hopefully give is nice coverage information about what our tests (or at least the subset we are running) have hit. Ideally we would want a way to trigger coverage on tests likely to be affected by the current commit. IIUC per [*] this will not a

Re: [PATCH v5 10/20] target/microblaze: initialise MemTxAttrs for CPU access

2022-11-11 Thread Edgar E. Iglesias
On Fri, Nov 11, 2022 at 06:25:25PM +, Alex Bennée wrote: > Both of these functions deal with CPU based access (as is evidenced by > the secure check straight after). Use the new MEMTXATTRS_CPU > constructor to ensure the correct CPU id is filled in should it ever > be needed by any devices late

[PATCH] hw/riscv: virt: Remove the redundant ipi-id property

2022-11-11 Thread Atish Patra
The imsic DT binding has changed and no longer require an ipi-id. The latest IMSIC driver dynamically allocates ipi id if slow-ipi is not defined. Get rid of the unused dt property which may lead to confusion. Signed-off-by: Atish Patra --- hw/riscv/virt.c | 2 -- include/hw/riscv/virt.

Re: [PATCH v3] qapi/qom: Memory backend property prealloc-threads doc fix

2022-11-11 Thread Gavin Shan
On 11/11/22 6:54 PM, Igor Mammedov wrote: On Fri, 11 Nov 2022 17:34:04 +0800 Gavin Shan wrote: On 11/11/22 5:13 PM, Igor Mammedov wrote: On Fri, 11 Nov 2022 07:47:16 +0100 Markus Armbruster wrote: Gavin Shan writes: On 11/11/22 11:05 AM, Zhenyu Zhang wrote: Commit ffac16fab3 "hostmem: int

Re: [PATCH] hw/misc/pfsoc: add fabric clocks to ioscb

2022-11-11 Thread Conor Dooley
On Thu, Nov 10, 2022 at 12:18:44AM +0100, Philippe Mathieu-Daudé wrote: > Hi Conor, > > On 9/11/22 20:08, Conor Dooley wrote: > > From: Conor Dooley > > > > @@ -168,6 +170,10 @@ static void mchp_pfsoc_ioscb_realize(DeviceState *dev, > > Error **errp) > > "mchp.pfsoc.

<    1   2   3   >