Re: [PATCH] linux-user: Add translation for argument of msync()

2022-12-14 Thread Philippe Mathieu-Daudé
On 15/12/22 08:27, Helge Deller wrote: msync() uses the flags MS_ASYNC, MS_INVALIDATE and MS_SYNC, which differ between platforms, specifcally on alpha and hppa. Add a target to host translation for those and wire up a nicer strace output. This fixes the testsuite of the macaulay2 debian

Re: [PATCH 0/8] tcg/loongarch64: Reorg goto_tb and cleanups

2022-12-14 Thread Philippe Mathieu-Daudé
On 6/12/22 05:40, Richard Henderson wrote: Based-on: 20221206041715.314209-1-richard.hender...@linaro.org ("[PATCH 00/22] tcg: exit_tb tidy, goto_tb reorg") Includes: * Disassembler from target/loongarch/. * Improvements to movi by Rui Wang, with minor tweaks. * Improvements to

Re: [PATCH 3/8] tcg/loongarch64: Update tcg-insn-defs.c.inc

2022-12-14 Thread Philippe Mathieu-Daudé
On 6/12/22 05:40, Richard Henderson wrote: Regenerate with ADDU16I included. Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-insn-defs.c.inc | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tcg/loongarch64/tcg-insn-defs.c.inc

qemu no sound

