Re: [PATCH 0/9] ui: Improve scale handling

2025-05-30 Thread Michael Tokarev
On 30.05.2025 09:39, Weifeng Liu wrote: On Thu, 2025-05-29 at 10:23 +0300, Michael Tokarev wrote: PATCH 3 - 5 fix bugs in mouse position calculation due to not handling scale properly, for both gtk and sdl. PATCH 6 align scale update logic in gtk-egl with other implementations. PATCH 7 fix a

Re: [PATCH 1/1] vhost: do not reset used_memslots when destroying vhost dev

2025-05-30 Thread Michael S. Tsirkin
On Wed, May 14, 2025 at 11:26:05AM +0200, David Hildenbrand wrote: > On 14.05.25 11:12, Igor Mammedov wrote: > > On Tue, 13 May 2025 15:12:11 +0200 > > David Hildenbrand wrote: > > > > > On 13.05.25 14:13, Igor Mammedov wrote: > > > > On Mon, 3 Mar 2025 13:02:17 -0500 > > > > yuanminghao wrote:

[RFC PATCH v2 0/2] cxl: Support creation of a new CXL Host Bridge

2025-05-30 Thread wangyuquan
v1 -> v2: - Move the code of new bridge to hw/pci-host/cxl.c - Fix and simplify some logic on handling the different bridge types Background == Currently the base CXL support for arm platforms is only on Jonathan's patches[1]. Some platform like SBSA-REF can be more like a real machine, th

Re: [PATCH v4 13/19] hw/block/fdc-isa: Remove 'fallback' property

2025-05-30 Thread Michael S. Tsirkin
On Wed, May 28, 2025 at 10:30:17AM +0200, Thomas Huth wrote: > On 27/05/2025 19.20, Thomas Huth wrote: > > On 12/05/2025 10.39, Philippe Mathieu-Daudé wrote: > > > The "fallback" property was only used by the hw_compat_2_5[] array, > > > as 'fallback=144'. We removed all machines using that array,

Re: [PATCH v4 00/19] hw/i386/pc: Remove deprecated 2.4 and 2.5 PC machines

2025-05-30 Thread Michael S. Tsirkin
On Mon, May 12, 2025 at 10:39:29AM +0200, Philippe Mathieu-Daudé wrote: > (series reviewed) Reviewed-by: Michael S. Tsirkin Thomas, since you wanted to do it, pls feel free to merge. > Since v3: > - Fixed 2 issues noticed by Thomas (floppy fallback, e1000) > > Since v2: > - Removed qtest in

[PULL 00/25] Functional tests, Microblaze endianness & pc/q35 cleanups

2025-05-30 Thread Thomas Huth
Hi Stefan! The following changes since commit d2e9b78162e31b1eaf20f3a4f563da82da56908d: Merge tag 'pull-qapi-2025-05-28' of https://repo.or.cz/qemu/armbru into staging (2025-05-29 08:36:01 -0400) are available in the Git repository at: https://gitlab.com/thuth/qemu.git tags/pull-request-2

Re: [PATCH v2 24/25] tests/qtest/bios-tables-test: Keep ACPI PCI hotplug off

2025-05-30 Thread Igor Mammedov
On Wed, 28 May 2025 12:04:26 -0300 Gustavo Romero wrote: > Hi Igor, > > On 5/28/25 10:02, Igor Mammedov wrote: > > On Wed, 28 May 2025 09:41:15 -0300 > > Gustavo Romero wrote: > > > >> Hi Igor, > >> > >> On 5/28/25 06:38, Igor Mammedov wrote: > >>> On Tue, 27 May 2025 09:40:26 +0200 > >>>

Re: [PATCH qemu] hw/cxl: Fix register block locator size

2025-05-30 Thread Jonathan Cameron via
On Thu, 29 May 2025 14:48:28 +0100 Jonathan Cameron wrote: > This has been wrong from day 1. For now we only have > two entries (component and device registers). > > The wrong size could lead to arbitrary data off the stack being presented > in PCIe config space. As noted in reply to Zhijian,

Re: [PATCH v2 02/10] cxl-mailbox-utils: 0x5600 - FMAPI Get DCD Info

2025-05-30 Thread Jonathan Cameron via
On Thu, 8 May 2025 00:00:58 + anisa.su...@gmail.com wrote: > From: Anisa Su > > FM DCD Management command 0x5600 implemented per CXL 3.2 Spec Section > 7.6.7.6.1. > > Signed-off-by: Anisa Su Looks like a missing include - though probably due to some indirect include going away. > --- >

[PATCH v2 0/4] VFIO and IOMMU prerequisite stuff for IOMMU nesting support

2025-05-30 Thread Zhenzhong Duan
Hi, The first 6 patches of [1] are all VFIO or IOMMUFD related additions. Split them out per Cédric and seek for quick acceptance. I didn't copy changelog from [1] as it's a mix of the whole nesting series. For who want a quick view of the whole nesting series [2]. Test done: - VFIO devices hot

[PATCH v2 4/4] vfio/iommufd: Save vendor specific device info

2025-05-30 Thread Zhenzhong Duan
Some device information returned by ioctl(IOMMU_GET_HW_INFO) are vendor specific. Save them as raw data in a union supporting different vendors, then vendor IOMMU can query the raw data with its fixed format for capability directly. Because IOMMU_GET_HW_INFO is only supported in linux, so declare

[PATCH 09/14] rust/hpet: change type of num_timers to usize

