[PATCH 04/23] block: Mark bdrv_co_block_status() and callers GRAPH_RDLOCK

2023-02-03 Thread Kevin Wolf
This adds GRAPH_RDLOCK annotations to declare that callers of bdrv_co_block_status() need to hold a reader lock for the graph. For some places, we know that they will hold the lock, but we don't have the GRAPH_RDLOCK annotations yet. In this case, add assume_graph_lock() with a FIXME comment. Thes

[PATCH 14/23] block: Mark bdrv_co_copy_range() GRAPH_RDLOCK

2023-02-03 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito This adds GRAPH_RDLOCK annotations to declare that callers of bdrv_co_copy_range() need to hold a reader lock for the graph. Signed-off-by: Emanuele Giuseppe Esposito Signed-off-by: Kevin Wolf --- include/block/block-io.h | 9 + include/block/

[PATCH 22/23] block: Mark bdrv_*_dirty_bitmap() and callers GRAPH_RDLOCK

2023-02-03 Thread Kevin Wolf
This adds GRAPH_RDLOCK annotations to declare that callers of bdrv_*_dirty_bitmap() need to hold a reader lock for the graph. Signed-off-by: Kevin Wolf --- include/block/block-io.h | 14 ++ include/block/block_int-common.h | 6 -- include/block/dirty-bitmap.h | 12 ++

[PATCH 16/23] block: Mark bdrv_co_create() and callers GRAPH_RDLOCK

2023-02-03 Thread Kevin Wolf
This adds GRAPH_RDLOCK annotations to declare that callers of bdrv_co_create() need to hold a reader lock for the graph. Signed-off-by: Emanuele Giuseppe Esposito Signed-off-by: Kevin Wolf --- include/block/block-global-state.h | 14 --- include/block/block_int-common.h | 11 +++--- block

[PATCH 20/23] block: Mark bdrv_(un)register_buf() GRAPH_RDLOCK

2023-02-03 Thread Kevin Wolf
This adds GRAPH_RDLOCK annotations to declare that callers of bdrv_register_buf() and bdrv_unregister_buf() need to hold a reader lock for the graph. Signed-off-by: Kevin Wolf --- include/block/block_int-common.h | 7 --- block/io.c | 14 ++ 2 files changed

[PATCH 07/23] block: Mark bdrv_co_flush() and callers GRAPH_RDLOCK

2023-02-03 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito This adds GRAPH_RDLOCK annotations to declare that callers of bdrv_co_flush() need to hold a reader lock for the graph. For some places, we know that they will hold the lock, but we don't have the GRAPH_RDLOCK annotations yet. In this case, add assume_graph_lock(

[PATCH 09/23] block: Mark bdrv_co_pwrite_zeroes() and callers GRAPH_RDLOCK

2023-02-03 Thread Kevin Wolf
This adds GRAPH_RDLOCK annotations to declare that callers of bdrv_co_pwrite_zeroes() need to hold a reader lock for the graph. For some places, we know that they will hold the lock, but we don't have the GRAPH_RDLOCK annotations yet. In this case, add assume_graph_lock() with a FIXME comment. The

[PATCH 10/23] block: Mark read/write in block/io.c GRAPH_RDLOCK

2023-02-03 Thread Kevin Wolf
This adds GRAPH_RDLOCK annotations to declare that callers of bdrv_driver_*() need to hold a reader lock for the graph. It doesn't add the annotation to public functions yet. For some places, we know that they will hold the lock, but we don't have the GRAPH_RDLOCK annotations yet. In this case, ad

[PATCH 18/23] block: Mark bdrv_co_is_inserted() and callers GRAPH_RDLOCK

2023-02-03 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito This adds GRAPH_RDLOCK annotations to declare that callers of bdrv_co_is_inserted() need to hold a reader lock for the graph. blk_is_inserted() is done as a co_wrapper_mixed_bdrv_rdlock (unlike most other blk_* functions) because it is called a lot from other blk

[PATCH 11/23] block: Mark public read/write functions GRAPH_RDLOCK

2023-02-03 Thread Kevin Wolf
This adds GRAPH_RDLOCK annotations to declare that callers of bdrv_co_pread*/pwrite*() need to hold a reader lock for the graph. For some places, we know that they will hold the lock, but we don't have the GRAPH_RDLOCK annotations yet. In this case, add assume_graph_lock() with a FIXME comment. Th

Re: [PULL 00/35] Monitor patches for 2023-02-03

2023-02-03 Thread Peter Maydell
On Fri, 3 Feb 2023 at 08:45, Markus Armbruster wrote: > > > The following changes since commit deabea6e88f7c4c3c12a36ee30051c6209561165: > > Merge tag 'for_upstream' of > https://git.kernel.org/pub/scm/virt/kvm/mst/qemu into staging (2023-02-02 > 10:10:07 +) > > are available in the Git re

Re: [PATCH] tests/docker: Use binaries for debian-tricore-cross

