Re: [PATCH for-9.2] hw/arm/sbsa-ref: Don't leak string in sbsa_fdt_add_gic_node()

2024-08-22 Thread Philippe Mathieu-Daudé
On 22/8/24 18:23, Peter Maydell wrote: In sbsa_fdt_add_gic_node() we g_strdup_printf() two nodename strings, but only free one. Since the string is actually entirely constant and we don't make any use of printf's format-string operations, we can drop the g_strdup_printf() use entirely. Signed-o

[PATCH] target/riscv: fix za64rs enabling

2024-08-22 Thread Vladimir Isaev
za64rs requires priv 1.12 when enabled by priv 1.11. This fixes annoying warning: warning: disabling za64rs extension for hart 0x because privilege spec version does not match on priv 1.11 CPUs. Fixes: 68c9e54beae8 ("target/riscv: do not enable all named features by default") Signed-of

Re: [PATCH RESEND] hw/openrisc/openrisc_sim: keep serial@90000000 as default

2024-08-22 Thread Stafford Horne
Note the distribution list you use here: openr...@lists.librecores.org Is old and we should use linux-openr...@vger.kernel.org. I will get the qemu maintainer file updated. On Thu, Aug 22, 2024 at 06:38:38PM +0200, Ahmad Fatoum wrote: > We used to only have a single UART on the platform and it wa

Re: [PATCH for-9.2] hw/arm/sbsa-ref: Don't leak string in sbsa_fdt_add_gic_node()

2024-08-22 Thread Philippe Mathieu-Daudé
On 22/8/24 18:23, Peter Maydell wrote: In sbsa_fdt_add_gic_node() we g_strdup_printf() two nodename strings, but only free one. Since the string is actually entirely constant and we don't make any use of printf's format-string operations, we can drop the g_strdup_printf() use entirely. Signed-o

Re: [PATCH v4 14/35] tests/functional: add a module for handling asset download & caching

2024-08-22 Thread Philippe Mathieu-Daudé
Hi, On 21/8/24 10:27, Thomas Huth wrote: From: Daniel P. Berrangé The 'Asset' class is a simple module that declares a downloadable asset that can be cached locally. Downloads are stored in the user's home dir at ~/.cache/qemu/download, using a sha256 sum of the URL. Signed-off-by: Daniel P.

Re: [PATCH v2] tests/functional: Convert Aarch64 SBSA-Ref avocado tests

2024-08-22 Thread Philippe Mathieu-Daudé
On 22/8/24 20:48, Marcin Juszkiewicz wrote: On 22.08.2024 13:41, Philippe Mathieu-Daudé wrote: Straight forward conversion. Since SBSA_FLASH files are not tarballs, use lzma_uncompress() method. Signed-off-by: Philippe Mathieu-Daudé --- Based-on: <20240821082748.65853-1-th...@redhat.com> ---

Re: [PATCH v2 09/15] memory: Do not create circular reference with subregion