2025-05-30 Thread Paolo Bonzini
Remove the need to convert after every read of the BqlCell. Because the vmstate uses a u8 as the size of the VARRAY, this requires switching the VARRAY to use num_timers_save; which in turn requires ensuring that the num_timers_save is always there. For simplicity do this by removing support for

Re: [PATCH v2 04/25] hw/pci-host/gpex-acpi: Add native_pci_hotplug arg to acpi_dsdt_add_pci_osc

2025-05-30 Thread Jonathan Cameron via
On Fri, 30 May 2025 10:27:11 +0100 Jonathan Cameron wrote: > On Tue, 27 May 2025 09:40:06 +0200 > Eric Auger wrote: > > > Add a new argument to acpi_dsdt_add_pci_osc to be able to disable > > native pci hotplug. > > > > Signed-off-by: Eric Auger > > Reviewed-by: Gustavo Romero > > Hi Eric

[PATCH 06/14] rust: qemu-api: add bindings to Error

2025-05-30 Thread Paolo Bonzini
Provide an implementation of std::error::Error that bridges the Rust anyhow::Error and std::panic::Location types with QEMU's Error*. It also has several utility methods, analogous to error_propagate(), that convert a Result into a return value + Error** pair. Signed-off-by: Paolo Bonzini --- ru

Re: [PATCH v2 05/25] hw/pci-host/gpex-acpi: Split host bridge OSC and DSM generation

2025-05-30 Thread Jonathan Cameron via
On Tue, 27 May 2025 09:40:07 +0200 Eric Auger wrote: > acpi_dsdt_add_pci_osc() name is confusing as it gives the impression > it appends the _OSC method but in fact it also appends the _DSM method > for the host bridge. Let's split the function into two separate ones > and let them return the met

Re: [PATCH v2 09/25] hw/pci-host/gpex-acpi: Use build_pci_host_bridge_osc_method

2025-05-30 Thread Jonathan Cameron via
On Tue, 27 May 2025 09:40:11 +0200 Eric Auger wrote: > gpex build_host_bridge_osc() and x86 originated > build_pci_host_bridge_osc_method() are mostly identical. > > In GPEX, SUPP is set to CDW2 but is not further used. CTRL > is same as Local0. > > So let gpex code reuse build_pci_host_bridge_

Re: [PULL v2 00/25] Functional tests, Microblaze endianness & pc/q35 cleanups

2025-05-30 Thread Thomas Huth
On 29/05/2025 17.26, Stefan Hajnoczi wrote: On Wed, May 28, 2025 at 10:24:42PM +0200, Thomas Huth wrote: Hi Stefan! The following changes since commit 80db93b2b88f9b3ed8927ae7ac74ca30e643a83e: Merge tag 'pull-aspeed-20250526' of https://github.com/legoater/qemu into staging (2025-05-26 1

[PATCH v2 00/14] rust: bindings for Error

2025-05-30 Thread Paolo Bonzini
As explained for v1, the impetus for this series is to remove BqlCell<> from HPETState::num_timers. However, it's also an important step for QAPI: error propagation is pretty central for example to QMP, and the series is also a first example of two-way conversion between C and native-Rust structs

[PATCH 13/14] rust/hpet: Drop BqlCell wrapper for num_timers

2025-05-30 Thread Paolo Bonzini
From: Zhao Liu Now that the num_timers field is initialized as a property, someone may change its default value using qdev_prop_set_uint8(), but the value is fixed after the Rust code sees it first. Since there is no need to modify it after realize(), it is not to be necessary to have a BqlCell

[PATCH 10/14] hpet: adjust VMState for consistency with Rust version

2025-05-30 Thread Paolo Bonzini
No functional change intended. Suggested-by: Zhao Liu Signed-off-by: Paolo Bonzini --- hw/timer/hpet.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c index 0fd1337a156..9db027cf76f 100644 --- a/hw/timer/hpet.c +++ b/hw/timer/hpet.c @@

[PATCH 12/14] rust/hpet: return errors from realize if properties are incorrect

2025-05-30 Thread Paolo Bonzini
Match the code in hpet.c; this also allows removing the BqlCell from the num_timers field. Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- rust/hw/timer/hpet/src/device.rs | 16 +++- rust/hw/timer/hpet/src/fw_cfg.rs | 7 +++ 2 files changed, 10 insertions(+), 13 deletion

[PATCH 04/14] util/error: allow non-NUL-terminated err->src

2025-05-30 Thread Paolo Bonzini
Rust makes the current file available as a statically-allocated string, but without a NUL terminator. Allow this by storing an optional maximum length in the Error. Note that for portability I am not relying on fprintf's precision specifier not accessing memory beyond what will be printed. Signe

[PATCH 03/14] util/error: expose Error definition to Rust code

2025-05-30 Thread Paolo Bonzini
This is used to preserve the file and line in a roundtrip from C Error to Rust and back to C. Signed-off-by: Paolo Bonzini --- include/qapi/error-internal.h | 26 ++ rust/wrapper.h| 1 + util/error.c | 10 +- 3 files changed, 28 i

Re: [PATCH RFC 0/3] Attempt to add GHES for x86

2025-05-30 Thread Igor Mammedov
On Tue, 4 Mar 2025 14:30:55 +0100 Mauro Carvalho Chehab wrote: > Hi Igor, > > This patch series comes after: > > https://lore.kernel.org/qemu-devel/cover.1740903110.git.mchehab+hua...@kernel.org/ > > I'm basically trying to add support for error injection for x86, > without success so far.

Re: [PATCH v9 12/20] acpi/generic_event_device: add logic to detect if HEST addr is available