2023-02-03 Thread Bastian Koppelmann
Hi Phil, On Fri, Feb 03, 2023 at 04:02:16PM +0100, Philippe Mathieu-Daudé wrote: > Hi Bastian, > > On 3/2/23 15:54, Bastian Koppelmann wrote: > > since binutils is pretty old, it fails our CI repeatedly during the > > compilation of tricore-binutils. We created a precompiled version using > > the

Re: [PATCH v15 02/11] s390x/cpu topology: add topology entries on CPU hotplug

2023-02-03 Thread Nina Schoetterl-Glausch
On Fri, 2023-02-03 at 15:40 +0100, Pierre Morel wrote: > > On 2/3/23 14:22, Nina Schoetterl-Glausch wrote: > > On Fri, 2023-02-03 at 10:21 +0100, Pierre Morel wrote: > > > > > > On 2/2/23 17:42, Nina Schoetterl-Glausch wrote: > > > > On Wed, 2023-02-01 at 14:20 +0100, Pierre Morel wrote: > > > >

Re: [PATCH 6/6] gitlab-ci.d/buildtest: Disintegrate the build-coroutine-sigaltstack job

2023-02-03 Thread Thomas Huth
On 03/02/2023 13.08, Kevin Wolf wrote: Am 03.02.2023 um 12:23 hat Thomas Huth geschrieben: On 30/01/2023 11.58, Daniel P. Berrangé wrote: On Mon, Jan 30, 2023 at 11:44:46AM +0100, Thomas Huth wrote: We can get rid of the build-coroutine-sigaltstack job by moving the configure flags that should

Re: [PATCH 6/6] gitlab-ci.d/buildtest: Disintegrate the build-coroutine-sigaltstack job

2023-02-03 Thread Peter Maydell
On Fri, 3 Feb 2023 at 15:44, Thomas Huth wrote: > > On 03/02/2023 13.08, Kevin Wolf wrote: > > Am 03.02.2023 um 12:23 hat Thomas Huth geschrieben: > >> On 30/01/2023 11.58, Daniel P. Berrangé wrote: > >>> On Mon, Jan 30, 2023 at 11:44:46AM +0100, Thomas Huth wrote: > We can get rid of the bui

Re: [PATCH] tests/docker: Use binaries for debian-tricore-cross

2023-02-03 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > Hi Bastian, > > On 3/2/23 15:54, Bastian Koppelmann wrote: >> since binutils is pretty old, it fails our CI repeatedly during the >> compilation of tricore-binutils. We created a precompiled version using >> the debian docker image and download it instead of bui

Should qemu-system-loongarch64 support -smbios?

2023-02-03 Thread Markus Armbruster
Commit 3efa6fa1e62 "hw/loongarch: Add smbios support" enabled CONFIG_SMBIOS for target loongarch64, by adding select SMBIOS to hw/loongarch/Kconfig. It didn't enable CLI option -smbios in qemu-options.hx. It's enabled for the other targets that have CONFIG_SMBIOS. Was this an oversight? I

Re: [PATCH v2 10/15] hw/display/sm501: Embed OHCI QOM child in chipset

2023-02-03 Thread BALATON Zoltan
On Fri, 3 Feb 2023, Philippe Mathieu-Daudé wrote: Note this device doesn't implement unrealize(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: BALATON Zoltan --- hw/display/sm501.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/hw/display/sm501.

Re: [PATCH v2 11/15] hw/display/sm501: Alias 'dma-offset' QOM property in chipset object

2023-02-03 Thread BALATON Zoltan
On Fri, 3 Feb 2023, Philippe Mathieu-Daudé wrote: No need to use an intermediate 'dma-offset' property in the chipset object. Alias the property, so when the machine (here r2d-plus) sets the value on the chipset, it is propagated to the OHCI object. Note we can rename the chipset 'base' property

Re: [PATCH v2 12/15] hw/display/sm501: Unify common QOM properties

2023-02-03 Thread BALATON Zoltan
On Fri, 3 Feb 2023, Philippe Mathieu-Daudé wrote: Since now PCI and SysBus properties are identical, unify them. Suggested-by: BALATON Zoltan Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: BALATON Zoltan --- hw/display/sm501.c | 11 +++ 1 file changed, 3 insertions(+), 8 deleti

Re: [RFC PATCH] gitlab: call ninja directly and reduce build noise

2023-02-03 Thread Alex Bennée
Richard Henderson writes: > On 2/2/23 08:59, Alex Bennée wrote: >>> +- env NINJA_STATUS="[ninja][%f/%t] " ninja | fgrep -v "[ninja]" >>> - if test -n "$MAKE_CHECK_ARGS"; >>> then >>> make -j"$JOBS" $MAKE_CHECK_ARGS ; >> This is too much for gitlab as it trips up on n

Re: [RFC PATCH] gitlab: call ninja directly and reduce build noise

2023-02-03 Thread Alex Bennée
Thomas Huth writes: > On 02/02/2023 19.59, Alex Bennée wrote: >> Alex Bennée writes: >> >>> A significant portion of our CI logs are just enumerating each >>> successfully built object file. The current widespread versions of >>> ninja don't have a quiet option so we use NINJA_STATUS to add a

[PATCH 2/3] hw/acpi/cpu_hotplug: Rename 'parent' MemoryRegion as 'container'