2024-08-22 Thread Akihiko Odaki
On 2024/08/23 6:01, Peter Xu wrote: On Thu, Aug 22, 2024 at 06:10:43PM +0100, Peter Maydell wrote: On Thu, 27 Jun 2024 at 14:40, Akihiko Odaki wrote: A memory region does not use their own reference counters, but instead piggybacks on another QOM object, "owner" (unless the owner is not the m

[PATCH v4 2/7] memory: Do not refer to "memory region's reference count"

2024-08-22 Thread Akihiko Odaki
Now MemoryRegions do have their own reference counts, but they will not be used when their owners are not themselves. However, the documentation of memory_region_ref() says it adds "1 to a memory region's reference count", which is confusing. Avoid referring to "memory region's reference count" and

[PATCH v4 5/7] memory: Clarify owner must not call memory_region_ref()

2024-08-22 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- include/exec/memory.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/exec/memory.h b/include/exec/memory.h index d79415a3b159..6698e9d05eab 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1220,6 +1220,7 @@ void memory_region_init(Me

[PATCH v4 6/7] memory: Do not create circular reference with subregion

2024-08-22 Thread Akihiko Odaki
memory_region_update_container_subregions() used to call memory_region_ref(), which creates a reference to the owner of the subregion, on behalf of the owner of the container. This results in a circular reference if the subregion and container have the same owner. memory_region_ref() creates a ref

[PATCH v4 4/7] memory: Clarify that owner may be missing

2024-08-22 Thread Akihiko Odaki
A memory region may not have an owner, and memory_region_ref() and memory_region_unref() do nothing for such. Signed-off-by: Akihiko Odaki --- include/exec/memory.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 461e4

[PATCH v4 1/7] migration: Free removed SaveStateEntry

2024-08-22 Thread Akihiko Odaki
This fixes LeakSanitizer warnings. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Xu Reviewed-by: Michael S. Tsirkin --- migration/savevm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migration/savevm.c b/migration/savevm.c index deb57833f8a8..85958d7b09cd 100644 --- a/migration/sav

[PATCH v4 7/7] tests/qtest: Delete previous boot file

2024-08-22 Thread Akihiko Odaki
A test run may create boot files several times. Delete the previous boot file before creating a new one. Signed-off-by: Akihiko Odaki Reviewed-by: Michael S. Tsirkin Acked-by: Thomas Huth --- tests/qtest/migration-test.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-)

[PATCH v4 3/7] memory: Refer to docs/devel/memory.rst for "owner"

2024-08-22 Thread Akihiko Odaki
memory_region_ref() and memory_region_unref() used to have their own descriptions of "owner", but they are somewhat out-of-date and misleading. In particular, they say "whenever memory regions are accessed outside the BQL, they need to be preserved against hot-unplug", but protecting against hot-u

[PATCH v4 0/7] Fix check-qtest-ppc64 sanitizer errors

2024-08-22 Thread Akihiko Odaki
I saw various sanitizer errors when running check-qtest-ppc64. While I could just turn off sanitizers, I decided to tackle them this time. Unfortunately, GLib versions older than 2.81.0 do not free test data in some cases so some sanitizer errors remain. All sanitizer errors will be gone with this

Re: [PATCH for-9.2 v7 0/9] virtio-net: add support for SR-IOV emulation

2024-08-22 Thread Akihiko Odaki
On 2024/08/21 19:18, Yui Washizu wrote: On 2024/08/13 15:36, Akihiko Odaki wrote: Based-on: <20240802-reuse-v11-0-fb83bb8c1...@daynix.com> ("[PATCH for-9.2 v11 00/11] hw/pci: SR-IOV related fixes and improvements") I couldn't apply this patch series after applying "[PATCH for-9.2 v11 00/11]

[PATCH for-9.2 v15 10/11] hw/pci: Use -1 as the default value for rombar

2024-08-22 Thread Akihiko Odaki
vfio_pci_size_rom() distinguishes whether rombar is explicitly set to 1 by checking dev->opts, bypassing the QOM property infrastructure. Use -1 as the default value for rombar to tell if the user explicitly set it to 1. The property is also converted from unsigned to signed. -1 is signed so it is

[PATCH for-9.2 v15 04/11] s390x/pci: Check for multifunction after device realization

2024-08-22 Thread Akihiko Odaki
The SR-IOV PFs set the multifunction bits during device realization so check them after that. This forbids adding SR-IOV devices to s390x. Signed-off-by: Akihiko Odaki --- hw/s390x/s390-pci-bus.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/hw/s390x/s390-pci

[PATCH for-9.2 v15 07/11] pcie_sriov: Release VFs failed to realize

2024-08-22 Thread Akihiko Odaki
Release VFs failed to realize just as we do in unregister_vfs(). Fixes: 7c0fa8dff811 ("pcie: Add support for Single Root I/O Virtualization (SR/IOV)") Signed-off-by: Akihiko Odaki --- hw/pci/pcie_sriov.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/pci/pcie_sriov.c b/hw/pci/pcie_sri

[PATCH for-9.2 v15 03/11] hw/ppc/spapr_pci: Do not reject VFs created after a PF

2024-08-22 Thread Akihiko Odaki
A PF may automatically create VFs and the PF may be function 0. Signed-off-by: Akihiko Odaki --- hw/ppc/spapr_pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index f63182a03c41..ed4454bbf79e 100644 --- a/hw/ppc/spapr_pci.c +++

[PATCH for-9.2 v15 05/11] pcie_sriov: Do not manually unrealize

2024-08-22 Thread Akihiko Odaki
A device gets automatically unrealized when being unparented. Signed-off-by: Akihiko Odaki --- hw/pci/pcie_sriov.c | 4 1 file changed, 4 deletions(-) diff --git a/hw/pci/pcie_sriov.c b/hw/pci/pcie_sriov.c index e9b23221d713..499becd5273f 100644 --- a/hw/pci/pcie_sriov.c +++ b/hw/pci/pcie_

[PATCH for-9.2 v15 06/11] pcie_sriov: Reuse SR-IOV VF device instances

2024-08-22 Thread Akihiko Odaki
Disable SR-IOV VF devices by reusing code to power down PCI devices instead of removing them when the guest requests to disable VFs. This allows to realize devices and report VF realization errors at PF realization time. Signed-off-by: Akihiko Odaki --- docs/pcie_sriov.txt | 8 ++-- in

[PATCH for-9.2 v15 08/11] pcie_sriov: Remove num_vfs from PCIESriovPF

2024-08-22 Thread Akihiko Odaki
num_vfs is not migrated so use PCI_SRIOV_CTRL_VFE and PCI_SRIOV_NUM_VF instead. Signed-off-by: Akihiko Odaki --- include/hw/pci/pcie_sriov.h | 1 - hw/pci/pcie_sriov.c | 38 +++--- hw/pci/trace-events | 2 +- 3 files changed, 28 insertions(+), 13

[PATCH for-9.2 v15 11/11] hw/qdev: Remove opts member

2024-08-22 Thread Akihiko Odaki
It is no longer used. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Markus Armbruster --- include/hw/qdev-core.h | 4 hw/core/qdev.c | 1 - system/qdev-monitor.c | 12 +++- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/i

[PATCH for-9.2 v15 02/11] hw/ppc/spapr_pci: Do not create DT for disabled PCI device

2024-08-22 Thread Akihiko Odaki
Disabled means it is a disabled SR-IOV VF or it is powered off, and hidden from the guest. Signed-off-by: Akihiko Odaki --- hw/ppc/spapr_pci.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 7cf9904c3546..f63182a03c41 100644 --- a/hw/ppc/spap

[PATCH for-9.2 v15 00/11] hw/pci: SR-IOV related fixes and improvements

2024-08-22 Thread Akihiko Odaki
Supersedes: <20240714-rombar-v2-0-af1504ef5...@daynix.com> ("[PATCH v2 0/4] hw/pci: Convert rom_bar into OnOffAuto") I submitted a RFC series[1] to add support for SR-IOV emulation to virtio-net-pci. During the development of the series, I fixed some trivial bugs and made improvements that I think

[PATCH for-9.2 v15 09/11] pcie_sriov: Register VFs after migration

2024-08-22 Thread Akihiko Odaki
pcie_sriov doesn't have code to restore its state after migration, but igb, which uses pcie_sriov, naively claimed its migration capability. Add code to register VFs after migration and fix igb migration. Fixes: 3a977deebe6b ("Intrdocue igb device emulation") Signed-off-by: Akihiko Odaki --- in

[PATCH for-9.2 v15 01/11] hw/pci: Rename has_power to enabled

2024-08-22 Thread Akihiko Odaki
The renamed state will not only represent powering state of PFs, but also represent SR-IOV VF enablement in the future. Signed-off-by: Akihiko Odaki --- include/hw/pci/pci.h| 7 ++- include/hw/pci/pci_device.h | 2 +- hw/pci/pci.c| 14 +++--- hw/pci/pci_host

[PATCH] target: riscv: Enable Bit Manip for OpenTitan Ibex CPU

2024-08-22 Thread Alistair Francis
The OpenTitan Ibex CPU now supports the the Zba, Zbb, Zbc and Zbs bit-manipulation sub-extensions ratified in v.1.0.0 of the RISC-V Bit- Manipulation ISA Extension, so let's enable them in QEMU as well. 1: https://github.com/lowRISC/opentitan/pull/9748 Signed-off-by: Alistair Francis --- target

RE: [PATCH] scripts/coccinelle: New range.cocci

2024-08-22 Thread Xingtao Yao (Fujitsu)
> -Original Message- > From: Peter Maydell > Sent: Thursday, August 22, 2024 11:31 PM > To: Yao, Xingtao/姚 幸涛 > Cc: qemu-devel@nongnu.org > Subject: Re: [PATCH] scripts/coccinelle: New range.cocci > > On Wed, 21 Aug 2024 at 01:21, Xingtao Yao (Fujitsu) > wrote: > > > > > > > > > -

Re: [PATCH v2 0/4] linux-user/flatload: Take mmap_lock in load_flt_binary()

2024-08-22 Thread Richard Henderson
On 8/22/24 19:50, Philippe Mathieu-Daudé wrote: Philippe Mathieu-Daudé (4): accel/tcg: Make page_set_flags() documentation public linux-user/flatload: Take mmap_lock in load_flt_binary() tests/avocado: Allow running user-mode tests tests/avocado: Run STM32 bFLT busybox binary in curre

[ANNOUNCE] QEMU 9.1.0-rc3 is now available

2024-08-22 Thread Michael Roth
Hello, On behalf of the QEMU Team, I'd like to announce the availability of the fourth release candidate for the QEMU 9.1 release. This release is meant for testing purposes and should not be used in a production environment. http://download.qemu.org/qemu-9.1.0-rc3.tar.xz http://download.qemu

Re: [PATCH v3 0/1] Add support for generating OpenSBI domains in the device tree

2024-08-22 Thread Gregor Haas
Hi Daniel, That's correct -- I believe this [1] patch on the OpenSBI mailing list addresses this issue. I am currently waiting for it to be reviewed. Thanks, Gregor [1] http://lists.infradead.org/pipermail/opensbi/2024-August/007240.html On Thu, Aug 22, 2024 at 2:49 PM Daniel Henrique Barboza <

Re: [PATCH v3 0/1] Add support for generating OpenSBI domains in the device tree

2024-08-22 Thread Daniel Henrique Barboza
On 8/5/24 6:04 PM, Gregor Haas wrote: This patch series adds support for specifying OpenSBI domains on the QEMU command line. A simple example of what this looks like is below, including mapping the board's UART into the secondary domain: qemu-system-riscv64 -machine virt -bios fw_jump.bin -c

Re: [PATCH v2 09/15] memory: Do not create circular reference with subregion

2024-08-22 Thread Peter Xu
On Thu, Aug 22, 2024 at 06:10:43PM +0100, Peter Maydell wrote: > On Thu, 27 Jun 2024 at 14:40, Akihiko Odaki wrote: > > > > A memory region does not use their own reference counters, but instead > > piggybacks on another QOM object, "owner" (unless the owner is not the > > memory region itself). W

[PATCH] docs/sphinx: fix extra stuff in TOC after freeform QMP sections

2024-08-22 Thread John Snow
Freeform sections with titles are currently generating a TOC entry for the first paragraph in the section after the header, which is not what we want. (Easiest to observe directly in the QMP reference manual's "Introduction" section.) When freeform sections are parsed, we create both a section he

Re: [PATCH] plugins: add plugin API to read guest memory

2024-08-22 Thread Pierrick Bouvier
On 8/22/24 13:33, Pierrick Bouvier wrote: + * + * version 3: + * - modified arguments and return value of qemu_plugin_insn_data to copy + * the data into a user-provided buffer instead of returning a pointer + * to the data. + * Is it a change left on your side, or a bad diff? Just sa

Re: [PATCH] plugins: add plugin API to read guest memory

2024-08-22 Thread Pierrick Bouvier
Hi Rowan, thanks for your contribution. To give some context on the answer, we are currently working to add a similar "read_memory" API, but associated to memory callbacks for plugins (https://lore.kernel.org/qemu-devel/20240724194708.1843704-1-pierrick.bouv...@linaro.org/T/#t). A key aspect

Re: [PATCH v3 1/1] Add support for generating OpenSBI domains in the device tree

2024-08-22 Thread Daniel Henrique Barboza
On 8/5/24 6:04 PM, Gregor Haas wrote: OpenSBI has support for domains, which are partitions of CPUs and memory into isolated compartments. Domains can be specified in the device tree according to a standardized format [1], which OpenSBI parses at boot time to initialize all system domains. Thi

Re: [PATCH] target/riscv/kvm: Fix the group bit setting of AIA

2024-08-22 Thread Daniel Henrique Barboza
On 8/21/24 4:50 AM, Andrew Jones wrote: Just as the hart bit setting of the AIA should be calculated as ceil(log2(max_hart_id + 1)) the group bit setting should be calculated as ceil(log2(max_group_id + 1)). The hart bits are implemented by passing max_hart_id to find_last_bit() and adding one

Re: [RFC PATCH v2 00/23] NXP i.MX RT595, ARM SVD and device model unit tests

2024-08-22 Thread Octavian Purdila
On Thu, Aug 22, 2024 at 6:28 AM Peter Maydell wrote: > > On Sat, 17 Aug 2024 at 11:26, Octavian Purdila wrote: > > > > This patch set adds support for NXP's RT500 MCU [1] and the RT595 > > EVK[2]. More RT500 device models will be submitted in future patch sets. > > > > The goal of this first patc

[PATCH RESEND] hw/openrisc/openrisc_sim: keep serial@90000000 as default

2024-08-22 Thread Ahmad Fatoum
We used to only have a single UART on the platform and it was located at address 0x9000. When the number of UARTs was increased to 4, the first UART remained at its location, but instead of being the first one to be registered, it became the last. This caused QEMU to pick 0x9300 as the def

Re: [PATCH v3 12/14] migration/multifd: Allow multifd sync without flush

2024-08-22 Thread Peter Xu
On Thu, Aug 22, 2024 at 03:07:55PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Thu, Aug 22, 2024 at 02:05:30PM -0300, Fabiano Rosas wrote: > >> Peter Xu writes: > >> > >> > On Thu, Aug 22, 2024 at 12:03:47PM -0400, Peter Xu wrote: > >> >> On Thu, Aug 01, 2024 at 09:35:14AM -0300, Fa

Re: [PATCH v2] tests/functional: Convert Aarch64 SBSA-Ref avocado tests

2024-08-22 Thread Marcin Juszkiewicz
On 22.08.2024 16:39, Philippe Mathieu-Daudé wrote: On 22/8/24 16:06, Marcin Juszkiewicz wrote: Maybe for QEMU project this is a progress. For me it is moving tests from working ones to "sorry, timeout, find out why" ones. OK, problem was found (check my previous mail). Tests took 222s on Mac

[PATCH v17 10/13] virtio-gpu: Support suspension of commands processing

2024-08-22 Thread Dmitry Osipenko
Check whether command processing has been finished; otherwise, stop processing commands and retry the command again next time. This allows us to support asynchronous execution of non-fenced commands needed for unmapping host blobs safely. Suggested-by: Akihiko Odaki Reviewed-by: Akihiko Odaki Re

[PATCH v17 12/13] virtio-gpu: Register capsets dynamically

2024-08-22 Thread Dmitry Osipenko
From: Pierre-Eric Pelloux-Prayer virtio_gpu_virgl_get_num_capsets will return "num_capsets", but we can't assume that capset_index 1 is always VIRGL2 once we'll support more capsets, like Venus and DRM capsets. Register capsets dynamically to avoid that problem. Reviewed-by: Manos Pitsidianakis

[PATCH v17 13/13] virtio-gpu: Support Venus context

2024-08-22 Thread Dmitry Osipenko
From: Antonio Caggiano Request Venus when initializing VirGL and if venus=true flag is set for virtio-gpu-gl device. Signed-off-by: Antonio Caggiano Signed-off-by: Huang Rui Reviewed-by: Akihiko Odaki Reviewed-by: Marc-André Lureau Tested-by: Alex Bennée Acked-by: Alex Bennée Signed-off-by

[PATCH v17 11/13] virtio-gpu: Handle resource blob commands

2024-08-22 Thread Dmitry Osipenko
From: Robert Beckett Support BLOB resources creation, mapping, unmapping and set-scanout by calling the new stable virglrenderer 0.10 interface. Only enabled when available and via the blob config. E.g. -device virtio-vga-gl,blob=true Signed-off-by: Antonio Caggiano Signed-off-by: Robert Becket

[PATCH v17 05/13] virtio-gpu: Unrealize GL device

2024-08-22 Thread Dmitry Osipenko
Even though GL GPU doesn't support hotplugging today, free virgl resources when GL device is unrealized. For consistency. Reviewed-by: Akihiko Odaki Reviewed-by: Marc-André Lureau Tested-by: Alex Bennée Acked-by: Alex Bennée Signed-off-by: Dmitry Osipenko --- hw/display/virtio-gpu-gl.c | 17

[PATCH v17 07/13] virtio-gpu: Support context-init feature with virglrenderer

2024-08-22 Thread Dmitry Osipenko
From: Huang Rui Patch "virtio-gpu: CONTEXT_INIT feature" has added the context_init feature flags. Expose this feature and support creating virglrenderer context with flags using context_id if libvirglrenderer is new enough. Originally-by: Antonio Caggiano Signed-off-by: Huang Rui Reviewed-by:

[PATCH v17 08/13] virtio-gpu: Don't require udmabuf when blobs and virgl are enabled

2024-08-22 Thread Dmitry Osipenko
The udmabuf usage is mandatory when virgl is disabled and blobs feature enabled in the Qemu machine configuration. If virgl and blobs are enabled, then udmabuf requirement is optional. Since udmabuf isn't widely supported by a popular Linux distros today, let's relax the udmabuf requirement for blo

[PATCH v17 06/13] virtio-gpu: Use pkgconfig version to decide which virgl features are available

2024-08-22 Thread Dmitry Osipenko
New virglrerenderer features were stabilized with release of v1.0.0. Presence of symbols in virglrenderer.h doesn't guarantee ABI compatibility with pre-release development versions of libvirglerender. Use virglrenderer version to decide reliably which virgl features are available. Reviewed-by: Al

[PATCH v17 09/13] virtio-gpu: Add virgl resource management

2024-08-22 Thread Dmitry Osipenko
From: Huang Rui In a preparation to adding host blobs support to virtio-gpu, add virgl resource management that allows to retrieve resource based on its ID and virgl resource wrapper on top of simple resource that will be contain fields specific to virgl. Signed-off-by: Huang Rui Reviewed-by: A

[PATCH v17 04/13] virtio-gpu: Handle virtio_gpu_virgl_init() failure

2024-08-22 Thread Dmitry Osipenko
virtio_gpu_virgl_init() may fail, leading to a further Qemu crash because Qemu assumes it never fails. Check virtio_gpu_virgl_init() return code and don't execute virtio commands on error. Failed virtio_gpu_virgl_init() will result in a timed out virtio commands for a guest OS. Reviewed-by: Akihik

[PATCH v17 03/13] virtio-gpu: Move print_stats timer to VirtIOGPUGL

2024-08-22 Thread Dmitry Osipenko
Move print_stats timer to VirtIOGPUGL for consistency with cmdq_resume_bh and fence_poll that are used only by GL device. Reviewed-by: Akihiko Odaki Reviewed-by: Marc-André Lureau Tested-by: Alex Bennée Acked-by: Alex Bennée Signed-off-by: Dmitry Osipenko --- hw/display/virtio-gpu-virgl.c |

[PATCH v17 02/13] virtio-gpu: Move fence_poll timer to VirtIOGPUGL

2024-08-22 Thread Dmitry Osipenko
Move fence_poll timer to VirtIOGPUGL for consistency with cmdq_resume_bh that are used only by GL device. Reviewed-by: Akihiko Odaki Reviewed-by: Marc-André Lureau Reviewed-by: Alex Bennée Tested-by: Alex Bennée Acked-by: Alex Bennée Signed-off-by: Dmitry Osipenko --- hw/display/virtio-gpu-

[PATCH v17 00/13] Support blob memory and venus on qemu

2024-08-22 Thread Dmitry Osipenko
Hello, This series enables Vulkan Venus context support on virtio-gpu. All virglrender and almost all Linux kernel prerequisite changes needed by Venus are already in upstream. For kernel there is a pending KVM patchset that fixes mapping of compound pages needed for DRM drivers using TTM or huge

[PATCH v17 01/13] virtio-gpu: Use trace events for tracking number of in-flight fences

2024-08-22 Thread Dmitry Osipenko
Replace printf's used for tracking of in-flight fence inc/dec events with tracing, for consistency with the rest of virtio-gpu code that uses tracing. Suggested-by: Marc-André Lureau Reviewed-by: Marc-André Lureau Reviewed-by: Akihiko Odaki Reviewed-by: Alex Bennée Tested-by: Alex Bennée Acke

Re: [PATCH v2] tests/functional: Convert Aarch64 SBSA-Ref avocado tests

2024-08-22 Thread Marcin Juszkiewicz
On 22.08.2024 13:41, Philippe Mathieu-Daudé wrote: Straight forward conversion. Since SBSA_FLASH files are not tarballs, use lzma_uncompress() method. Signed-off-by: Philippe Mathieu-Daudé --- Based-on: <20240821082748.65853-1-th...@redhat.com> --- diff --git a/tests/avocado/machine_aarch64_

Re: [PATCH v3 12/14] migration/multifd: Allow multifd sync without flush

2024-08-22 Thread Fabiano Rosas
Peter Xu writes: > On Thu, Aug 22, 2024 at 02:05:30PM -0300, Fabiano Rosas wrote: >> Peter Xu writes: >> >> > On Thu, Aug 22, 2024 at 12:03:47PM -0400, Peter Xu wrote: >> >> On Thu, Aug 01, 2024 at 09:35:14AM -0300, Fabiano Rosas wrote: >> >> > Separate the multifd sync from flushing the client

Re: [PATCH v3 12/14] migration/multifd: Allow multifd sync without flush

2024-08-22 Thread Peter Xu
On Thu, Aug 22, 2024 at 02:05:30PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Thu, Aug 22, 2024 at 12:03:47PM -0400, Peter Xu wrote: > >> On Thu, Aug 01, 2024 at 09:35:14AM -0300, Fabiano Rosas wrote: > >> > Separate the multifd sync from flushing the client data to the > >> > channe

Re: [PATCH v3 14/14] migration/multifd: Move ram code into multifd-ram.c

2024-08-22 Thread Peter Xu
On Thu, Aug 22, 2024 at 02:21:18PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Thu, Aug 01, 2024 at 09:35:16AM -0300, Fabiano Rosas wrote: > >> In preparation for adding new payload types to multifd, move most of > >> the ram-related code into multifd-ram.c. Let's try to keep a sembla

Re: [PATCH v2] target/ppc: Fix migration of CPUs with TLB_EMB TLB type

2024-08-22 Thread Peter Maydell
On Thu, 22 Aug 2024 at 17:57, Arman Nabiev wrote: > > From: Arman Nabiev > > In vmstate_tlbemb a cut-and-paste error meant we gave > this vmstate subsection the same "cpu/tlb6xx" name as > the vmstate_tlb6xx subsection. This breaks migration load > for any CPU using the TLB_EMB CPU type, because

Re: [PATCH v3 14/14] migration/multifd: Move ram code into multifd-ram.c

2024-08-22 Thread Fabiano Rosas
Peter Xu writes: > On Thu, Aug 01, 2024 at 09:35:16AM -0300, Fabiano Rosas wrote: >> In preparation for adding new payload types to multifd, move most of >> the ram-related code into multifd-ram.c. Let's try to keep a semblance >> of layering by not mixing general multifd control flow with the >>

Re: [PATCH v3 13/14] migration/multifd: Register nocomp ops dynamically

2024-08-22 Thread Fabiano Rosas
Peter Xu writes: > On Thu, Aug 01, 2024 at 09:35:15AM -0300, Fabiano Rosas wrote: >> Prior to moving the ram code into multifd-ram.c, change the code to >> register the nocomp ops dynamically so we don't need to have the ops >> structure defined in multifd.c. >> >> While here, rename s/nocomp/ra

Re: [PATCH v2 09/15] memory: Do not create circular reference with subregion

2024-08-22 Thread Peter Maydell
On Thu, 27 Jun 2024 at 14:40, Akihiko Odaki wrote: > > A memory region does not use their own reference counters, but instead > piggybacks on another QOM object, "owner" (unless the owner is not the > memory region itself). When creating a subregion, a new reference to the > owner of the container

Re: [PATCH v3 12/14] migration/multifd: Allow multifd sync without flush

2024-08-22 Thread Fabiano Rosas
Peter Xu writes: > On Thu, Aug 22, 2024 at 12:03:47PM -0400, Peter Xu wrote: >> On Thu, Aug 01, 2024 at 09:35:14AM -0300, Fabiano Rosas wrote: >> > Separate the multifd sync from flushing the client data to the >> > channels. These two operations are closely related but not strictly >> > necessar

Re: [PATCH v7 13/17] target/riscv: update `decode_save_opc` to store extra word2

2024-08-22 Thread Deepak Gupta
On Thu, Aug 22, 2024 at 01:24:59AM -0700, Deepak Gupta wrote: Extra word 2 is stored during tcg compile and `decode_save_opc` needs additional argument in order to pass the value. This will be used during unwind to get extra information about instruction like how to massage exceptions. Updated al

[PATCH v2] target/ppc: Fix migration of CPUs with TLB_EMB TLB type

2024-08-22 Thread Arman Nabiev
From: Arman Nabiev In vmstate_tlbemb a cut-and-paste error meant we gave this vmstate subsection the same "cpu/tlb6xx" name as the vmstate_tlb6xx subsection. This breaks migration load for any CPU using the TLB_EMB CPU type, because when we see the "tlb6xx" name in the incoming data we try to int

Re: [PATCH v3 14/14] migration/multifd: Move ram code into multifd-ram.c

2024-08-22 Thread Peter Xu
On Thu, Aug 01, 2024 at 09:35:16AM -0300, Fabiano Rosas wrote: > In preparation for adding new payload types to multifd, move most of > the ram-related code into multifd-ram.c. Let's try to keep a semblance > of layering by not mixing general multifd control flow with the > details of transmitting

[PATCH for-9.2] hw/arm/sbsa-ref: Don't leak string in sbsa_fdt_add_gic_node()

2024-08-22 Thread Peter Maydell
In sbsa_fdt_add_gic_node() we g_strdup_printf() two nodename strings, but only free one. Since the string is actually entirely constant and we don't make any use of printf's format-string operations, we can drop the g_strdup_printf() use entirely. Signed-off-by: Peter Maydell --- A small once-on

Re: [PATCH v3 13/14] migration/multifd: Register nocomp ops dynamically

2024-08-22 Thread Peter Xu
On Thu, Aug 01, 2024 at 09:35:15AM -0300, Fabiano Rosas wrote: > Prior to moving the ram code into multifd-ram.c, change the code to > register the nocomp ops dynamically so we don't need to have the ops > structure defined in multifd.c. > > While here, rename s/nocomp/ram/ and remove the docstrin

[PATCH for-9.2 5/6] hw/misc/xlnx-versal-trng: Call register_finalize_block

2024-08-22 Thread Peter Maydell
The TYPE_XLNX_VERSAL_TRNG device creates a register block with register_init_block32() in its instance_init method; we must therefore destroy it in our instance_finalize method to avoid a leak in the QOM introspection "init-inspect-finalize" lifecycle: Direct leak of 304 byte(s) in 1 object(s) all

[PATCH for-9.2 4/6] hw/nvram/xlnx-zynqmp-efuse: Call register_finalize_block

2024-08-22 Thread Peter Maydell
The TYPE_XLNX_ZYNQMP_EFUSE device creates a register block with register_init_block32() in its instance_init method; we must therefore destroy it in our instance_finalize method to avoid a leak in the QOM introspection "init-inspect-finalize" lifecycle: Direct leak of 304 byte(s) in 1 object(s) al

[PATCH for-9.2 2/6] hw/misc/xlnx-versal-trng: Free s->prng in finalize, not unrealize

2024-08-22 Thread Peter Maydell
The TYPE_XLNX_VERSAL_TRNG device creates s->prng with g_rand_new() in its init method, but it frees it in its unrealize method. This results in a leak in the QOM introspection "initialize-inspect-finalize" lifecycle: Direct leak of 2500 byte(s) in 1 object(s) allocated from: #0 0x55ec89eae9d8

[PATCH for-9.2 6/6] hm/nvram/xlnx-versal-efuse-ctrl: Call register_finalize_block

2024-08-22 Thread Peter Maydell
The TYPE_XLNX_VERSAL_EFUSE_CTRL device creates a register block with register_init_block32() in its instance_init method; we must therefore destroy it in our instance_finalize method to avoid a leak in the QOM introspection "init-inspect-finalize" lifecycle: Direct leak of 304 byte(s) in 1 object(

[PATCH for-9.2 1/6] hw/misc/xlnx-versal-cfu: destroy fifo in finalize

2024-08-22 Thread Peter Maydell
Since the TYPE_XNLX_VERSAL_CFU_FDRO device creates a FIFO in its instance_init method, we must destroy the FIFO in instance_finalize to avoid a memory leak for the QOM introspection "instantiate-examine-finalize" cycle: Direct leak of 8192 byte(s) in 1 object(s) allocated from: #0 0x55ec89eae7

[PATCH for-9.2 3/6] hw/nvram/xlnx-bbram: Call register_finalize_block

2024-08-22 Thread Peter Maydell
The TYPE_XLNX_BBRAM device creates a register block with register_init_block32() in its instance_init method; we must therefore destroy it in our instance_finalize method to avoid a leak in the QOM introspection "init-inspect-finalize" lifecycle: Direct leak of 304 byte(s) in 1 object(s) allocated

[PATCH for-9.2 0/6] arm: xlnx: fix minor memory leaks

2024-08-22 Thread Peter Maydell
This patchset fixes a collection of minor memory leaks in various xlnx devices, all detected by clang LeakSanitizer when running 'make check'. Since these are longstanding and not very important leaks, this is 9.2 material. thanks -- PMM Peter Maydell (6): hw/misc/xlnx-versal-cfu: destroy fifo

Re: [PATCH v3 12/14] migration/multifd: Allow multifd sync without flush

2024-08-22 Thread Peter Xu
On Thu, Aug 22, 2024 at 12:03:47PM -0400, Peter Xu wrote: > On Thu, Aug 01, 2024 at 09:35:14AM -0300, Fabiano Rosas wrote: > > Separate the multifd sync from flushing the client data to the > > channels. These two operations are closely related but not strictly > > necessary to be executed together

Re: [PATCH v3 12/14] migration/multifd: Allow multifd sync without flush

2024-08-22 Thread Peter Xu
On Thu, Aug 01, 2024 at 09:35:14AM -0300, Fabiano Rosas wrote: > Separate the multifd sync from flushing the client data to the > channels. These two operations are closely related but not strictly > necessary to be executed together. > > The multifd sync is intrinsic to how multifd works. The mul

Re: [PATCH v3 11/14] migration/multifd: Replace multifd_send_state->pages with client data

2024-08-22 Thread Peter Xu
On Thu, Aug 01, 2024 at 09:35:13AM -0300, Fabiano Rosas wrote: > Multifd currently has a simple scheduling mechanism that distributes > work to the various channels by keeping storage space within each > channel and an extra space that is given to the client. Each time the > client fills the space

Re: [PATCH v3 10/14] migration/multifd: Don't send ram data during SYNC

2024-08-22 Thread Peter Xu
On Thu, Aug 01, 2024 at 09:35:12AM -0300, Fabiano Rosas wrote: > Skip saving and loading any ram data in the packet in the case of a > SYNC. This fixes a shortcoming of the current code which requires a > reset of the MultiFDPages_t fields right after the previous > pending_job finishes, otherwise

Re: [PATCH] scripts/coccinelle: New range.cocci

2024-08-22 Thread Peter Maydell
On Wed, 21 Aug 2024 at 01:21, Xingtao Yao (Fujitsu) wrote: > > > > > -Original Message- > > From: Peter Maydell > > Sent: Tuesday, August 20, 2024 4:41 PM > > To: Yao, Xingtao/姚 幸涛 > > Cc: qemu-devel@nongnu.org > > Subject: Re: [PATCH] scripts/coccinelle: New range.cocci > > > > On Thu,

Re: [PATCH v4 0/6] AWS Nitro Enclave emulation support

2024-08-22 Thread Dorjoy Chowdhury
Thanks for taking the time to review. v5 posted now: https://lists.gnu.org/archive/html/qemu-devel/2024-08/msg03251.html Regards, Dorjoy

Re: [PATCH v4 4/6] machine/nitro-enclave: Add built-in Nitro Secure Module device

2024-08-22 Thread Dorjoy Chowdhury
Hi Daniel, On Mon, Aug 19, 2024 at 4:37 PM Daniel P. Berrangé wrote: > > On Sun, Aug 18, 2024 at 05:42:55PM +0600, Dorjoy Chowdhury wrote: > > AWS Nitro Enclaves have built-in Nitro Secure Module (NSM) device which > > is used for stripped down TPM functionality like attestation. This commit > >

[PATCH v5 6/8] hw/core: Add Enclave Image Format (EIF) related helpers

2024-08-22 Thread Dorjoy Chowdhury
An EIF (Enclave Image Format)[1] file is used to boot an AWS nitro enclave[2] virtual machine. The EIF file contains the necessary kernel, cmdline, ramdisk(s) sections to boot. Some helper functions have been introduced for extracting the necessary sections from an EIF file and then writing them t

[PATCH v5 1/8] crypto: Define macros for hash algorithm digest lengths

2024-08-22 Thread Dorjoy Chowdhury
Signed-off-by: Dorjoy Chowdhury --- crypto/hash.c | 14 +++--- include/crypto/hash.h | 8 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/crypto/hash.c b/crypto/hash.c index b0f8228bdc..8087f5dae6 100644 --- a/crypto/hash.c +++ b/crypto/hash.c @@ -23,13 +

[PATCH v5 8/8] docs/nitro-enclave: Documentation for nitro-enclave machine type

2024-08-22 Thread Dorjoy Chowdhury
Signed-off-by: Dorjoy Chowdhury --- docs/system/i386/nitro-enclave.rst | 85 ++ 1 file changed, 85 insertions(+) create mode 100644 docs/system/i386/nitro-enclave.rst diff --git a/docs/system/i386/nitro-enclave.rst b/docs/system/i386/nitro-enclave.rst new file mode

[PATCH v5 5/8] device/virtio-nsm: Support for Nitro Secure Module device

2024-08-22 Thread Dorjoy Chowdhury
Nitro Secure Module (NSM)[1] device is used in AWS Nitro Enclaves[2] for stripped down TPM functionality like cryptographic attestation. The requests to and responses from NSM device are CBOR[3] encoded. This commit adds support for NSM device in QEMU. Although related to AWS Nitro Enclaves, the v

[PATCH v5 4/8] tests/lcitool: Update libvirt-ci and add libcbor dependency

2024-08-22 Thread Dorjoy Chowdhury
libcbor dependecy is necessary for adding virtio-nsm and nitro-enclave machine support in the following commits. libvirt-ci has already been updated with the dependency upstream and this commit updates libvirt-ci submodule in QEMU to latest upstream. Also the libcbor dependency has been added to te

[PATCH v5 3/8] crypto: Introduce x509 utils

2024-08-22 Thread Dorjoy Chowdhury
An utility function for getting fingerprint from X.509 certificate has been introduced. Implementation only provided using gnutls. Signed-off-by: Dorjoy Chowdhury --- crypto/meson.build | 4 ++ crypto/x509-utils.c | 75 + include/crypto/x509-

[PATCH v5 7/8] machine/nitro-enclave: New machine type for AWS Nitro Enclaves

2024-08-22 Thread Dorjoy Chowdhury
AWS nitro enclaves[1] is an Amazon EC2[2] feature that allows creating isolated execution environments, called enclaves, from Amazon EC2 instances which are used for processing highly sensitive data. Enclaves have no persistent storage and no external networking. The enclave VMs are based on the Fi

[PATCH v5 2/8] crypto: Support SHA384 hash when using glib

2024-08-22 Thread Dorjoy Chowdhury
QEMU requires minimum glib version 2.66.0 as per the root meson.build file and per glib documentation[1] G_CHECKSUM_SHA384 is available since 2.51. [1] https://docs.gtk.org/glib/enum.ChecksumType.html Reviewed-by: Daniel P. Berrangé Signed-off-by: Dorjoy Chowdhury --- crypto/hash-glib.c | 2 +-

[PATCH v5 0/8] AWS Nitro Enclave emulation support

2024-08-22 Thread Dorjoy Chowdhury
This is v5 submission for AWS Nitro Enclave emulation in QEMU. From the QEMU side the implementation for nitro enclaves is complete. v4 is at: https://mail.gnu.org/archive/html/qemu-devel/2024-08/msg02675.html Changes in v5: - bunch of use of glib utilities like g_autofree, g_memdup2, GList e

Re: [PATCH v3 09/14] migration/multifd: Isolate ram pages packet data

2024-08-22 Thread Fabiano Rosas
Peter Xu writes: > On Thu, Aug 22, 2024 at 11:13:36AM -0300, Fabiano Rosas wrote: >> Peter Xu writes: >> >> > On Thu, Aug 01, 2024 at 09:35:11AM -0300, Fabiano Rosas wrote: >> >> @@ -1554,7 +1577,6 @@ static void *multifd_recv_thread(void *opaque) >> >> qemu_sem_wait(&p->sem_sy

Re: [PATCH v2] tests/functional: Convert Aarch64 SBSA-Ref avocado tests

2024-08-22 Thread Thomas Huth
On 22/08/2024 16.39, Philippe Mathieu-Daudé wrote: On 22/8/24 16:06, Marcin Juszkiewicz wrote: On 22.08.2024 13:41, Philippe Mathieu-Daudé wrote:   # Timeouts for individual tests that can be slow e.g. with debugging enabled   test_timeouts = { +  'aarch64_sbsaref' : 180, What kind of machin

Re: [PATCH v2] tests/functional: Convert Aarch64 SBSA-Ref avocado tests

2024-08-22 Thread Philippe Mathieu-Daudé
On 22/8/24 16:06, Marcin Juszkiewicz wrote: On 22.08.2024 13:41, Philippe Mathieu-Daudé wrote:   # Timeouts for individual tests that can be slow e.g. with debugging enabled   test_timeouts = { +  'aarch64_sbsaref' : 180, What kind of machine is able to run those tests in 180s? I bumped them

Re: [PATCH v2] tests/functional: Convert Aarch64 SBSA-Ref avocado tests

2024-08-22 Thread Thomas Huth
On 22/08/2024 16.06, Marcin Juszkiewicz wrote: On 22.08.2024 13:41, Philippe Mathieu-Daudé wrote:   # Timeouts for individual tests that can be slow e.g. with debugging enabled   test_timeouts = { +  'aarch64_sbsaref' : 180, What kind of machine is able to run those tests in 180s? I bumped th

[PATCH for-9.1] nbd/server: CVE-2024-7409: Avoid use-after-free when closing server

2024-08-22 Thread Eric Blake
Commit 3e7ef738 plugged the use-after-free of the global nbd_server object, but overlooked a use-after-free of nbd_server->listener. Although this race is harder to hit, notice that our shutdown path first drops the reference count of nbd_server->listener, then triggers actions that can result in a

  1   2   >