2025-05-30 Thread Igor Mammedov
On Fri, 30 May 2025 08:01:28 -0400 "Michael S. Tsirkin" wrote: > On Wed, May 28, 2025 at 05:42:12PM +0200, Igor Mammedov wrote: > > On Tue, 20 May 2025 08:41:31 +0200 > > Mauro Carvalho Chehab wrote: > > > > > Create a new property (x-has-hest-addr) and use it to detect if > > > the GHES tabl

Re: [PATCH 1/1] vhost: do not reset used_memslots when destroying vhost dev

2025-05-30 Thread David Hildenbrand
On 30.05.25 13:18, Michael S. Tsirkin wrote: On Wed, May 14, 2025 at 11:26:05AM +0200, David Hildenbrand wrote: On 14.05.25 11:12, Igor Mammedov wrote: On Tue, 13 May 2025 15:12:11 +0200 David Hildenbrand wrote: On 13.05.25 14:13, Igor Mammedov wrote: On Mon, 3 Mar 2025 13:02:17 -0500 yuan

Re: [PATCH v2 05/25] hw/pci-host/gpex-acpi: Split host bridge OSC and DSM generation

2025-05-30 Thread Jonathan Cameron via
On Fri, 30 May 2025 14:05:16 +0200 Igor Mammedov wrote: > On Fri, 30 May 2025 11:02:27 +0100 > Jonathan Cameron wrote: > > > On Tue, 27 May 2025 09:40:07 +0200 > > Eric Auger wrote: > > > > > acpi_dsdt_add_pci_osc() name is confusing as it gives the impression > > > it appends the _OSC meth

[PATCH v4 09/48] block: move drain outside of bdrv_try_change_aio_context()

2025-05-30 Thread Fiona Ebner
This is part of resolving the deadlock mentioned in commit "block: move draining out of bdrv_change_aio_context() and mark GRAPH_RDLOCK". Convert the function to a _locked() version that has to be called with the graph lock held and add a convenience wrapper that has to be called with the graph un

[PATCH v4 16/48] block: move drain outside of quorum_del_child()

2025-05-30 Thread Fiona Ebner
The quorum_del_child() callback runs under the graph lock, so it is not allowed to drain. It is only called as the .bdrv_del_child() callback, which is only called in the bdrv_del_child() function, which also runs under the graph lock. The bdrv_del_child() function is called by qmp_x_blockdev_chan

[PATCH v4 45/48] block: mark bdrv_close_all() as GRAPH_UNLOCKED

2025-05-30 Thread Fiona Ebner
The function bdrv_close_all() calls bdrv_drain_all(), which must be called with the graph unlocked. Signed-off-by: Fiona Ebner --- include/block/block-global-state.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/block/block-global-state.h b/include/block/block-glob

[PATCH v4 10/48] block: move drain outside of bdrv_attach_child_common(_abort)()

2025-05-30 Thread Fiona Ebner
This is part of resolving the deadlock mentioned in commit "block: move draining out of bdrv_change_aio_context() and mark GRAPH_RDLOCK". The function bdrv_attach_child_common_abort() is used only as the abort callback in bdrv_attach_child_common_drv transactions, so the tran_finalize() calls of s

[PATCH v4 18/48] blockdev: drain while unlocked in external_snapshot_action()

2025-05-30 Thread Fiona Ebner
This is in preparation to mark bdrv_drained_begin() as GRAPH_UNLOCKED. Signed-off-by: Fiona Ebner --- blockdev.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index 506755bef1..2e7fda6780 100644 --- a/blockdev.c +++ b/blockdev.c @@

[PATCH v4 43/48] block: mark bdrv_insert_node() as GRAPH_UNLOCKED

2025-05-30 Thread Fiona Ebner
The function bdrv_insert_node() calls bdrv_drained_begin() which must be called with the graph unlocked. Signed-off-by: Fiona Ebner --- include/block/block-global-state.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/block/block-global-state.h b/include/block/

[PATCH v4 30/48] block: drop wrapper for bdrv_set_backing_hd_drained()

2025-05-30 Thread Fiona Ebner
Nearly all callers (outside of the tests) are already using the _drained() variant of the function. It doesn't seem worth keeping. Simply adapt the remaining callers of bdrv_set_backing_hd() and rename bdrv_set_backing_hd_drained() to bdrv_set_backing_hd(). Signed-off-by: Fiona Ebner --- block.c

[PATCH v4 00/48] block: do not drain while holding the graph lock

2025-05-30 Thread Fiona Ebner
Previous discussions: v3: [0] v2: [1] v1: [2] Changes in v4: * Document requirement to drain all block nodes for affected functions. * Also cover the generated bdrv_co_unref_child(). * Remove now superfluous drain_bs variable in bdrv_set_backing_hd(). * Mark bdrv_graph_wrlock_drained() wrapper a

[PATCH v4 03/48] block/snapshot: move drain outside of read-locked bdrv_snapshot_delete()

2025-05-30 Thread Fiona Ebner
This is in preparation to mark bdrv_drained_begin() as GRAPH_UNLOCKED. More granular draining is not trivially possible, because bdrv_snapshot_delete() can recursively call itself. The return value of bdrv_all_delete_snapshot() changes from -1 to -errno propagated from failed sub-calls. This is f

[PATCH v4 31/48] block-backend: mark blk_drain_all() as GRAPH_UNLOCKED

2025-05-30 Thread Fiona Ebner
The function blk_drain_all() calls bdrv_drain_all_begin(), which must be called with the graph unlocked. Signed-off-by: Fiona Ebner --- include/system/block-backend-global-state.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/system/block-backend-global-state.h b/i