2023-02-03 Thread Philippe Mathieu-Daudé
No logical change, rename for clarity. Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/acpi-cpu-hotplug-stub.c | 2 +- hw/acpi/cpu_hotplug.c | 10 +- hw/acpi/piix4.c | 10 +- include/hw/acpi/cpu_hotplug.h | 2 +- 4 files changed, 12 insertions(+),

[PATCH 0/3] hw/acpi/cpu_hotplug: Convert 'Object *device' -> 'DeviceState *parent'

2023-02-03 Thread Philippe Mathieu-Daudé
To ease code review, rename ACPI CPU hotplug variables to more meaningful names. Since hotplug parent can't be any QOM object, and must be a QDev, convert AcpiCpuHotplug::device from Object* to DeviceState*. Philippe Mathieu-Daudé (3): hw/acpi/cpu_hotplug: Rename gpe_cpu -> gpe hw/acpi/cpu_ho

[PATCH 3/3] hw/acpi/cpu_hotplug: Convert 'Object *device' -> 'DeviceState *parent'

2023-02-03 Thread Philippe Mathieu-Daudé
ACPI CPU hotplug parent can't be any QOM object, it must be a QDev. Convert AcpiCpuHotplug::device field as QDev to enforce this. Rename 'owner' and 'device' variables as 'parent'. Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/acpi-cpu-hotplug-stub.c | 2 +- hw/acpi/cpu_hotplug.c

[PATCH 1/3] hw/acpi/cpu_hotplug: Rename gpe_cpu -> gpe

2023-02-03 Thread Philippe Mathieu-Daudé
Rename 'g' and 'gpe_cpu' variables as 'gpe' to simplify. No logical change. Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/acpi-cpu-hotplug-stub.c | 6 ++--- hw/acpi/cpu_hotplug.c | 40 - hw/acpi/ich9.c | 8 +++ hw/acpi/piix4.c

RE: [PATCH v4 04/16] hw/9pfs: Implement Windows specific xxxdir() APIs

2023-02-03 Thread Shi, Guohuai
> -Original Message- > From: Christian Schoenebeck > Sent: Friday, February 3, 2023 22:41 > To: Greg Kurz ; qemu-devel@nongnu.org > Cc: Meng, Bin ; Marc-André Lureau > ; Daniel P. Berrangé ; Shi, > Guohuai > Subject: Re: [PATCH v4 04/16] hw/9pfs: Implement Windows specific xxxdir() > A

Re: [PATCH] target/riscv: fix ctzw behavior

2023-02-03 Thread Richard Henderson
On 2/3/23 04:00, Vladimir Isaev wrote: According to spec, ctzw should work with 32-bit register, not 64. For example, previous implementation returns 33 for (1<<33) input when the new one returns 32. Signed-off-by: Vladimir Isaev --- target/riscv/insn_trans/trans_rvb.c.inc | 9 - 1

Re: [PATCH 12/13] block: Fix bdrv_co_create_opts_simple() to open images with no_co_wrapper

2023-02-03 Thread Eric Blake
On Thu, Jan 26, 2023 at 06:24:31PM +0100, Kevin Wolf wrote: > bdrv_co_create_opts_simpl() runs in a coroutine. Therefore it is not simple > allowed to open images directly. Fix the call to use the corresponding > no_co_wrapper instead. > > Signed-off-by: Kevin Wolf > --- > block.c | 4 ++-- >

[PATCH] accel/tcg: test CPUJumpCache in tb_jmp_cache_clear_page()

2023-02-03 Thread Eric Auger
After commit 4e4fa6c12d ("accel/tcg: Complete cpu initialization before registration"), it looks the CPUJumpCache handle can be NULL. This causes a SIGSEV when running debug-wp-migration kvm unit test. At the first place it should be clarified why this TCG code is called with KVM acceleration. Thi

[PATCH] target/arm: Add raw_writes ops for register whose write induce TLB maintenance

2023-02-03 Thread Eric Auger
Many registers whose 'cooked' writefns induce TLB maintenance do not have raw_writefn ops defined. If only the writefn ops is set (ie. no raw_writefn is provided), it is assumed the cooked also work as the raw one. For those registers it is not obvious the tlb_flush works on KVM mode so better/safe

[PATCH] tcg/aarch64: Fix patching of LDR in tb_target_set_jmp_target

2023-02-03 Thread Richard Henderson
'offset' should be bits [23:5] of LDR instruction, rather than [4:0]. Fixes: d59d83a1c388 ("tcg/aarch64: Reorg goto_tb implementation") Reported-by: Zenghui Yu Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t

Re: [PATCH] accel/tcg: test CPUJumpCache in tb_jmp_cache_clear_page()