2022-12-14 Thread andschlick
.fr-emoticon.fr-emoticon-img { background-repeat: no-repeat !important; font-size: inherit; height: 1em; width: 1em;

Re: [PATCH 1/8] target/loongarch: Enable the disassembler for host tcg

2022-12-14 Thread Philippe Mathieu-Daudé
On 6/12/22 05:40, Richard Henderson wrote: Reuse the decodetree based disassembler from target/loongarch/ for tcg/loongarch64/. The generation of decode-insns.c.inc into ./libcommon.fa.p/ could eventually result in conflict, if any other host requires the same trick, but this is good enough for

Re: [PATCH v1 1/2] hw/intc/loongarch_pch_msi: add irq number property

2022-12-14 Thread Philippe Mathieu-Daudé
On 15/12/22 07:50, Tianrui Zhao wrote: This patch adds irq number property for loongarch msi interrupt controller, and remove hard coding irq number macro. Signed-off-by: Tianrui Zhao --- hw/intc/loongarch_pch_msi.c | 22 +++--- hw/loongarch/virt.c |

Re: [PATCH 6/5] include/hw/cxl: Break inclusion loop

2022-12-14 Thread Markus Armbruster
Jonathan Cameron writes: > On Sat, 10 Dec 2022 08:09:06 +0100 > Markus Armbruster wrote: > >> Markus Armbruster writes: >> >> > hw/cxl/cxl_pci.h and hw/cxl/cxl_cdat.h include each other. Neither >> > header actually needs the other one. Drop both #include directives. >> > >> >

Re: [PULL for 7.2-rc4 0/1] loongarch for 7.2-rc4 patch

2022-12-14 Thread Philippe Mathieu-Daudé
Hi, On 2/12/22 11:25, Song Gao wrote: The following changes since commit c4ffd91aba1c3d878e99a3e7ba8aad4826728ece: Update VERSION for v7.2.0-rc3 (2022-11-29 18:15:26 -0500) are available in the Git repository at: https://gitlab.com/gaosong/qemu.git tags/pull-loongarch-20221202 for you

[PATCH] linux-user: Add translation for argument of msync()

2022-12-14 Thread Helge Deller
msync() uses the flags MS_ASYNC, MS_INVALIDATE and MS_SYNC, which differ between platforms, specifcally on alpha and hppa. Add a target to host translation for those and wire up a nicer strace output. This fixes the testsuite of the macaulay2 debian package with a hppa-linux guest on a x86-64

Re: [PATCH 1/5] include/hw/pci: Clean up superfluous inclusion of pci*/*.h cxl/*.h

2022-12-14 Thread Markus Armbruster
Jonathan Cameron writes: > On Fri, 9 Dec 2022 14:47:58 +0100 > Markus Armbruster wrote: > > Hi Markus, > > One comment on the CXL ones. Others CXL related changes > all looks fine to me. > > Thanks for cleaning these up. > > Jonathan > > >> diff --git a/include/hw/cxl/cxl.h

[PATCH v1 2/2] hw/intc/loongarch_pch_pic: add irq number property

2022-12-14 Thread Tianrui Zhao
With loongarch 7A1000 manual, irq number supported can be set in PCH_PIC_INT_ID_HI register. This patch adds irq number property for loongarch_pch_pic, so that virt machine can set different irq number when pch_pic intc is added. Signed-off-by: Tianrui Zhao --- hw/intc/loongarch_pch_pic.c

[PATCH v1 0/2] Add irq number property for loongarch pch interrupt controller

2022-12-14 Thread Tianrui Zhao
This series add irq number property for loongarch pch_msi and pch_pic interrupt controller. Changes for v1: (1) Add irq number property for loongarch_pch_msi. (2) Add irq number property for loongarch_pch_pic. Tianrui Zhao (2): hw/intc/loongarch_pch_msi: add irq number property

[PATCH v1 1/2] hw/intc/loongarch_pch_msi: add irq number property

2022-12-14 Thread Tianrui Zhao
This patch adds irq number property for loongarch msi interrupt controller, and remove hard coding irq number macro. Signed-off-by: Tianrui Zhao --- hw/intc/loongarch_pch_msi.c | 22 +++--- hw/loongarch/virt.c | 11 +++

Re: [PATCH 4/4] coroutine: Break inclusion loop

2022-12-14 Thread Markus Armbruster
Paolo Bonzini writes: > dropped qemu-devel by mistake. > > Paolo > > > Il lun 12 dic 2022, 23:16 Paolo Bonzini ha scritto: > >> On 12/8/22 15:23, Markus Armbruster wrote: >> > qemu/coroutine.h and qemu/lockable.h include each other. Neither >> > header actually needs the other one. >> >>

Re: [PATCH v2 2/5] target/riscv: Update VS timer whenever htimedelta changes

2022-12-14 Thread Alistair Francis
On Mon, Dec 12, 2022 at 9:12 PM Anup Patel wrote: > > On Mon, Dec 12, 2022 at 11:23 AM Alistair Francis > wrote: > > > > On Thu, Dec 8, 2022 at 6:41 PM Anup Patel wrote: > > > > > > On Thu, Dec 8, 2022 at 9:00 AM Alistair Francis > > > wrote: > > > > > > > > On Tue, Nov 8, 2022 at 11:07 PM

Re: [PATCH] tpm: add backend for mssim

2022-12-14 Thread Stefan Berger
On 12/14/22 07:43, James Bottomley wrote: On Wed, 2022-12-14 at 11:52 +, Daniel P. Berrangé wrote: It is a shame there isn't a standardized protocol for software TPM communication, as that'd avoid the need for multiple backends. Technically the mssim protocol is the standard, being

CVMSEG Emulation

2022-12-14 Thread Christopher Wrogg
Was wondering if there was a follow up to this. Just a recap but I am trying to map 0x8000 - 0xBFFF into a userspace process's virtual address space. It falls squarely in KSEG3. Here is what I have tried Attempt 1 What I did: #undef TARGET_VIRT_ADDR_SPACE_BITS

[ANNOUNCE] QEMU 7.2.0 is now available

2022-12-14 Thread Michael Roth
Hello, On behalf of the QEMU Team, I'd like to announce the availability of the QEMU 7.2.0 release. This release contains 1800+ commits from 205 authors. You can grab the tarball from our download page here: https://www.qemu.org/download/#source The full list of changes are available at:

Re: [PULL 00/51] Block layer patches

2022-12-14 Thread Peter Maydell
On Wed, 14 Dec 2022 at 13:45, Kevin Wolf wrote: > > The following changes since commit 5204b499a6cae4dfd9fe762d5e6e82224892383b: > > mailmap: Fix Stefan Weil author email (2022-12-13 15:56:57 -0500) > > are available in the Git repository at: > > https://repo.or.cz/qemu/kevin.git

Re: [RFC v3 1/3] memory: add depth assert in address_space_to_flatview

2022-12-14 Thread Peter Xu
On Wed, Dec 14, 2022 at 08:03:38AM -0800, Chuang Xu wrote: > On 2022/12/13 下午9:35, Chuang Xu wrote: > > Before using any flatview, sanity check we're not during a memory > region transaction or the map can be invalid. > > Signed-off-by: Chuang Xu > > --- > include/exec/memory.h | 9 +

Re: [PATCH 1/5] io: Add support for MSG_PEEK for socket channel

2022-12-14 Thread Peter Xu
On Wed, Dec 14, 2022 at 09:14:09AM +, Daniel P. Berrangé wrote: > On Tue, Dec 13, 2022 at 04:38:46PM -0500, Peter Xu wrote: > > From: "manish.mishra" > > > > MSG_PEEK reads from the peek of channel, The data is treated as > > unread and the next read shall still return this data. This > >

[PATCH v2] hw/cxl/device: Add Flex Bus Port DVSEC

2022-12-14 Thread Ira Weiny
The Flex Bus Port DVSEC was missing on type 3 devices which was blocking RAS checks.[1] Add the Flex Bus Port DVSEC to type 3 devices as per CXL 3.0 8.2.1.3. [1] https://lore.kernel.org/linux-cxl/167096738875.2861540.11815053323626849940.st...@djiang5-desk3.ch.intel.com/ Cc: Dave Jiang Cc:

[PATCH 0/2] test

2022-12-14 Thread Peter Xu
manish.mishra (2): io: Add support for MSG_PEEK for socket channel migration: check magic value for deciding the mapping of channels chardev/char-socket.c | 4 +-- include/io/channel.h| 6 io/channel-buffer.c | 1 +

[PULL v2 18/30] qapi net: Elide redundant has_FOO in generated C

2022-12-14 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/net.json. Said commit explains the

[PULL v2 00/30] QAPI patches patches for 2022-12-14

2022-12-14 Thread Markus Armbruster
The following changes since commit ea3a008d2d9ced9c4f93871c823baee237047f93: Update VERSION for v7.2.0-rc4 (2022-12-06 19:53:34 -0500) are available in the Git repository at: https://repo.or.cz/qemu/armbru.git tags/pull-qapi-2022-12-14-v2 for you to fetch changes up to

[PULL v2 10/30] qapi block: Elide redundant has_FOO in generated C

2022-12-14 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/block*.json. Said commit explains the

Re: [PATCH v4 4/4] hw/nvme: fix missing cq eventidx update

2022-12-14 Thread Keith Busch
On Mon, Dec 12, 2022 at 12:44:09PM +0100, Klaus Jensen wrote: > From: Klaus Jensen > > Prior to reading the shadow doorbell cq head, we have to update the > eventidx. Otherwise, we risk that the driver will skip an mmio doorbell > write. This happens on riscv64, as reported by Guenter. > >

Re: [PATCH v4 3/4] hw/nvme: fix missing endian conversions for doorbell buffers

2022-12-14 Thread Keith Busch
On Mon, Dec 12, 2022 at 12:44:08PM +0100, Klaus Jensen wrote: > From: Klaus Jensen > > The eventidx and doorbell value are not handling endianness correctly. > Fix this. > > Fixes: 3f7fe8de3d49 ("hw/nvme: Implement shadow doorbell buffer support") > Cc: qemu-sta...@nongnu.org > Reported-by:

Re: [PATCH v4 2/4] hw/nvme: rename shadow doorbell related trace events

2022-12-14 Thread Keith Busch
On Mon, Dec 12, 2022 at 12:44:07PM +0100, Klaus Jensen wrote: > From: Klaus Jensen > > Rename the trace events related to writing the event index and reading > the doorbell value to make it more clear that the event is associated > with an actual update (write or read respectively). > >

Re:Re: QEMU function trace

2022-12-14 Thread wanghw364
Thanks very much. According to your reply, I reviewd qemu loader and plugins source code again, I think I've got what you mentioned. In qemu linux-user(user mode) case, the guest images are all ELF format, and inside the ELF loader qemu will call load_symbols function, so in this case, the

Re: [PATCH v1 16/24] vfio-user: proxy container connect/disconnect

2022-12-14 Thread Cédric Le Goater
On 11/9/22 00:13, John Johnson wrote: Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/common.c | 207 +- hw/vfio/pci.c | 18 +++- hw/vfio/user.c|

Re: [PATCH v2 27/27] target/s390x: Enable TARGET_TB_PCREL

2022-12-14 Thread Ilya Leoshkevich
On Sun, Dec 11, 2022 at 09:28:02AM -0600, Richard Henderson wrote: > Signed-off-by: Richard Henderson > --- > target/s390x/cpu-param.h | 1 + > target/s390x/cpu.c | 12 + > target/s390x/tcg/translate.c | 86 +++- > 3 files changed, 68

Re: [PULL 00/30] QAPI patches patches for 2022-12-14

2022-12-14 Thread Peter Maydell
On Wed, 14 Dec 2022 at 07:48, Markus Armbruster wrote: > > The following changes since commit ea3a008d2d9ced9c4f93871c823baee237047f93: > > Update VERSION for v7.2.0-rc4 (2022-12-06 19:53:34 -0500) > > are available in the Git repository at: > > https://repo.or.cz/qemu/armbru.git

Re: [PATCH v1 15/24] vfio-user: forward msix BAR accesses to server

2022-12-14 Thread Cédric Le Goater
On 11/9/22 00:13, John Johnson wrote: Server holds device current device pending state Use irq masking commands in socket case Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman May be use 'can_mask_irq' instead of 'irq_mask_works' Reviewed-by:

[PULL 07/14] qemu-config: Make config_parse_qdict() return bool

2022-12-14 Thread Markus Armbruster
This simplifies error checking. Cc: Hanna Reitz Signed-off-by: Markus Armbruster Message-Id: <20221121085054.683122-7-arm...@redhat.com> --- include/qemu/config-file.h | 2 +- block/blkdebug.c | 4 +--- util/qemu-config.c | 39 ++ 3 files

[PULL 08/14] qemu-config: Use ERRP_GUARD() where obviously appropriate

2022-12-14 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Message-Id: <20221121085054.683122-8-arm...@redhat.com> --- util/qemu-config.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/util/qemu-config.c b/util/qemu-config.c index e983607b46..8c907fa83b 100644 --- a/util/qemu-config.c +++

[PULL 11/14] io: Tidy up fat-fingered parameter name

2022-12-14 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Message-Id: <20221121085054.683122-11-arm...@redhat.com> Reviewed-by: Philippe Mathieu-Daudé --- include/io/channel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/io/channel.h b/include/io/channel.h index c680ee7480..f1b7e05f81

[PULL 13/14] block/vmdk: Simplify vmdk_co_create() to return directly

2022-12-14 Thread Markus Armbruster
Cc: Fam Zheng Cc: Kevin Wolf Cc: Hanna Reitz Cc: qemu-bl...@nongnu.org Signed-off-by: Markus Armbruster Message-Id: <20221122134917.1217307-3-arm...@redhat.com> Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- block/vmdk.c | 28 +++- 1 file changed,

[PULL 04/14] error: Move ERRP_GUARD() to the beginning of the function

2022-12-14 Thread Markus Armbruster
include/qapi/error.h advises to put ERRP_GUARD() right at the beginning of the function, because only then can it guard the whole function. Clean up the few spots disregarding the advice. Signed-off-by: Markus Armbruster Message-Id: <20221121085054.683122-4-arm...@redhat.com> Reviewed-by:

[PULL 02/14] error: Drop some obviously superfluous error_propagate()

2022-12-14 Thread Markus Armbruster
When error_propagate(errp, local_err) is the only reader of @local_err, we can just as well change its writers to write @errp directly, and drop the error_propagate() along with @local_err. Signed-off-by: Markus Armbruster Message-Id: <20221121085054.683122-2-arm...@redhat.com> Reviewed-by:

[PULL 06/14] monitor: Use ERRP_GUARD() in monitor_init()

2022-12-14 Thread Markus Armbruster
Cc: Dr. David Alan Gilbert Signed-off-by: Markus Armbruster Message-Id: <20221121085054.683122-6-arm...@redhat.com> --- monitor/monitor.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/monitor/monitor.c b/monitor/monitor.c index 86949024f6..7ed7bd5342 100644

[PULL 09/14] sockets: Use ERRP_GUARD() where obviously appropriate

2022-12-14 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Message-Id: <20221121085054.683122-9-arm...@redhat.com> --- util/qemu-sockets.c | 26 ++ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index d185245023..6538859b87 100644 ---

[PULL 14/14] ppc4xx_sdram: Simplify sdram_ddr_size() to return

2022-12-14 Thread Markus Armbruster
Suggested-by: BALATON Zoltan Signed-off-by: Markus Armbruster Message-Id: <87a64i87zp@pond.sub.org> Reviewed-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé --- hw/ppc/ppc4xx_sdram.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git

[PULL 00/14] Miscellaneous patches for 2022-12-14

2022-12-14 Thread Markus Armbruster
The following changes since commit ea3a008d2d9ced9c4f93871c823baee237047f93: Update VERSION for v7.2.0-rc4 (2022-12-06 19:53:34 -0500) are available in the Git repository at: https://repo.or.cz/qemu/armbru.git tags/pull-misc-2022-12-14 for you to fetch changes up to

[PULL 03/14] error: Drop a few superfluous ERRP_GUARD()

2022-12-14 Thread Markus Armbruster
include/qapi/error.h on ERRP_GUARD(): * It must be used when the function dereferences @errp or passes * @errp to error_prepend(), error_vprepend(), or error_append_hint(). * It is safe to use even when it's not needed, but please avoid * cluttering the source with useless code. Clean up

[PULL 05/14] monitor: Simplify monitor_fd_param()'s error handling

2022-12-14 Thread Markus Armbruster
Cc: Dr. David Alan Gilbert Signed-off-by: Markus Armbruster Message-Id: <20221121085054.683122-5-arm...@redhat.com> --- monitor/misc.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/monitor/misc.c b/monitor/misc.c index 205487e2b9..83d7f4ffde 100644 ---

[PULL 12/14] cleanup: Tweak and re-run return_directly.cocci

2022-12-14 Thread Markus Armbruster
Tweak the semantic patch to drop redundant parenthesis around the return expression. Coccinelle drops a comment in hw/rdma/vmw/pvrdma_cmd.c; restored manually. Coccinelle messes up vmdk_co_create(), not sure why. Change dropped, will be done manually in the next commit. Line breaks in

[PULL 10/14] qapi: Use returned bool to check for failure (again)

2022-12-14 Thread Markus Armbruster
Commit 012d4c96e2 changed the visitor functions taking Error ** to return bool instead of void, and the commits following it used the new return value to simplify error checking. Since then a few more uses in need of the same treatment crept in. Do that. All pretty mechanical except for *

[PULL 01/14] Drop more useless casts from void * to pointer

2022-12-14 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Laurent Vivier Message-Id: <20221123133811.1398562-1-arm...@redhat.com> --- bsd-user/elfload.c | 2 +- contrib/plugins/cache.c | 8 contrib/vhost-user-blk/vhost-user-blk.c | 2 +- hw/core/qdev-clock.c

Re: [PATCH] gdbstub: Have syscall_complete/[gs]et_reg to target agnostic typedefs

2022-12-14 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > On 14/12/22 15:36, Philippe Mathieu-Daudé wrote: >> Prototypes using gdb_syscall_complete_cb() or gdb_?et_reg_cb() >> don't depend on "cpu.h", thus are not target-specific. >> Signed-off-by: Philippe Mathieu-Daudé >> --- >> include/exec/gdbstub.h | 7 ---

Re: QEMU function trace

2022-12-14 Thread Alex Bennée
Claudio Fontana writes: > On 12/14/22 12:00, Alex Bennée wrote: >> >> Alex Bennée writes: >> >>> wanghw364 writes: >>> Thanks. I have several questions as below, please help, thanks. 1.What do you mean by "only have debug symbols available for linux-user so"? What does

Re: [RFC v3 1/3] memory: add depth assert in address_space_to_flatview

2022-12-14 Thread Chuang Xu
On 2022/12/13 下午9:35, Chuang Xu wrote: Before using any flatview, sanity check we're not during a memory region transaction or the map can be invalid. Signed-off-by: Chuang Xu --- include/exec/memory.h | 9 + softmmu/memory.c | 1 - 2 files changed, 9 insertions(+), 1 deletion(-)

Re: [RFC v3 2/3] virtio: support delay of checks in virtio_load()

2022-12-14 Thread Chuang Xu
On 2022/12/14 上午12:31, Peter Xu wrote: On Tue, Dec 13, 2022 at 09:35:09PM +0800, Chuang Xu wrote: Delay checks in virtio_load() to avoid possible address_space_to_flatview() call during memory region's begin/commit. I didn't notice virtio has the vm change handler already, looks good to reuse

Re: [PATCH] docs/acpi/bits: document BITS_DEBUG environment variable

2022-12-14 Thread Ani Sinha
On Mon, Dec 5, 2022 at 3:39 AM Wilfred Mallawa wrote: > > On Sat, 2022-12-03 at 13:23 +, Ani Sinha wrote: > > Debug specific actions can be enabled in bios bits acpi tests by > > passing > > BITS_DEBUG in the environment variable while running the test. > > Document that. > > > > CC:

Re: [PATCH v2] acpi/tests/avocado/bits: add SPDX license identifiers for bios bits tests

2022-12-14 Thread Ani Sinha
On Tue, Nov 29, 2022 at 3:41 PM Ani Sinha wrote: > > On Tue, Nov 29, 2022 at 2:18 PM Markus Armbruster wrote: > > > > Ani Sinha writes: > > > > > On Tue, Nov 29, 2022 at 10:37 AM Michael S. Tsirkin > > > wrote: > > >> > > >> On Tue, Nov 29, 2022 at 08:02:15AM +0530, Ani Sinha wrote: > > >> >

Re: [PATCH] acpi/tests/avocado/bits: add mformat as one of the dependencies

2022-12-14 Thread Ani Sinha
On Sat, Dec 3, 2022 at 6:54 PM Ani Sinha wrote: > > mformat is needed by grub-mkrescue and hence, add this as one of the > dependencies to run bits tests. This avoids errors such as the following: > > /var/tmp/acpi-bits-wju6tqoa.tmp/grub-inst-x86_64-efi/bin/grub-mkrescue: 360: > mformat: not

Re: [PATCH v3] virtio-rng: return available data with O_NONBLOCK

2022-12-14 Thread Martin Wilck
On Wed, 2022-12-14 at 14:41 +0100, Claudio Fontana wrote: > On 11/26/20 11:49, Laurent Vivier wrote: > > > Hi Laurent, Martin, > > is this resolved now? > > I wonder if this is covered by Laurent's kernel commit: > > commit 5c8e933050044d6dd2a000f9a5756ae73cbe7c44 > Author: Laurent Vivier >

Re: [PATCH] gdbstub: Have syscall_complete/[gs]et_reg to target agnostic typedefs

2022-12-14 Thread Richard Henderson
On 12/14/22 08:40, Philippe Mathieu-Daudé wrote: On 14/12/22 15:36, Philippe Mathieu-Daudé wrote: Prototypes using gdb_syscall_complete_cb() or gdb_?et_reg_cb() don't depend on "cpu.h", thus are not target-specific. Signed-off-by: Philippe Mathieu-Daudé ---   include/exec/gdbstub.h | 7

Re: [PATCH] gdbstub: move update guest debug to accel ops

2022-12-14 Thread Alex Bennée
Mads Ynddal writes: >> Isn't this '0' flag here accelerator-specific? ... > >> ... if so the prototype should be: >> >> int (*update_guest_debug)(CPUState *cpu); >> >> and the '0' value set within kvm-accel-ops.c handler implementation. >> > > You're right, we can avoid the additional

[PULL 18/51] block: Don't poll in bdrv_replace_child_noperm()

2022-12-14 Thread Kevin Wolf
In order to make sure that bdrv_replace_child_noperm() doesn't have to poll any more, get rid of the bdrv_parent_drained_begin_single() call. This is possible now because we can require that the parent is already drained through the child in question when the function is called and we don't call

[PULL 38/51] Import clang-tsa.h

2022-12-14 Thread Kevin Wolf
This defines macros that allow clang to perform Thread Safety Analysis based on function and variable annotations that specify the locking rules. On non-clang compilers, the annotations are ignored. Imported tsa.h from the original repository with the pthread_mutex_t wrapper removed:

Re: [PATCH 0/6] target/arm: general cleanups

2022-12-14 Thread Cornelia Huck
On Tue, Dec 13 2022, Fabiano Rosas wrote: > Hi folks, > > I'm splitting this big series from Claudio from last year into more > manageable chunks (at least for me): > > https://lore.kernel.org/r/20210416162824.25131-1-cfont...@suse.de > > This is the first chunk with only the most trivial

[PULL 08/51] block: Remove drained_end_counter

2022-12-14 Thread Kevin Wolf
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 the caller passes drained_end_counter, or whether they would poll for a local drained_end_counter to reach 0, these become a

Re: [PATCH] gdbstub: Have syscall_complete/[gs]et_reg to target agnostic typedefs

2022-12-14 Thread Philippe Mathieu-Daudé
On 14/12/22 15:36, Philippe Mathieu-Daudé wrote: Prototypes using gdb_syscall_complete_cb() or gdb_?et_reg_cb() don't depend on "cpu.h", thus are not target-specific. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/gdbstub.h | 7 --- 1 file changed, 4 insertions(+), 3

[PULL 45/51] block: remove unnecessary assert_bdrv_graph_writable()

2022-12-14 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito We don't protect bdrv->aio_context with the graph rwlock, so these assertions are not needed Signed-off-by: Emanuele Giuseppe Esposito Signed-off-by: Kevin Wolf Message-Id: <20221207131838.239125-13-kw...@redhat.com> Reviewed-by: Emanuele Giuseppe Esposito

[PULL 06/51] test-bdrv-drain: Don't yield in .bdrv_co_drained_begin/end()

2022-12-14 Thread Kevin Wolf
We want to change .bdrv_co_drained_begin/end() back to be non-coroutine callbacks, so in preparation, avoid yielding in their implementation. This does almost the same as the existing logic in bdrv_drain_invoke(), by creating and entering coroutines internally. However, since the test case is by

Re: [PATCH] tpm: add backend for mssim

2022-12-14 Thread Markus Armbruster
James Bottomley writes: > On Wed, 2022-12-14 at 11:31 +, Daniel P. Berrangé wrote: [...] >> These days, we have a policy of not tyring to map nested data onto >> the flat QemuOpts. This has been done in several areas and we've >> ended up with a mess of ever so slightly different impls

[PATCH] gdbstub: Have syscall_complete/[gs]et_reg to target agnostic typedefs

2022-12-14 Thread Philippe Mathieu-Daudé
Prototypes using gdb_syscall_complete_cb() or gdb_?et_reg_cb() don't depend on "cpu.h", thus are not target-specific. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/gdbstub.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/exec/gdbstub.h

[PULL 46/51] block: assert that graph read and writes are performed correctly

2022-12-14 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito Remove the old assert_bdrv_graph_writable, and replace it with the new version using graph-lock API. See the function documentation for more information. Signed-off-by: Emanuele Giuseppe Esposito Signed-off-by: Kevin Wolf Message-Id:

[PULL 39/51] clang-tsa: Add TSA_ASSERT() macro

2022-12-14 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Message-Id: <20221207131838.239125-7-kw...@redhat.com> Reviewed-by: Emanuele Giuseppe Esposito Signed-off-by: Kevin Wolf --- include/qemu/clang-tsa.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/qemu/clang-tsa.h b/include/qemu/clang-tsa.h index

[PULL 24/51] block/vmdk: add coroutine_fn annotations

2022-12-14 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito These functions end up calling bdrv_create() implemented as generated_co_wrapper functions. In addition, they also happen to be always called in coroutine context, meaning all callers are coroutine_fn. This means that the g_c_w function will enter the

[PULL 10/51] block: Fix locking for bdrv_reopen_queue_child()

2022-12-14 Thread Kevin Wolf
Callers don't agree whether bdrv_reopen_queue_child() should be called with the AioContext lock held or not. Standardise on holding the lock (as done by QMP blockdev-reopen and the replication block driver) and fix bdrv_reopen() to do the same. Signed-off-by: Kevin Wolf Message-Id:

[PULL 36/51] graph-lock: Implement guard macros

2022-12-14 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito Similar to the implementation in lockable.h, implement macros to automatically take and release the rdlock. Create the empty GraphLockable and GraphLockableMainloop structs only to use it as a type for G_DEFINE_AUTOPTR_CLEANUP_FUNC. Signed-off-by: Emanuele

[PULL 30/51] block-coroutine-wrapper.py: support functions without bs arg

2022-12-14 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito Right now, we take the first parameter of the function to get the BlockDriverState to pass to bdrv_poll_co(), that internally calls functions that figure in which aiocontext the coroutine should run. However, it is useless to pass a bs just to get its own

[PULL 12/51] block: Don't use subtree drains in bdrv_drop_intermediate()

2022-12-14 Thread Kevin Wolf
Instead of using a subtree drain from the top node (which also drains child nodes of base that we're not even interested in), use a normal drain for base, which automatically drains all of the parents, too. Signed-off-by: Kevin Wolf Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna

[PULL 42/51] test-bdrv-drain: Fix incorrrect drain assumptions

2022-12-14 Thread Kevin Wolf
The test case assumes that a drain only happens in one specific place where it drains explicitly. This assumption happened to hold true until now, but block layer functions may drain interally (any graph modifications are going to do that through bdrv_graph_wrlock()), so this is incorrect. Make

[PULL 26/51] block: distinguish between bdrv_create running in coroutine and not

2022-12-14 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito Call two different functions depending on whether bdrv_create is in coroutine or not, following the same pattern as generated_co_wrapper functions. This allows to also call the coroutine function directly, without using CreateCo or relying in bdrv_create().

[PULL 17/51] block: Drop out of coroutine in bdrv_do_drained_begin_quiesce()

2022-12-14 Thread Kevin Wolf
The next patch adds a parent drain to bdrv_attach_child_common(), which shouldn't be, but is currently called from coroutines in some cases (e.g. .bdrv_co_create implementations generally open new nodes). Therefore, the assertion that we're not in a coroutine doesn't hold true any more. We could

[PULL 50/51] block: use co_wrapper_mixed_bdrv_rdlock in functions taking the rdlock

2022-12-14 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito Take the rdlock already, before we add the assertions. All these functions either read the graph recursively, or call BlockDriver callbacks that will eventually need to be protected by the graph rdlock. Do it now to all functions together, because many of these

[PULL 40/51] clang-tsa: Add macros for shared locks

2022-12-14 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Message-Id: <20221207131838.239125-8-kw...@redhat.com> Reviewed-by: Emanuele Giuseppe Esposito Signed-off-by: Kevin Wolf --- include/qemu/clang-tsa.h | 4 1 file changed, 4 insertions(+) diff --git a/include/qemu/clang-tsa.h b/include/qemu/clang-tsa.h index

[PULL 16/51] block: Remove ignore_bds_parents parameter from drain_begin/end.

2022-12-14 Thread Kevin Wolf
ignore_bds_parents is now ignored during drain_begin and drain_end, so we can just remove it there. It is still a valid optimisation for drain_all in bdrv_drained_poll(), so leave it around there. Signed-off-by: Kevin Wolf Message-Id: <20221118174110.55183-13-kw...@redhat.com> Reviewed-by: Hanna

Re: [PATCH-for-8.0] coroutine: Add missing include

2022-12-14 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 14/12/22 08:58, Markus Armbruster wrote: >> Philippe Mathieu-Daudé writes: >> >>> qemu_co_mutex_assert_locked() calls qatomic_read(), which >>> is declared in . This fixes when refactoring: >>> >>>In file included from include/qemu/osdep.h:113, >>>

[PULL 47/51] graph-lock: TSA annotations for lock/unlock functions

2022-12-14 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Message-Id: <20221207131838.239125-15-kw...@redhat.com> Reviewed-by: Emanuele Giuseppe Esposito Signed-off-by: Kevin Wolf --- include/block/graph-lock.h | 80 +- block/graph-lock.c | 3 ++ 2 files changed, 73 insertions(+),

[PULL 41/51] configure: Enable -Wthread-safety if present

2022-12-14 Thread Kevin Wolf
This enables clang's thread safety analysis (TSA), which we'll use to statically check the block graph locking. Signed-off-by: Kevin Wolf Message-Id: <20221207131838.239125-9-kw...@redhat.com> Reviewed-by: Emanuele Giuseppe Esposito Signed-off-by: Kevin Wolf --- configure | 1 + 1 file

[PULL 43/51] block: Fix locking in external_snapshot_prepare()

2022-12-14 Thread Kevin Wolf
bdrv_img_create() polls internally (when calling bdrv_create(), which is a co_wrapper), so it can't be called while holding the lock of any AioContext except the current one without causing deadlocks. Drop the lock around the call in external_snapshot_prepare(). Signed-off-by: Kevin Wolf

[PULL 49/51] block-coroutine-wrapper.py: introduce annotations that take the graph rdlock

2022-12-14 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito Add co_wrapper_bdrv_rdlock and co_wrapper_mixed_bdrv_rdlock option to the block-coroutine-wrapper.py script. This "_bdrv_rdlock" option takes and releases the graph rdlock when a coroutine function is created. This means that when used together with "_mixed",

[PULL 28/51] block: rename generated_co_wrapper in co_wrapper_mixed

2022-12-14 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito In preparation to the incoming new function specifiers, rename g_c_w with a more meaningful name and document it. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy Message-Id: <20221128142337.657646-10-eespo...@redhat.com>

[PULL 25/51] block: avoid duplicating filename string in bdrv_create

2022-12-14 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito We know that the string will stay around until the function returns, and the parameter of drv->bdrv_co_create_opts is const char*, so it must not be modified either. Suggested-by: Kevin Wolf Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Kevin Wolf

[PULL 34/51] block: Factor out bdrv_drain_all_begin_nopoll()

2022-12-14 Thread Kevin Wolf
Provide a separate function that just quiesces the users of a node to prevent new requests from coming in, but without waiting for the already in-flight I/O to complete. This function can be used in contexts where polling is not allowed. Signed-off-by: Kevin Wolf Message-Id:

[PULL 27/51] block: bdrv_create_file is a coroutine_fn

2022-12-14 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito It is always called in coroutine_fn callbacks, therefore it can directly call bdrv_co_create(). Rename it to bdrv_co_create_file too. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Kevin Wolf Reviewed-by: Vladimir Sementsov-Ogievskiy Message-Id:

[PULL 20/51] block-io: introduce coroutine_fn duplicates for bdrv_common_block_status_above callers

2022-12-14 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito bdrv_common_block_status_above() is a g_c_w, and it is being called by many "wrapper" functions like bdrv_is_allocated(), bdrv_is_allocated_above() and bdrv_block_status_above(). Because we want to eventually split the coroutine from non-coroutine case in g_c_w,

[PULL 51/51] block: GRAPH_RDLOCK for functions only called by co_wrappers

2022-12-14 Thread Kevin Wolf
The generated coroutine wrappers already take care to take the lock in the non-coroutine path, and assume that the lock is already taken in the coroutine path. The only thing we need to do for the wrapped function is adding the GRAPH_RDLOCK annotation. Doing so also allows us to mark the

[PULL 11/51] block: Drain individual nodes during reopen

2022-12-14 Thread Kevin Wolf
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 than just draining the nodes individually, even not accounting for the additional complexity in the drain mechanism itself. Simplify the code by

Re: [PATCH] hw/cxl/device: Add Flex Bus Port DVSEC

2022-12-14 Thread Jonathan Cameron via
On Wed, 14 Dec 2022 12:39:45 + Jonathan Cameron via wrote: > On Tue, 13 Dec 2022 16:34:52 -0800 > Ira Weiny wrote: > > > The Flex Bus Port DVSEC was missing on type 3 devices which was blocking > > RAS checks.[1] > > > > Add the Flex Bus Port DVSEC to type 3 devices as per CXL 3.0

[PULL 13/51] stream: Replace subtree drain with a single node drain

2022-12-14 Thread Kevin Wolf
The subtree drain was introduced in commit b1e1af394d9 as a way to avoid graph changes between finding the base node and changing the block graph as necessary on completion of the image streaming job. The block graph could change between these two points because bdrv_set_backing_hd() first drains

[PULL 15/51] block: Call drain callbacks only once

2022-12-14 Thread Kevin Wolf
We only need to call both the BlockDriver's callback and the parent callbacks when going from undrained to drained or vice versa. A second drain section doesn't make a difference for the driver or the parent, they weren't supposed to send new requests before and after the second drain. One thing

[PULL 35/51] graph-lock: Introduce a lock to protect block graph operations

2022-12-14 Thread Kevin Wolf
From: Paolo Bonzini Block layer graph operations are always run under BQL in the main loop. This is proved by the assertion qemu_in_main_thread() and its wrapper macro GLOBAL_STATE_CODE. However, there are also concurrent coroutines running in other iothreads that always try to traverse the

[PULL 21/51] block-copy: add coroutine_fn annotations

2022-12-14 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito These functions end up calling bdrv_common_block_status_above(), a generated_co_wrapper function. In addition, they also happen to be always called in coroutine context, meaning all callers are coroutine_fn. This means that the g_c_w function will enter the

[PULL 32/51] block: convert bdrv_create to co_wrapper

2022-12-14 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito This function is never called in coroutine context, therefore instead of manually creating a new coroutine, delegate it to the block-coroutine-wrapper script, defining it as co_wrapper. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Kevin Wolf

[PULL 05/51] qed: Don't yield in bdrv_qed_co_drain_begin()

2022-12-14 Thread Kevin Wolf
We want to change .bdrv_co_drained_begin() back to be a non-coroutine callback, so in preparation, avoid yielding in its implementation. Because we increase bs->in_flight and bdrv_drained_begin() polls, the behaviour is unchanged. Signed-off-by: Kevin Wolf Reviewed-by: Vladimir

  1   2   >