[PATCH v4 26/48] block/commit: switch to bdrv_set_backing_hd_drained() variant

2025-05-30 Thread Fiona Ebner
This is in preparation to mark bdrv_set_backing_hd() as GRAPH_UNLOCKED. Switch to using the bdrv_set_backing_hd_drained() variant. For the first pair of calls to avoid draining and locking twice in a row within the individual calls. For the third call, so that the drained and locked section can al

[PATCH v4 01/48] block: remove outdated comments about AioContext locking

2025-05-30 Thread Fiona Ebner
AioContext locking was removed in commit b49f4755c7 ("block: remove AioContext locking"). Signed-off-by: Fiona Ebner Reviewed-by: Kevin Wolf --- block.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/block.c b/block.c index f222e1a50a..a5399888ba 100644 --- a/block.c +++ b/block.c @@

[PATCH v4 23/48] block: never use atomics to access bs->quiesce_counter

2025-05-30 Thread Fiona Ebner
All accesses of bs->quiesce_counter are in the main thread, either after a GLOBAL_STATE_CODE() macro or in a function with GRAPH_WRLOCK annotation. This is essentially a revert of 414c2ec358 ("block: access quiesce_counter with atomic ops"). At that time, neither the GLOBAL_STATE_CODE() macro nor

[PATCH v4 06/48] block: mark change_aio_ctx() callback and instances as GRAPH_RDLOCK(_PTR)

2025-05-30 Thread Fiona Ebner
This is a small step in preparation to mark bdrv_drained_begin() as GRAPH_UNLOCKED. More concretely, it is in preparation to move the drain out of bdrv_change_aio_context() and marking that function as GRAPH_RDLOCK. Signed-off-by: Fiona Ebner Reviewed-by: Kevin Wolf --- block.c

[PATCH v4 32/48] block/snapshot: mark bdrv_all_delete_snapshot() as GRAPH_UNLOCKED

2025-05-30 Thread Fiona Ebner
The function bdrv_all_delete_snapshot() calls bdrv_drain_all_begin(), which must be called with the graph unlocked. Signed-off-by: Fiona Ebner --- include/block/snapshot.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/block/snapshot.h b/include/block/snapshot.

[PATCH v4 24/48] block: add bdrv_graph_wrlock_drained() convenience wrapper

2025-05-30 Thread Fiona Ebner
Many write-locked sections are also drained sections. A new bdrv_graph_wrunlock_drained() wrapper around bdrv_graph_wrunlock() is introduced, which will begin a drained section first. A global variable is used so bdrv_graph_wrunlock() knows if it also needs to end such a drained section. Both the a

[PATCH v4 35/48] block: mark bdrv_inactivate() as GRAPH_RDLOCK and move drain to callers

2025-05-30 Thread Fiona Ebner
The function bdrv_inactivate() calls bdrv_drain_all_begin(), which needs to be called with the graph unlocked, so either bdrv_inactivate() should be marked as GRAPH_UNLOCKED or the drain needs to be moved to the callers. The caller in qmp_blockdev_set_active() requires that the locked section cover

[PATCH v4 48/48] blockjob: mark block_job_remove_all_bdrv() as GRAPH_UNLOCKED

2025-05-30 Thread Fiona Ebner
The function block_job_remove_all_bdrv() calls bdrv_graph_wrlock_drained(), which must be called with the graph unlocked. Signed-off-by: Fiona Ebner --- include/block/blockjob.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/block/blockjob.h b/include/block/blockjob.

[PATCH v4 47/48] block: mark bdrv_open_child_common() and its callers GRAPH_UNLOCKED

2025-05-30 Thread Fiona Ebner
The function bdrv_open_child_common() calls bdrv_graph_wrlock_drained(), which must be called with the graph unlocked. Mark it and its two callers bdrv_open_file_child() and bdrv_open_child() as GRAPH_UNLOCKED. This requires temporarily unlocking in vmdk_parse_extents() and making the locked sectio

[PATCH v4 13/48] block: move drain outside of bdrv_attach_child()

2025-05-30 Thread Fiona Ebner
This is part of resolving the deadlock mentioned in commit "block: move draining out of bdrv_change_aio_context() and mark GRAPH_RDLOCK". The function bdrv_attach_child() runs under the graph lock, so it is not allowed to drain. It is called by: 1. replication_start() 2. quorum_add_child() 3. bdrv

[PATCH v4 11/48] block: move drain outside of bdrv_set_backing_hd_drained()

2025-05-30 Thread Fiona Ebner
This is part of resolving the deadlock mentioned in commit "block: move draining out of bdrv_change_aio_context() and mark GRAPH_RDLOCK". The function bdrv_set_backing_hd_drained() holds the graph lock, so it is not allowed to drain. It is called by: 1. bdrv_set_backing_hd(), where a drained secti

Re: [PATCH v7] hw/i386/cpu: remove default_cpu_version and simplify

2025-05-30 Thread Ani Sinha
> On 30 May 2025, at 8:37 PM, Igor Mammedov wrote: > > On Sun, 11 May 2025 09:40:08 -0400 > "Michael S. Tsirkin" wrote: > >> On Fri, Mar 07, 2025 at 03:53:28PM +0530, Ani Sinha wrote: >>> commit 0788a56bd1ae3 ("i386: Make unversioned CPU models be aliases") >>> introduced 'default_cpu_versio

[PATCH v4 29/48] blockdev: avoid locking and draining multiple times in external_snapshot_abort()