2023-02-03 Thread Philippe Mathieu-Daudé
On 3/2/23 18:15, Eric Auger wrote: After commit 4e4fa6c12d ("accel/tcg: Complete cpu initialization before registration"), it looks the CPUJumpCache handle can be NULL. This causes a SIGSEV when running debug-wp-migration kvm unit test. Do you mean commit a976a99a29 ("include/hw/core: Create st

Re: [PATCH] accel/tcg: test CPUJumpCache in tb_jmp_cache_clear_page()

2023-02-03 Thread Eric Auger
Hi Philippe, On 2/3/23 18:21, Philippe Mathieu-Daudé wrote: > On 3/2/23 18:15, Eric Auger wrote: >> After commit 4e4fa6c12d ("accel/tcg: Complete cpu initialization >> before registration"), it looks the CPUJumpCache handle can be NULL. >> This causes a SIGSEV when running debug-wp-migration kvm un

Re: [PATCH] tcg/aarch64: Fix patching of LDR in tb_target_set_jmp_target

2023-02-03 Thread Philippe Mathieu-Daudé
On 3/2/23 18:18, Richard Henderson wrote: 'offset' should be bits [23:5] of LDR instruction, rather than [4:0]. Fixes: d59d83a1c388 ("tcg/aarch64: Reorg goto_tb implementation") Reported-by: Zenghui Yu Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.c.inc | 2 +- 1 file changed,

Re: ASan reports use-after-free when running munmap-pthread

2023-02-03 Thread Richard Henderson
On 2/3/23 01:23, Alex Bennée wrote: Anton Johansson writes: Hi, I was running check-tcg with ASan enabled on master, and ran into the following use-after-free. There appears to be a race between jump cache invalidation and thread destruction (?) I thought I'd post here since I noticed some

Re: [PATCH v15 03/11] target/s390x/cpu topology: handle STSI(15) and build the SYSIB

2023-02-03 Thread Nina Schoetterl-Glausch
On Wed, 2023-02-01 at 14:20 +0100, Pierre Morel wrote: > > On interception of STSI(15.1.x) the System Information Block > > (SYSIB) is built from the list of pre-ordered topology entries. > > > > Signed-off-by: Pierre Morel > > --- > > include/hw/s390x/cpu-topology.h | 22 +++ > > include/hw/s3

Re: [PATCH] tcg/aarch64: Fix patching of LDR in tb_target_set_jmp_target

2023-02-03 Thread Richard Henderson
On 2/3/23 07:25, Philippe Mathieu-Daudé wrote: On 3/2/23 18:18, Richard Henderson wrote: 'offset' should be bits [23:5] of LDR instruction, rather than [4:0]. Fixes: d59d83a1c388 ("tcg/aarch64: Reorg goto_tb implementation") Reported-by: Zenghui Yu Signed-off-by: Richard Henderson ---   tcg/a

Re: [PULL v2 00/36] Testing, docs, semihosting and plugin updates

2023-02-03 Thread Philippe Mathieu-Daudé
On 2/2/23 17:01, Alex Bennée wrote: The following changes since commit 026817fb69414c9d3909d8b1a209f90180d777d6: Merge tag 'python-pull-request' of https://gitlab.com/jsnow/qemu into staging (2023-02-01 16:15:56 +) are available in the Git repository at: https://gitlab.com/stsquad/q

Re: [PATCH v4 04/16] hw/9pfs: Implement Windows specific xxxdir() APIs

2023-02-03 Thread Christian Schoenebeck
On Friday, February 3, 2023 5:30:35 PM CET Shi, Guohuai wrote: > > > -Original Message- > > From: Christian Schoenebeck > > Sent: Friday, February 3, 2023 22:41 > > To: Greg Kurz ; qemu-devel@nongnu.org > > Cc: Meng, Bin ; Marc-André Lureau > > ; Daniel P. Berrangé ; > > Shi, > > Guohuai

Re: [RFC v3 18/18] vfio/as: Allow the selection of a given iommu backend

2023-02-03 Thread Eric Auger
Hi Jason, On 2/3/23 13:51, Jason Gunthorpe wrote: > On Tue, Jan 31, 2023 at 09:53:05PM +0100, Eric Auger wrote: >> Now we support two types of iommu backends, let's add the capability >> to select one of them. This depends on whether an iommufd object has >> been linked with the vfio-pci device: >

Re: [RFC v3 18/18] vfio/as: Allow the selection of a given iommu backend

2023-02-03 Thread Jason Gunthorpe
On Fri, Feb 03, 2023 at 06:57:02PM +0100, Eric Auger wrote: > Hi Jason, > > On 2/3/23 13:51, Jason Gunthorpe wrote: > > On Tue, Jan 31, 2023 at 09:53:05PM +0100, Eric Auger wrote: > >> Now we support two types of iommu backends, let's add the capability > >> to select one of them. This depends on

Re: [PATCH] target/arm: Add raw_writes ops for register whose write induce TLB maintenance

2023-02-03 Thread Peter Maydell
On Fri, 3 Feb 2023 at 17:17, Eric Auger wrote: > > Many registers whose 'cooked' writefns induce TLB maintenance do > not have raw_writefn ops defined. If only the writefn ops is set > (ie. no raw_writefn is provided), it is assumed the cooked also > work as the raw one. For those registers it is

Re: [RFC v3 00/18] vfio: Adopt iommufd

2023-02-03 Thread Eric Auger
On 2/3/23 13:57, Jason Gunthorpe wrote: > On Tue, Jan 31, 2023 at 09:52:47PM +0100, Eric Auger wrote: >> Given some iommufd kernel limitations, the iommufd backend is >> not yuet fully on par with the legacy backend w.r.t. features like: >> - p2p mappings (you will see related error traces) >> -

Re: [PATCH] target/arm: Add raw_writes ops for register whose write induce TLB maintenance

2023-02-03 Thread Eric Auger
Hi Peter, On 2/3/23 19:04, Peter Maydell wrote: > On Fri, 3 Feb 2023 at 17:17, Eric Auger wrote: >> Many registers whose 'cooked' writefns induce TLB maintenance do >> not have raw_writefn ops defined. If only the writefn ops is set >> (ie. no raw_writefn is provided), it is assumed the cooked al

Re: ASan reports use-after-free when running munmap-pthread

2023-02-03 Thread Richard Henderson
On 2/3/23 07:34, Richard Henderson wrote: On 2/3/23 01:23, Alex Bennée wrote: Anton Johansson writes: Hi, I was running check-tcg with ASan enabled on master, and ran into the following use-after-free. There appears to be a race between jump cache invalidation and thread destruction (?) I

[PATCH 00/19] hw: Set QDev properties using QDev API (part 1/3)

2023-02-03 Thread Philippe Mathieu-Daudé
QEMU provides the QOM API for core objects. Devices are modelled on top of QOM as QDev objects. There is no point in using the lower level QOM API with QDev; it makes the code more complex and harder to review. I first converted all the calls using errp=&error_abort or &errp=NULL, then noticed th

[PATCH 03/19] hw/acpi: Set QDev properties using QDev API

2023-02-03 Thread Philippe Mathieu-Daudé
No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/cpu_hotplug.c | 7 +++ hw/acpi/ich9.c| 4 ++-- hw/acpi/piix4.c | 4 ++-- 3 files changed, 7 insertions(+),

[PATCH 04/19] hw/audio: Set QDev properties using QDev API

2023-02-03 Thread Philippe Mathieu-Daudé
No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/audio/pcspk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/audio/pcspk.h b/include/hw/au

[PATCH 02/19] hw/qdev: Introduce qdev_prop_set_link()

2023-02-03 Thread Philippe Mathieu-Daudé
Introduce qdev_prop_set_link(), equivalent of object_property_set_link() for QDev objects. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/qdev-properties.c| 5 + include/hw/qdev-properties.h | 1 + 2 files changed, 6 insertions(+) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev

[PATCH 10/19] hw/avr: Set QDev properties using QDev API

2023-02-03 Thread Philippe Mathieu-Daudé
No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé --- hw/avr/arduino.c | 4 ++-- hw/avr/atmega.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/avr/arduino.c

[PATCH 06/19] hw/core/gpio: Set QDev properties using QDev API

2023-02-03 Thread Philippe Mathieu-Daudé
No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/gpio.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/core/gpio.c b/hw/core/gpio.c index 80d0

[PATCH 14/19] hw/microblaze: Set QDev properties using QDev API

2023-02-03 Thread Philippe Mathieu-Daudé
No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé --- hw/microblaze/petalogix_ml605_mmu.c | 40 +++- hw/microblaze/petalogix_s3adsp1800_mmu.c | 2 +- hw/microbla

[RFC PATCH 17/19] hw/riscv: Set QDev properties using QDev API

2023-02-03 Thread Philippe Mathieu-Daudé
No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé --- hw/riscv/microchip_pfsoc.c | 8 hw/riscv/opentitan.c | 9 +++-- hw/riscv/shakti_c.c| 7 +++ hw/risc

[RFC PATCH 05/19] hw/core/numa: Set QDev properties using QDev API

2023-02-03 Thread Philippe Mathieu-Daudé
No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/numa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/core/numa.c b/hw/core/numa.c index d8d36b16

[PATCH 11/19] hw/hppa: Set QDev properties using QDev API

2023-02-03 Thread Philippe Mathieu-Daudé
No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé --- hw/hppa/machine.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index d

[RFC PATCH 15/19] hw/mips: Set QDev properties using QDev API

2023-02-03 Thread Philippe Mathieu-Daudé
No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/boston.c | 6 ++ hw/mips/cps.c| 42 ++ hw/mips/jazz.c | 3 +-- hw/mips/ma

[PATCH 09/19] hw/virtio: Set QDev properties using QDev API

2023-02-03 Thread Philippe Mathieu-Daudé
No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé --- hw/display/virtio-gpu-pci.c | 4 ++-- hw/display/virtio-vga.c | 4 ++-- hw/virtio/virtio-iommu-pci.c | 3 +-- hw/virtio/virtio-

[RFC PATCH 12/19] hw/i386: Set QDev properties using QDev API

2023-02-03 Thread Philippe Mathieu-Daudé
No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 8 +++- hw/i386/pc_q35.c | 25 +++-- hw/i386/sgx.c | 3 +-- hw/i386

[PATCH 19/19] hw/sparc: Set QDev properties using QDev API

2023-02-03 Thread Philippe Mathieu-Daudé
No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé --- hw/dma/sparc32_dma.c | 6 +++--- hw/sparc/sun4m.c | 10 -- hw/sparc64/sun4u.c | 3 +-- 3 files changed, 8 insertions(

[PATCH 01/19] NOTFORMERGE scripts/coccinelle: Add qom-qdev-prop.cocci

2023-02-03 Thread Philippe Mathieu-Daudé
Script I used to generate the following patches. This is not an automatic conversion as object_property_set_[u]int() does not specify the type size. Each integer property must then be converted manually. Therefore this script doesn't seem relevant to be committed in the repository. Signed-off-by:

[PATCH 16/19] hw/nios2: Set QDev properties using QDev API

2023-02-03 Thread Philippe Mathieu-Daudé
No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé --- hw/nios2/10m50_devboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nios2/10m50_devboard.c b/hw/nios2/10

[PATCH 13/19] hw/m68k: Set QDev properties using QDev API

2023-02-03 Thread Philippe Mathieu-Daudé
No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé --- hw/m68k/next-cube.c | 2 +- hw/m68k/q800.c | 7 +++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/m68k/n

Re: [PATCH 00/19] hw: Set QDev properties using QDev API (part 1/3)

2023-02-03 Thread Philippe Mathieu-Daudé
On 3/2/23 19:08, Philippe Mathieu-Daudé wrote: QEMU provides the QOM API for core objects. Devices are modelled on top of QOM as QDev objects. There is no point in using the lower level QOM API with QDev; it makes the code more complex and harder to review. I first converted all the calls using

[PATCH 18/19] hw/rx: Set QDev properties using QDev API

2023-02-03 Thread Philippe Mathieu-Daudé
No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé --- hw/rx/rx-gdbsim.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/rx/rx-gdbsim.c b/hw/rx/rx-gdbsim

[PATCH 08/19] hw/usb: Set QDev properties using QDev API

2023-02-03 Thread Philippe Mathieu-Daudé
No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé --- hw/usb/hcd-xhci-pci.c| 2 +- hw/usb/hcd-xhci-sysbus.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/u

[RFC PATCH 07/19] hw/scsi: Set QDev properties using QDev API

2023-02-03 Thread Philippe Mathieu-Daudé
No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé --- hw/scsi/scsi-bus.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c i

[RFC PATCH] tests/avocado: retire the Aarch64 TCG tests from boot_linux.py

2023-02-03 Thread Alex Bennée
The two TCG tests for GICv2 and GICv3 are very heavy weight distros that take a long time to boot up, especially for an --enable-debug build. The total code coverage they give is: Overall coverage rate: lines..: 11.2% (59584 of 530123 lines) functions..: 15.0% (7436 of 49443 function

[PATCH v4 4/4] qapi: update pylint configuration

2023-02-03 Thread John Snow
Newer versions of pylint disable the "no-self-use" message by default. Older versions don't, though. If we leave the suppressions in, pylint yelps about useless options. Just tell pylint to shush. Signed-off-by: John Snow --- scripts/qapi/pylintrc | 1 + 1 file changed, 1 insertion(+) diff --gi

[PATCH v4 3/4] qapi: Update flake8 config

2023-02-03 Thread John Snow
New versions of flake8 don't like same-line comments. (It's a version newer than what fc37 ships, but it still makes my life easier to fix it now.) Signed-off-by: John Snow --- scripts/qapi/.flake8 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/qapi/.flake8 b/scrip

[PATCH v4 1/4] [DO-NOT-MERGE] docs: enable sphinx-autodoc for scripts/qapi

2023-02-03 Thread John Snow
This is just POC to prove that the docstrings, where they are written, are correct to some minimum standard. It is included here for reviewing/testing convenience. Signed-off-by: John Snow --- docs/conf.py | 3 ++- docs/devel/index.rst | 1 + docs/deve

[PATCH v4 2/4] [DO-NOT-MERGE]: Add some ad-hoc linting helpers.

2023-02-03 Thread John Snow
These aren't ready for upstream inclusion, because they do not properly manage version dependencies, execution environment and so on. These are just the tools I use in my Own Special Environment :tm: for testing and debugging. They've been tested only on Fedora 37 for right now, which means: Pyth

[PATCH v4 0/4] [DO-NOT-MERGE] qapi: static typing conversion, "pt0"

2023-02-03 Thread John Snow
This is a manual testing pre-requisite for other QAPI cleanup patches. It isn't meant for inclusion, it's included here as an informative basis for ongoing work only. (Except for the last two patches, which you should totally merge.) sphinx-autodoc is enabled for the scripts/qapi package so that

Re: [PULL 00/33] target-arm queue

2023-02-03 Thread Peter Maydell
ilable in the Git repository at: > > https://git.linaro.org/people/pmaydell/qemu-arm.git > tags/pull-target-arm-20230203 > > for you to fetch changes up to bb18151d8bd9bedc497ee9d4e8d81b39a4e5bbf6: > > target/arm: Enab

Re: [PATCH 00/19] hw: Set QDev properties using QDev API (part 1/3)

2023-02-03 Thread BALATON Zoltan
On Fri, 3 Feb 2023, Philippe Mathieu-Daudé wrote: On 3/2/23 19:08, Philippe Mathieu-Daudé wrote: QEMU provides the QOM API for core objects. Devices are modelled on top of QOM as QDev objects. There is no point in using the lower level QOM API with QDev; it makes the code more complex and harde

[PATCH 06/13] vdpa net: allow VHOST_F_LOG_ALL

2023-02-03 Thread Eugenio Pérez
Since some actions move to the start function instead of init, the device features may not be the parent vdpa device's, but the one returned by vhost backend. If transition to SVQ is supported, the vhost backend will return _F_LOG_ALL to signal the device is migratable. Add VHOST_F_LOG_ALL. HW d

[PATCH 00/13] Dynamycally switch to vhost shadow virtqueues at vdpa net migration

2023-02-03 Thread Eugenio Pérez
It's possible to migrate vdpa net devices if they are shadowed from the start. But to always shadow the dataplane is to effectively break its host passthrough, so its not convenient in vDPA scenarios. This series enables dynamically switching to shadow mode only at migration time. This allows fu

[PATCH 11/13] vdpa: block migration if dev does not have _F_SUSPEND

2023-02-03 Thread Eugenio Pérez
Next patches enable devices to be migrated even if vdpa netdev has not been started with x-svq. However, not all devices are migratable, so we need to block migration if we detect that. Block vhost-vdpa device migration if it does not offer _F_SUSPEND and it has not been started with x-svq. Signe

[PATCH 02/13] vdpa: Negotiate _F_SUSPEND feature

2023-02-03 Thread Eugenio Pérez
This is needed for qemu to know it can suspend the device to retrieve its status and enable SVQ with it, so all the process is transparent to the guest. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- hw/virtio/vhost-vdpa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --g

[PATCH 13/13] vdpa: return VHOST_F_LOG_ALL in vhost-vdpa devices

2023-02-03 Thread Eugenio Pérez
vhost-vdpa devices can return this features now that blockers have been set in case some features are not met. Expose VHOST_F_LOG_ALL only in that case. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/virtio/vhost-

[PATCH 03/13] vdpa: add vhost_vdpa_suspend

2023-02-03 Thread Eugenio Pérez
The function vhost.c:vhost_dev_stop fetches the vring base so the vq state can be migrated to other devices. However, this is unreliable in vdpa, since we didn't signal the device to suspend the queues, making the value fetched useless. Suspend the device if possible before fetching first and sub

[PATCH 07/13] vdpa: add vdpa net migration state notifier

2023-02-03 Thread Eugenio Pérez
This allows net to restart the device backend to configure SVQ on it. Ideally, these changes should not be net specific. However, the vdpa net backend is the one with enough knowledge to configure everything because of some reasons: * Queues might need to be shadowed or not depending on its kind (

[PATCH 01/13] vdpa net: move iova tree creation from init to start

2023-02-03 Thread Eugenio Pérez
Only create iova_tree if and when it is needed. The cleanup keeps being responsible of last VQ but this change allows it to merge both cleanup functions. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- net/vhost-vdpa.c | 99 ++-- 1 file changed

[PATCH 09/13] vdpa net: block migration if the device has CVQ

2023-02-03 Thread Eugenio Pérez
Devices with CVQ needs to migrate state beyond vq state. Leaving this to future series. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index bca13f97fd..309861e56c 100644 --- a/net/vhost-vdpa.c +++

[PATCH 10/13] vdpa: block migration if device has unsupported features

2023-02-03 Thread Eugenio Pérez
A vdpa net device must initialize with SVQ in order to be migratable at this moment, and initialization code verifies some conditions. If the device is not initialized with the x-svq parameter, it will not expose _F_LOG so the vhost subsystem will block VM migration from its initialization. Next

[PATCH 04/13] vdpa: move vhost reset after get vring base

2023-02-03 Thread Eugenio Pérez
The function vhost.c:vhost_dev_stop calls vhost operation vhost_dev_start(false). In the case of vdpa it totally reset and wipes the device, making the fetching of the vring base (virtqueue state) totally useless. The kernel backend does not use vhost_dev_start vhost op callback, but vhost-user do

[PATCH 05/13] vdpa: rewind at get_base, not set_base

2023-02-03 Thread Eugenio Pérez
At this moment it is only possible to migrate to a vdpa device running with x-svq=on. As a protective measure, the rewind of the inflight descriptors was done at the destination. That way if the source sent a virtqueue with inuse descriptors they are always discarded. Since this series allows to m

[PATCH 12/13] vdpa: block migration if SVQ does not admit a feature

2023-02-03 Thread Eugenio Pérez
Next patches enable devices to be migrated even if vdpa netdev has not been started with x-svq. However, not all devices are migratable, so we need to block migration if we detect that. Block migration if we detect the device expose a feature SVQ does not know how to work with. Signed-off-by: Eug

[PATCH 08/13] vdpa: disable RAM block discard only for the first device

2023-02-03 Thread Eugenio Pérez
Although it does not make a big difference, its more correct and simplifies the cleanup path in subsequent patches. Move ram_block_discard_disable(false) call to the top of vhost_vdpa_cleanup because: * We cannot use vhost_vdpa_first_dev after dev->opaque = NULL assignment. * Improve the stack o

Re: [PATCH v5 1/3] arm/virt: don't try to spell out the accelerator

2023-02-03 Thread Richard Henderson
On 2/3/23 03:44, Cornelia Huck wrote: Just use current_accel_name() directly. Signed-off-by: Cornelia Huck --- hw/arm/virt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Richard Henderson r~

[PATCH] hw/ppc/pegasos2: Fix a typo in a comment

2023-02-03 Thread BALATON Zoltan
Reported-by: Stefan Weil Signed-off-by: BALATON Zoltan --- hw/ppc/pegasos2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c index 1a13632ba6..a9563f4fb2 100644 --- a/hw/ppc/pegasos2.c +++ b/hw/ppc/pegasos2.c @@ -564,7 +564,7 @@ static vo

Re: [PATCH V2 1/2] migration: Introduce interface query-migrationthreads

2023-02-03 Thread Juan Quintela
Jiang Jiacheng wrote: > Introduce interface query-migrationthreads. The interface is used > to query information about migration threads and returns with > migration thread's name and its id. > Introduce threadinfo.c to manage threads with migration. > > Signed-off-by: Jiang Jiacheng Reviewed-by

Re: [PATCH V2 2/2] migration: save/delete migration thread info

2023-02-03 Thread Juan Quintela
Jiang Jiacheng wrote: > To support query migration thread infomation, save and delete > thread(live_migration and multifdsend) information at thread > creation and finish. > > Signed-off-by: Jiang Jiacheng Reviewed-by: Juan Quintela

Re: [RFC PATCH] tests/avocado: retire the Aarch64 TCG tests from boot_linux.py

2023-02-03 Thread Fabiano Rosas
Alex Bennée writes: > The two TCG tests for GICv2 and GICv3 are very heavy weight distros > that take a long time to boot up, especially for an --enable-debug > build. The total code coverage they give is: > > Overall coverage rate: > lines..: 11.2% (59584 of 530123 lines) > functio

Re: [PATCH v5 2/3] arm/kvm: add support for MTE

2023-02-03 Thread Richard Henderson
On 2/3/23 03:44, Cornelia Huck wrote: +static void aarch64_cpu_get_mte(Object *obj, Visitor *v, const char *name, +void *opaque, Error **errp) +{ +ARMCPU *cpu = ARM_CPU(obj); +OnOffAuto mte = cpu->prop_mte; + +visit_type_OnOffAuto(v, name, &mte, errp);

Re: [RFC PATCH] tests/avocado: retire the Aarch64 TCG tests from boot_linux.py

2023-02-03 Thread Richard Henderson
On 2/3/23 08:16, Alex Bennée wrote: The two TCG tests for GICv2 and GICv3 are very heavy weight distros that take a long time to boot up, especially for an --enable-debug build. The total code coverage they give is: Overall coverage rate: lines..: 11.2% (59584 of 530123 lines) f

Re: [PATCH] hw/ppc/pegasos2: Fix a typo in a comment

2023-02-03 Thread Philippe Mathieu-Daudé
On 3/2/23 20:43, BALATON Zoltan wrote: Reported-by: Stefan Weil Signed-off-by: BALATON Zoltan --- hw/ppc/pegasos2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v2 3/3] util/userfaultfd: Support /dev/userfaultfd

2023-02-03 Thread Juan Quintela
Peter Xu wrote: > On Thu, Feb 02, 2023 at 11:52:21AM +0100, Juan Quintela wrote: >> Peter Xu wrote: >> > Teach QEMU to use /dev/userfaultfd when it existed and fallback to the >> > system call if either it's not there or doesn't have enough permission. >> > >> > Firstly, as long as the app has pe

Re: [PATCH v10 1/3] hw/riscv: handle 32 bit CPUs kernel_addr in riscv_load_kernel()

2023-02-03 Thread Daniel Henrique Barboza
Hey, On 2/3/23 07:45, Bin Meng wrote: Hi Daniel, On Fri, Feb 3, 2023 at 6:31 PM Daniel Henrique Barboza wrote: On 2/3/23 02:39, Bin Meng wrote: On Thu, Feb 2, 2023 at 9:58 PM Daniel Henrique Barboza wrote: load_elf_ram_sym() will sign-extend 32 bit addresses. If a 32 bit QEMU guest hap

Re: [PATCH 6/6] gitlab-ci.d/buildtest: Disintegrate the build-coroutine-sigaltstack job

2023-02-03 Thread Juan Quintela
Kevin Wolf wrote: > Am 03.02.2023 um 12:23 hat Thomas Huth geschrieben: >> On 30/01/2023 11.58, Daniel P. Berrangé wrote: >> > On Mon, Jan 30, 2023 at 11:44:46AM +0100, Thomas Huth wrote: >> > > We can get rid of the build-coroutine-sigaltstack job by moving >> > > the configure flags that should

<    1   2   3   4   >