2025-05-30 Thread Fiona Ebner
By using the appropriate variants bdrv_set_backing_hd_drained() and bdrv_try_change_aio_context_locked(), there only needs to be a single drained and write-locked section in external_snapshot_abort(). Signed-off-by: Fiona Ebner --- The assumption in the added code comment about the reference is

[PATCH v4 39/48] block-backend: mark blk_io_limits_disable() as GRAPH_UNLOCKED

2025-05-30 Thread Fiona Ebner
The function blk_io_limits_disable() calls bdrv_drained_begin(), which must be called with the graph unlocked. Signed-off-by: Fiona Ebner --- include/system/block-backend-global-state.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/system/block-backend-global-state.

[PATCH v4 14/48] block: move drain outside of quorum_add_child()

2025-05-30 Thread Fiona Ebner
This is part of resolving the deadlock mentioned in commit "block: move draining out of bdrv_change_aio_context() and mark GRAPH_RDLOCK". The quorum_add_child() callback runs under the graph lock, so it is not allowed to drain. It is only called as the .bdrv_add_child() callback, which is only cal

[PATCH v4 17/48] blockdev: drain while unlocked in internal_snapshot_action()

2025-05-30 Thread Fiona Ebner
This is in preparation to mark bdrv_drained_begin() as GRAPH_UNLOCKED. Signed-off-by: Fiona Ebner --- blockdev.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index bd5ca77619..506755bef1 100644 --- a/blockdev.c +++ b/blockdev.c

[PATCH v4 37/48] block: mark blk_remove_bs() as GRAPH_UNLOCKED

2025-05-30 Thread Fiona Ebner
The function blk_remove_bs() calls bdrv_graph_wrlock_drained() and can also call bdrv_drained_begin(), both of which which must be called with the graph unlocked. Marking blk_remove_bs() as GRAPH_UNLOCKED requires temporarily unlocking in hmp_drive_del(). Signed-off-by: Fiona Ebner --- block/mo

[PATCH v4 07/48] block: mark bdrv_child_change_aio_context() GRAPH_RDLOCK

2025-05-30 Thread Fiona Ebner
This is a small step in preparation to mark bdrv_drained_begin() as GRAPH_UNLOCKED. More concretely, it is in preparation to move the drain out of bdrv_change_aio_context() and marking that function as GRAPH_RDLOCK. Signed-off-by: Fiona Ebner Reviewed-by: Kevin Wolf --- include/block/block-glob

[PATCH v4 15/48] block: move drain outside of bdrv_root_unref_child()

2025-05-30 Thread Fiona Ebner
This is part of resolving the deadlock mentioned in commit "block: move draining out of bdrv_change_aio_context() and mark GRAPH_RDLOCK". bdrv_root_unref_child() is called by: 1. blk_remove_bs(), where a drained section is introduced. 2. bdrv_unref_child(), which runs under the graph lock, so the

[PATCH v4 21/48] iotests/graph-changes-while-io: add test case with removal of lower snapshot

2025-05-30 Thread Fiona Ebner
From: Andrey Drobyshev This case is catching potential deadlock which takes place when job-dismiss is issued when I/O requests are processed in a separate iothread. See https://mail.gnu.org/archive/html/qemu-devel/2025-04/msg04421.html Signed-off-by: Andrey Drobyshev [FE: re-use top image and

[PATCH v4 46/48] block: mark bdrv_close() as GRAPH_UNLOCKED

2025-05-30 Thread Fiona Ebner
The functions blk_log_writes_close(), blkverify_close(), quorum_close(), vmdk_close() via vmdk_free_extents(), and other bdrv_close() implementations call bdrv_graph_wrlock_drained(), which must be called with the graph unlocked. They are reached via the BlockDriver's bdrv_close() callback and the

[PATCH v4 27/48] block: call bdrv_set_backing_hd() while unlocked in bdrv_open_backing_file()

2025-05-30 Thread Fiona Ebner
This is in preparation to mark bdrv_set_backing_hd() as GRAPH_UNLOCKED. Signed-off-by: Fiona Ebner --- block.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c index 1da10d55f0..ca3b67b233 100644 --- a/block.c +++ b/block.c @@ -3632,7 +3632,8 @@ int bdr

[PATCH v4 44/48] block: mark bdrv_drop_intermediate() as GRAPH_UNLOCKED

2025-05-30 Thread Fiona Ebner
The function bdrv_drop_intermediate() calls bdrv_drained_begin(), which must be called with the graph unlocked. Signed-off-by: Fiona Ebner --- include/block/block-global-state.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/block/block-global-state.h b/inclu

[PATCH v4 28/48] block: mark bdrv_set_backing_hd() as GRAPH_UNLOCKED

2025-05-30 Thread Fiona Ebner
The function bdrv_set_backing_hd() calls bdrv_drain_all_begin(), which must be called with the graph unlocked. Signed-off-by: Fiona Ebner --- include/block/block-global-state.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/block/block-global-state.h b/include/

[PATCH v4 12/48] block: move drain outside of bdrv_root_attach_child()

2025-05-30 Thread Fiona Ebner
This is part of resolving the deadlock mentioned in commit "block: move draining out of bdrv_change_aio_context() and mark GRAPH_RDLOCK". The function bdrv_root_attach_child() runs under the graph lock, so it is not allowed to drain. It is called by: 1. blk_insert_bs(), where a drained section is

[PATCH v4 08/48] block: move drain outside of bdrv_change_aio_context() and mark GRAPH_RDLOCK

2025-05-30 Thread Fiona Ebner
This is in preparation to mark bdrv_drained_begin() as GRAPH_UNLOCKED. Note that even if bdrv_drained_begin() were already marked as GRAPH_UNLOCKED, TSA would not complain about the instance in bdrv_change_aio_context() before this change, because it is preceded by a bdrv_graph_rdunlock_main_loop(

[PATCH v4 40/48] block/commit: mark commit_abort() as GRAPH_UNLOCKED

2025-05-30 Thread Fiona Ebner
The function commit_abort() calls bdrv_drained_begin(), which must be called with the graph unlocked. Also mark the JobDriver's abort() callback as GRAPH_UNLOCKED_PTR, because that is the callback via which commit_abort() is reached. Signed-off-by: Fiona Ebner --- block/commit.c | 2 +- inc

[PATCH v4 05/48] block: mark bdrv_parent_change_aio_context() GRAPH_RDLOCK

2025-05-30 Thread Fiona Ebner
This is a small step in preparation to mark bdrv_drained_begin() as GRAPH_UNLOCKED. More concretely, it allows marking the change_aio_ctx() callback GRAPH_RDLOCK_PTR, which is the next step. Signed-off-by: Fiona Ebner Reviewed-by: Kevin Wolf --- block.c | 8 1 file changed, 4 insertion

[PATCH v4 19/48] block: mark bdrv_drained_begin() and friends as GRAPH_UNLOCKED

2025-05-30 Thread Fiona Ebner
All of bdrv_drain_all_begin(), bdrv_drain_all() and bdrv_drained_begin() poll and are not allowed to be called with the block graph lock held. Mark the function as such. Suggested-by: Kevin Wolf Signed-off-by: Fiona Ebner --- include/block/block-global-state.h | 4 ++-- include/block/block-io.h

[PATCH v4 25/48] block/mirror: switch to bdrv_set_backing_hd_drained() variant

2025-05-30 Thread Fiona Ebner
This is in preparation to mark bdrv_set_backing_hd() as GRAPH_UNLOCKED. Switch to using the bdrv_set_backing_hd_drained() variant, so that the drained and locked section can also cover the calls to bdrv_skip_filters() and bdrv_cow_bs(). Signed-off-by: Fiona Ebner --- block/mirror.c | 12 +++

[PATCH v4 22/48] block/io: remove duplicate GLOBAL_STATE_CODE() in bdrv_do_drained_end()

2025-05-30 Thread Fiona Ebner
Both commit ab61335025 ("block: drain from main loop thread in bdrv_co_yield_to_drain()") and commit d05ab380db ("block: Mark drain related functions GRAPH_RDLOCK") introduced a GLOBAL_STATE_CODE() macro in bdrv_do_drained_end(). The assertion of being in the main thread cannot change here, so keep

[PATCH v4 34/48] block: mark bdrv_reopen_queue() and bdrv_reopen_multiple() as GRAPH_UNLOCKED

2025-05-30 Thread Fiona Ebner
The function bdrv_reopen_queue() can call bdrv_drain_all_begin(), which must be called with the graph unlocked. The function bdrv_reopen_multiple() calls bdrv_reopen_prepare() which must be called with the graph unlocked. To mark bdrv_reopen_queue() as GRAPH_UNLOCKED, it is necessary to make the

[PATCH v4 38/48] block: mark blk_drain() as GRAPH_UNLOCKED

2025-05-30 Thread Fiona Ebner
The function blk_drain() calls bdrv_drained_begin(), which must be called with the graph unlocked. Signed-off-by: Fiona Ebner --- include/system/block-backend-global-state.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/system/block-backend-global-state.h b/include

[PATCH v6 3/5] memory: Unify the definiton of ReplayRamPopulate() and ReplayRamDiscard()

2025-05-30 Thread Chenyi Qiang
Update ReplayRamDiscard() function to return the result and unify the ReplayRamPopulate() and ReplayRamDiscard() to ReplayRamDiscardState() at the same time due to their identical definitions. This unification simplifies related structures, such as VirtIOMEMReplayData, which makes it cleaner. Revi

[PATCH v6 4/5] ram-block-attributes: Introduce RamBlockAttributes to manage RAMBlock with guest_memfd

2025-05-30 Thread Chenyi Qiang
Commit 852f0048f3 ("RAMBlock: make guest_memfd require uncoordinated discard") highlighted that subsystems like VFIO may disable RAM block discard. However, guest_memfd relies on discard operations for page conversion between private and shared memory, potentially leading to the stale IOMMU mapping

[PATCH 4/4] iotests/244: Add test cases for keep_data_file

2025-05-30 Thread Hanna Czenczek
Add various test cases around keep_data_file to the existing data_file test suite 244. Signed-off-by: Hanna Czenczek --- tests/qemu-iotests/244 | 71 ++ tests/qemu-iotests/244.out | 53 2 files changed, 124 insertions(+) diff

[PATCH 2/4] qcow2: Simplify size round-up in co_create_opts

2025-05-30 Thread Hanna Czenczek
Use the now-existing qcow2_opts pointer to simplify the size rounding up code. Signed-off-by: Hanna Czenczek --- block/qcow2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index b11cbfd859..988ebcf138 100644 --- a/block/qcow2.c +++ b/block/q

[PATCH 0/4] qcow2: Add keep_data_file command-line option

2025-05-30 Thread Hanna Czenczek
Hi, This series adds a keep_data_file qemu-img create option to qcow2 that makes it keep the given external data file for a newly created image instead of overwriting it. This allows to create a qcow2 image for an existing raw image using the qemu-img create command, which previously wasn’t easil

[PATCH v6 0/5] Enable shared device assignment

2025-05-30 Thread Chenyi Qiang
This is the v6 series of the shared device assignment support. Compared with the last version [1], this series retains the basic support and removes the additional complex error handling, which can be added back when necessary. Meanwhile, the patchset has been re-organized to be clearer. Overview

[PATCH v6 1/5] memory: Export a helper to get intersection of a MemoryRegionSection with a given range

2025-05-30 Thread Chenyi Qiang
Rename the helper to memory_region_section_intersect_range() to make it more generic. Meanwhile, define the @end as Int128 and replace the related operations with Int128_* format since the helper is exported as a wider API. Suggested-by: Alexey Kardashevskiy Reviewed-by: Alexey Kardashevskiy Rev

[PATCH v6 5/5] physmem: Support coordinated discarding of RAM with guest_memfd

2025-05-30 Thread Chenyi Qiang
A new field, attributes, was introduced in RAMBlock to link to a RamBlockAttributes object, which centralizes all guest_memfd related information (such as fd and shared bitmap) within a RAMBlock. Create and initialize the RamBlockAttributes object upon ram_block_add(). Meanwhile, register the obje

Re: [PATCH v2 01/25] hw/i386/acpi-build: Make aml_pci_device_dsm() static

2025-05-30 Thread Jonathan Cameron via
On Tue, 27 May 2025 09:40:03 +0200 Eric Auger wrote: > No need to export aml_pci_device_dsm() as it is only used > in hw/i386/acpi-build.c. > > Signed-off-by: Eric Auger > Reviewed-by: Gustavo Romero > Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Jonathan Cameron > --- > include/hw/ac

[PATCH 3/4] iotests/common.filter: Sort keep_data_file

2025-05-30 Thread Hanna Czenczek
Sort the new keep_data_file creation option together with data_file and data_file_raw. Signed-off-by: Hanna Czenczek --- tests/qemu-iotests/common.filter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter index

Re: [PATCH v2 02/25] hw/arm/virt: Introduce machine state acpi pcihp flags and props

2025-05-30 Thread Jonathan Cameron via
On Tue, 27 May 2025 09:40:04 +0200 Eric Auger wrote: > acpi_pcihp VirtMachineClass state flag will allow > to opt in for acpi pci hotplug. This is guarded by a > class no_acpi_pcihp flag to manage compats (<= 10.0 > machine types will not support ACPI PCI hotplug). > > Machine state acpi_pcihp f

[PATCH 1/4] qcow2: Add keep_data_file command-line option

2025-05-30 Thread Hanna Czenczek
Add a command-line-only option to prevent overwriting the file specified as external data file. This option is only available on the qemu-img create command line, not via blockdev-create, as it makes no sense there: That interface separates file creation and formatting, so where the external data

Re: [PATCH v2 03/25] hw/acpi: Rename and move build_x86_acpi_pci_hotplug to pcihp

2025-05-30 Thread Jonathan Cameron via
On Tue, 27 May 2025 09:40:05 +0200 Eric Auger wrote: > We plan to reuse build_x86_acpi_pci_hotplug() implementation > for ARM so let's move the code to generic pcihp. > > Associated static aml_pci_pdsm() helper is also moved along. > build_x86_acpi_pci_hotplug is renamed into build_acpi_pci_hotp

[PATCH v2 1/4] backends/iommufd: Add a helper to invalidate user-managed HWPT

2025-05-30 Thread Zhenzhong Duan
This helper passes cache invalidation request from guest to invalidate stage-1 page table cache in host hardware. Signed-off-by: Nicolin Chen Signed-off-by: Zhenzhong Duan --- include/system/iommufd.h | 4 backends/iommufd.c | 36 backends/trace-

[PATCH v2 2/4] vfio/iommufd: Add properties and handlers to TYPE_HOST_IOMMU_DEVICE_IOMMUFD

2025-05-30 Thread Zhenzhong Duan
Enhance HostIOMMUDeviceIOMMUFD object with 3 new members, specific to the iommufd BE + 2 new class functions. IOMMUFD BE includes IOMMUFD handle, devid and hwpt_id. IOMMUFD handle and devid are used to allocate/free ioas and hwpt. hwpt_id is used to re-attach IOMMUFD backed device to its default V

Re: [PATCH] target/loongarch: add check for fcond

2025-05-30 Thread gaosong
PIng ! 在 2025/5/23 上午9:17, Song Gao 写道: fcond only has 22 types, add a check for fcond. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2972 Signed-off-by: Song Gao --- target/loongarch/tcg/insn_trans/trans_fcmp.c.inc | 11 --- target/loongarch/tcg/insn_trans/trans_vec.c.inc

[PULL 63/77] i386: Remove unused parameter "uint32_t bit" in feature_word_description()

2025-05-30 Thread Paolo Bonzini
From: Lei Wang Parameter "uint32_t bit" is not used in function feature_word_description(), so remove it. Signed-off-by: Lei Wang Reviewed-by: Igor Mammedov Reviewed-by: Xiaoyao Li Signed-off-by: Xiaoyao Li Reviewed-by: Zhao Liu Link: https://lore.kernel.org/r/20241217123932.948789-2-xiaoya

[PULL 38/77] i386/tdx: Finalize TDX VM

2025-05-30 Thread Paolo Bonzini
From: Xiaoyao Li Invoke KVM_TDX_FINALIZE_VM to finalize the TD's measurement and make the TD vCPUs runnable once machine initialization is complete. Signed-off-by: Xiaoyao Li Acked-by: Gerd Hoffmann Reviewed-by: Zhao Liu Link: https://lore.kernel.org/r/20250508150002.689633-27-xiaoyao...@inte

[PULL 33/77] i386/tdx: Track RAM entries for TDX VM

2025-05-30 Thread Paolo Bonzini
From: Xiaoyao Li The RAM of TDX VM can be classified into two types: - TDX_RAM_UNACCEPTED: default type of TDX memory, which needs to be accepted by TDX guest before it can be used and will be all-zeros after being accepted. - TDX_RAM_ADDED: the RAM that is ADD'ed to TD guest before run

[PULL 16/77] i386/tdx: Implement tdx_kvm_init() to initialize TDX VM context

2025-05-30 Thread Paolo Bonzini
From: Xiaoyao Li Implement TDX specific ConfidentialGuestSupportClass::kvm_init() callback, tdx_kvm_init(). Mark guest state is proctected for TDX VM. More TDX specific initialization will be added later. Signed-off-by: Xiaoyao Li Reviewed-by: Daniel P. Berrangé Reviewed-by: Zhao Liu Link:

[PULL 12/77] target/i386/emulate: more lflags cleanups

2025-05-30 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- target/i386/emulate/x86_flags.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/target/i386/emulate/x86_flags.c b/target/i386/emulate/x86_flags.c index 47bc19778c2..cc138c77494 100644 --- a/target/i386/emulate/x86_flags.c +++ b

[PULL 54/77] cpu: Don't set vcpu_dirty when guest_state_protected

2025-05-30 Thread Paolo Bonzini
From: Xiaoyao Li QEMU calls kvm_arch_put_registers() when vcpu_dirty is true in kvm_vcpu_exec(). However, for confidential guest, like TDX, putting registers is disallowed due to guest state is protected. Only set vcpu_dirty to true with guest state is not protected when creating the vcpu. Sign

[PULL 48/77] i386/tdx: Disable SMM for TDX VMs

2025-05-30 Thread Paolo Bonzini
From: Xiaoyao Li TDX doesn't support SMM and VMM cannot emulate SMM for TDX VMs because VMM cannot manipulate TDX VM's memory. Disable SMM for TDX VMs and error out if user requests to enable SMM. Signed-off-by: Xiaoyao Li Acked-by: Gerd Hoffmann Reviewed-by: Daniel P. Berrangé Reviewed-by:

[PULL 71/77] target/i386: Update EPYC CPU model for Cache property, RAS, SVM feature bits

2025-05-30 Thread Paolo Bonzini
From: Babu Moger Found that some of the cache properties are not set correctly for EPYC models. l1d_cache.no_invd_sharing should not be true. l1i_cache.no_invd_sharing should not be true. L2.self_init should be true. L2.inclusive should be true. L3.inclusive should not be true. L3.no_invd_shar

[PULL 65/77] i386/tdx: Fetch and validate CPUID of TD guest

2025-05-30 Thread Paolo Bonzini
From: Xiaoyao Li Use KVM_TDX_GET_CPUID to get the CPUIDs that are managed and enfored by TDX module for TD guest. Check QEMU's configuration against the fetched data. Print wanring message when 1. a feature is not supported but requested by QEMU or 2. QEMU doesn't want to expose a feature while

[PULL 05/77] meson: merge lib{system, user}_ss with {system, user}_ss

2025-05-30 Thread Paolo Bonzini
From: Pierrick Bouvier Now that target configuration can be applied to lib{system, user}_ss, there is no reason to keep that separate from the existing {system, user}_ss. The only difference is that we'll now compile those files with -DCOMPILING_SYSTEM_VS_USER, which removes poison for CONFIG_USE

[PULL 24/77] i386/tdx: Validate TD attributes

2025-05-30 Thread Paolo Bonzini
From: Xiaoyao Li Validate TD attributes with tdx_caps that only supported bits are allowed by KVM. Besides, sanity check the attribute bits that have not been supported by QEMU yet. e.g., debug bit, it will be allowed in the future when debug TD support lands in QEMU. Signed-off-by: Xiaoyao Li

[PULL 43/77] i386/cpu: introduce x86_confidential_guest_cpu_instance_init()

2025-05-30 Thread Paolo Bonzini
From: Xiaoyao Li To allow execute confidential guest specific cpu init operations. Signed-off-by: Xiaoyao Li Reviewed-by: Zhao Liu Link: https://lore.kernel.org/r/20250508150002.689633-32-xiaoyao...@intel.com Signed-off-by: Paolo Bonzini --- target/i386/confidential-guest.h | 11 +++

[PULL 69/77] docs: Add TDX documentation

2025-05-30 Thread Paolo Bonzini
From: Xiaoyao Li Add docs/system/i386/tdx.rst for TDX support, and add tdx in confidential-guest-support.rst Signed-off-by: Xiaoyao Li Link: https://lore.kernel.org/r/20250508150002.689633-56-xiaoyao...@intel.com Signed-off-by: Paolo Bonzini --- docs/system/confidential-guest-support.rst |

[PULL 37/77] i386/tdx: Call KVM_TDX_INIT_VCPU to initialize TDX vcpu

2025-05-30 Thread Paolo Bonzini
From: Xiaoyao Li TDX vcpu needs to be initialized by SEAMCALL(TDH.VP.INIT) and KVM provides vcpu level IOCTL KVM_TDX_INIT_VCPU for it. KVM_TDX_INIT_VCPU needs the address of the HOB as input. Invoke it for each vcpu after HOB list is created. Signed-off-by: Xiaoyao Li Acked-by: Gerd Hoffmann

  1   2   3   >