Re: [PATCH v2 1/6] hw/pci: Determine if rombar is explicitly enabled

2024-02-12 Thread Philippe Mathieu-Daudé
Hi Akihiko, On 10/2/24 11:24, Akihiko Odaki wrote: vfio determines if rombar is explicitly enabled by inspecting QDict. Inspecting QDict is not nice because QDict is untyped and depends on the details on the external interface. Add an infrastructure to determine if rombar is explicitly enabled t

Re: [PATCH v2 2/6] vfio: Avoid inspecting option QDict for rombar

2024-02-12 Thread Philippe Mathieu-Daudé
On 10/2/24 11:24, Akihiko Odaki wrote: Use pci_rom_bar_explicitly_enabled() to determine if rombar is explicitly enabled. Signed-off-by: Akihiko Odaki --- hw/vfio/pci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index d7fe06715c4b..441

Re: [PATCH v2 3/6] hw/qdev: Remove opts member

2024-02-12 Thread Philippe Mathieu-Daudé
On 10/2/24 11:24, Akihiko Odaki wrote: It is no longer used. Signed-off-by: Akihiko Odaki --- include/hw/qdev-core.h | 4 hw/core/qdev.c | 1 - system/qdev-monitor.c | 12 +++- 3 files changed, 7 insertions(+), 10 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

[PATCH v7 0/5] Support message-based DMA in vfio-user server

2024-02-12 Thread Mattias Nissler
This series adds basic support for message-based DMA in qemu's vfio-user server. This is useful for cases where the client does not provide file descriptors for accessing system memory via memory mappings. My motivating use case is to hook up device models as PCIe endpoints to a hardware design. Th

[PATCH v7 4/5] vfio-user: Message-based DMA support

2024-02-12 Thread Mattias Nissler
Wire up support for DMA for the case where the vfio-user client does not provide mmap()-able file descriptors, but DMA requests must be performed via the VFIO-user protocol. This installs an indirect memory region, which already works for pci_dma_{read,write}, and pci_dma_map works thanks to the ex

[PATCH v7 2/5] softmmu: Support concurrent bounce buffers

2024-02-12 Thread Mattias Nissler
When DMA memory can't be directly accessed, as is the case when running the device model in a separate process without shareable DMA file descriptors, bounce buffering is used. It is not uncommon for device models to request mapping of several DMA regions at the same time. Examples include: * net

[PATCH v7 1/5] softmmu: Per-AddressSpace bounce buffering

2024-02-12 Thread Mattias Nissler
Instead of using a single global bounce buffer, give each AddressSpace its own bounce buffer. The MapClient callback mechanism moves to AddressSpace accordingly. This is in preparation for generalizing bounce buffer handling further to allow multiple bounce buffers, with a total allocation limit c

Re: [PATCH v6 0/5] Support message-based DMA in vfio-user server

2024-02-12 Thread Mattias Nissler
Hi Jonathan, To the best of my knowledge, all patches in the series have been thoroughly reviewed. Admittedly, I got a bit distracted with other things though, so I've been dragging my feet on follow-through. Sorry about that. I've just taken another look and found it no longer applies cleanly to

[PATCH v7 3/5] Update subprojects/libvfio-user

2024-02-12 Thread Mattias Nissler
Brings in assorted bug fixes. The following are of particular interest with respect to message-based DMA support: * bb308a2 "Fix address calculation for message-based DMA" Corrects a bug in DMA address calculation. * 1569a37 "Pass server->client command over a separate socket pair" Adds suppo

[PATCH v7 5/5] vfio-user: Fix config space access byte order

2024-02-12 Thread Mattias Nissler
PCI config space is little-endian, so on a big-endian host we need to perform byte swaps for values as they are passed to and received from the generic PCI config space access machinery. Signed-off-by: Mattias Nissler --- hw/remote/vfio-user-obj.c | 4 ++-- 1 file changed, 2 insertions(+), 2 del

Re: [PATCH v2 2/6] vfio: Avoid inspecting option QDict for rombar

2024-02-12 Thread Cédric Le Goater
On 2/12/24 09:04, Philippe Mathieu-Daudé wrote: On 10/2/24 11:24, Akihiko Odaki wrote: Use pci_rom_bar_explicitly_enabled() to determine if rombar is explicitly enabled. Signed-off-by: Akihiko Odaki ---   hw/vfio/pci.c | 3 +--   1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/v

hw/qdev: Can qdev_unrealize() ever fail?

2024-02-12 Thread Philippe Mathieu-Daudé
Hi, QDev base class doesn't expect UNREALIZE to fail, and this handler is only recommended for hot-plug devices: /** * qdev_unrealize: Unrealize a device * @dev: device to unrealize * * Warning: most devices in QEMU do not expect to be unrealized. Only * devices which are hot-unpluggable sh

Re: [PATCH 01/14] migration: Add Error** argument to .save_setup() handler

2024-02-12 Thread Avihai Horon
Hi, Cedric On 07/02/2024 15:33, Cédric Le Goater wrote: External email: Use caution opening links or attachments The purpose is to record a potential error in the migration stream if qemu_savevm_state_setup() fails. Most of the current .save_setup() handlers can be modified to use the Error ar

Re: [PATCH 03/14] memory: Add Error** argument to .log_global*() handlers

2024-02-12 Thread Avihai Horon
Hi Cedric, On 09/02/2024 12:14, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 2/8/24 06:48, Peter Xu wrote: On Wed, Feb 07, 2024 at 02:33:36PM +0100, Cédric Le Goater wrote: @@ -2936,14 +2940,14 @@ void memory_global_dirty_log_start(unsigned int flags)

[PULL 2/4] tests/unit/test-char: Fix qemu_socket(), make_udp_socket() check

2024-02-12 Thread Markus Armbruster
qemu_socket() and make_udp_socket() return a file descriptor on success, -1 on failure. The check misinterprets 0 as failure. Fix that. Signed-off-by: Markus Armbruster Message-ID: <20240203080228.2766159-3-arm...@redhat.com> Reviewed-by: Marc-André Lureau Reviewed-by: Eric Blake --- tests/u

[PULL 1/4] chardev/parallel: Don't close stdin on inappropriate device

2024-02-12 Thread Markus Armbruster
The __linux__ version of qemu_chr_open_pp_fd() tries to claim the parport device with a PPCLAIM ioctl(). On success, it stores the file descriptor in the chardev object, and returns success. On failure, it closes the file descriptor, and returns failure. chardev_new() then passes the Chardev to

[PULL 0/4] Character device backend patches for 2024-02-12

2024-02-12 Thread Markus Armbruster
I offered Marc-André to do this pull request, and he accepted. The following changes since commit 5d1fc614413b10dd94858b07a1b2e26b1aa0296c: Merge tag 'migration-staging-pull-request' of https://gitlab.com/peterx/qemu into staging (2024-02-09 11:22:20 +) are available in the Git repository

Re: [PATCH 04/14] migration: Modify ram_init_bitmaps() to report dirty tracking errors

2024-02-12 Thread Avihai Horon
Hi Cedric, On 07/02/2024 15:33, Cédric Le Goater wrote: External email: Use caution opening links or attachments The .save_setup() handler has now an Error** argument that we can use to propagate errors reported by the .log_global_start() handler. Do that for the RAM. qemu_savevm_state_setup()

[PULL 3/4] qapi/char: Make backend types properly conditional

2024-02-12 Thread Markus Armbruster
Character backends are actually QOM types. When a backend's compile-time conditional QOM type is not compiled in, creation fails with "'FOO' is not a valid char driver name". Okay, except introspecting chardev-add with query-qmp-schema doesn't work then: the backend type is there even though the

Re: [PATCH 0/2] block: Allow concurrent BB context changes

2024-02-12 Thread Hanna Czenczek
On 10.02.24 09:46, Michael Tokarev wrote: 09.02.2024 19:51, Hanna Czenczek : On 09.02.24 15:08, Michael Tokarev wrote: 02.02.2024 17:47, Hanna Czenczek : Hi, Without the AioContext lock, a BB's context may kind of change at any time (unless it has a root node, and I/O requests are pending). T

[PULL 4/4] qapi/char: Deprecate backend type "memory"

2024-02-12 Thread Markus Armbruster
It's an alias for "ringbuf" we kept for backward compatibility; see commit 3a1da42eb35 (qapi: Rename ChardevBackend member "memory" to "ringbuf"). Deprecation is long overdue. Signed-off-by: Markus Armbruster Message-ID: <20240203080228.2766159-5-arm...@redhat.com> Reviewed-by: Marc-André Lureau

Re: [PATCH] This patch implements several Octeon +/II instructions.

2024-02-12 Thread Philippe Mathieu-Daudé
Hi, On 19/1/24 05:56, owl...@126.com wrote: From: owl Thank for your patch! Octeon+ - SAA - SAAD It seems it could be split in 3 parts, SA*, LA* and the rest. Octeon2 - LAI - LAID - LAD - LADD - LAS - LASD - LAC - LACD - LAA - LAAD - LAW - LAWD - LWX - LHX - LDX - LBUX - LWUX - LHUX

Re: [PATCH V3 02/13] migration: remove error from notifier data

2024-02-12 Thread David Hildenbrand
On 08.02.24 19:53, Steve Sistare wrote: Remove the error object from opaque data passed to notifiers. Use the new error parameter passed to the notifier instead. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu --- Would have squashed #1 and #2. Reviewed-by: David Hildenbrand -- Cheers,

Re: [PATCH V3 01/13] notify: pass error to notifier with return

2024-02-12 Thread David Hildenbrand
On 08.02.24 19:53, Steve Sistare wrote: Pass an error object as the third parameter to "notifier with return" notifiers, so clients no longer need to bundle an error object in the opaque data. The new parameter is used in a later patch. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu ---

Re: [PATCH V3 03/13] migration: convert to NotifierWithReturn

2024-02-12 Thread David Hildenbrand
On 08.02.24 19:53, Steve Sistare wrote: Change all migration notifiers to type NotifierWithReturn, so notifiers can return an error status in a future patch. For now, pass NULL for the notifier error parameter, and do not check the return value. Signed-off-by: Steve Sistare Reviewed-by: Peter

Re: [PATCH 06/15] qapi: Require member documentation (with loophole)

2024-02-12 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Mon, Feb 05, 2024 at 08:47:00AM +0100, Markus Armbruster wrote: >> The QAPI generator forces you to document your stuff. Except for >> command arguments, event data, and members of enum and object types: >> these the generator silently "documents" as "Not document

Re: [PATCH V3 04/13] migration: MigrationEvent for notifiers

2024-02-12 Thread David Hildenbrand
On 08.02.24 19:53, Steve Sistare wrote: Passing MigrationState to notifiers is unsound because they could access unstable migration state internals or even modify the state. Instead, pass the minimal info needed in a new MigrationEvent struct, which could be extended in the future if needed. Su

[PULL 04/18] qapi: Indent tagged doc comment sections properly

2024-02-12 Thread Markus Armbruster
docs/devel/qapi-code-gen demands that the "second and subsequent lines of sections other than "Example"/"Examples" should be indented". Commit a937b6aa739q (qapi: Reformat doc comments to conform to current conventions) missed a few instances, and messed up a few others. Clean that up. Signed-off-

[PULL 08/18] qga/qapi-schema: Clean up documentation of guest-set-vcpus

2024-02-12 Thread Markus Armbruster
The command's doc comment describes the argument, but it's not marked up as such. Easy enough to fix. Signed-off-by: Markus Armbruster Message-ID: <20240205074709.3613229-9-arm...@redhat.com> Reviewed-by: Daniel P. Berrangé --- qga/qapi-schema.json | 20 ++-- 1 file changed, 10

[PULL 03/18] qapi/block-core: Fix BlockLatencyHistogramInfo doc markup

2024-02-12 Thread Markus Armbruster
The description of @bins ends with a literal block: # @bins: list of io request counts corresponding to histogram # intervals, one more element than @boundaries has. For the # example above, @bins may be something like [3, 1, 5, 2], and # corresponding histogram looks

[PULL 06/18] qapi: Require member documentation (with loophole)

2024-02-12 Thread Markus Armbruster
The QAPI generator forces you to document your stuff. Except for command arguments, event data, and members of enum and object types: these the generator silently "documents" as "Not documented". We can't require proper documentation there without first fixing all the offenders. We've always had

[PULL 01/18] docs/devel/qapi-code-gen: Normalize version refs x.y.0 to just x.y

2024-02-12 Thread Markus Armbruster
Missed in commit 9bc6e893b72 (qapi: Normalize version references x.y.0 to just x.y). Signed-off-by: Markus Armbruster Message-ID: <20240205074709.3613229-2-arm...@redhat.com> Reviewed-by: Daniel P. Berrangé --- docs/devel/qapi-code-gen.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(

[PULL 15/18] qapi: Add missing union tag documentation

2024-02-12 Thread Markus Armbruster
Low-hanging fruit, and except for StatsFilter, the only members of these unions lacking documentation. Signed-off-by: Markus Armbruster Message-ID: <20240205074709.3613229-16-arm...@redhat.com> Reviewed-by: Daniel P. Berrangé --- qapi/block-core.json | 12 qapi/block-export.json

Re: [PATCH V3 06/13] migration: MigrationNotifyFunc

2024-02-12 Thread David Hildenbrand
On 08.02.24 19:53, Steve Sistare wrote: Define MigrationNotifyFunc to improve type safety and simplify migration notifiers. Signed-off-by: Steve Sistare --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH V3 07/13] migration: per-mode notifiers

2024-02-12 Thread David Hildenbrand
On 08.02.24 19:54, Steve Sistare wrote: Keep a separate list of migration notifiers for each migration mode. Suggested-by: Peter Xu Signed-off-by: Steve Sistare --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

[PULL 16/18] qapi/migration: Add missing tls-authz documentation

2024-02-12 Thread Markus Armbruster
From: Peter Xu As reported in Markus's recent enforcement series on qapi doc [1], we accidentally miss one entry for tls-authz. Add it. [1] https://lore.kernel.org/r/20240205074709.3613229-1-arm...@redhat.com Cc: Daniel P. Berrangé Cc: Fabiano Rosas Reported-by: Markus Armbruster Signed-off

[PULL 05/18] sphinx/qapidoc: Drop code to generate doc for simple union tag

2024-02-12 Thread Markus Armbruster
QAPISchemaGenRSTVisitor._nodes_for_members() has a special case to auto-generate documentation for a union tag member of implicit (enum) type that lacks documentation. This was useful for simple unions, where the tag member's type was implicitly. The only implicit enum type left today is 'QType'.

[PULL 09/18] qga/qapi-schema: Plug trivial documentation holes

2024-02-12 Thread Markus Armbruster
Add missing return member documentation of guest-get-disks, guest-get-devices, guest-get-diskstats, and guest-get-cpustats. The NVMe SMART information returned by guest-getdisks remains undocumented. Add a TODO there. Signed-off-by: Markus Armbruster Message-ID: <20240205074709.3613229-10-arm..

[PULL 18/18] MAINTAINERS: Cover qapi/stats.json

2024-02-12 Thread Markus Armbruster
Commit aa09b3d5f8e (stats: Move QMP commands from monitor/ to stats/) created section Stats, but neglected to add qapi/stats.json to it. Fix that. Signed-off-by: Markus Armbruster Message-ID: <20240205084747.3623569-3-arm...@redhat.com> Reviewed-by: Philippe Mathieu-Daudé --- MAINTAINERS | 1 +

[PULL 02/18] docs/devel/qapi-code-gen: Tweak doc comment whitespace

2024-02-12 Thread Markus Armbruster
Missed in commit a937b6aa739 (qapi: Reformat doc comments to conform to current conventions). Signed-off-by: Markus Armbruster Message-ID: <20240205074709.3613229-3-arm...@redhat.com> Reviewed-by: Daniel P. Berrangé --- docs/devel/qapi-code-gen.rst | 5 +++-- 1 file changed, 3 insertions(+), 2

[PULL 00/18] QAPI patches patches for 2024-02-12

2024-02-12 Thread Markus Armbruster
The following changes since commit 5d1fc614413b10dd94858b07a1b2e26b1aa0296c: Merge tag 'migration-staging-pull-request' of https://gitlab.com/peterx/qemu into staging (2024-02-09 11:22:20 +) are available in the Git repository at: https://repo.or.cz/qemu/armbru.git tags/pull-qapi-2024-0

[PULL 10/18] qapi/yank: Clean up documentaion of yank

2024-02-12 Thread Markus Armbruster
The command's doc comment describes the argument, but it's not marked up as such. Easy enough to fix. Signed-off-by: Markus Armbruster Message-ID: <20240205074709.3613229-11-arm...@redhat.com> Reviewed-by: Daniel P. Berrangé --- qapi/pragma.json | 3 +-- qapi/yank.json | 2 +- 2 files change

[PULL 13/18] qapi: Improve documentation of file descriptor socket addresses

2024-02-12 Thread Markus Armbruster
SocketAddress branch @fd is documented in enum SocketAddressType, unlike the other branches. That's because the branch's type is String from common.json. Use a local copy of String, so we can put the documentation in the usual place. Signed-off-by: Markus Armbruster Message-ID: <20240205074709.

[PULL 07/18] qga/qapi-schema: Clean up documentation of guest-set-memory-blocks

2024-02-12 Thread Markus Armbruster
The command's doc comment describes the argument, but it's not marked up as such. Easy enough to fix. Signed-off-by: Markus Armbruster Message-ID: <20240205074709.3613229-8-arm...@redhat.com> Reviewed-by: Daniel P. Berrangé --- qga/qapi-schema.json | 19 ++- 1 file changed, 10

[PULL 12/18] qapi: Plug trivial documentation holes around former simple unions

2024-02-12 Thread Markus Armbruster
The conversion of simple to flat unions left the @data members undocumented. Add documentation where it's trivial. Copy verbatim from the wrapped type's description where possible. Leftovers: String (to be taken care of in the next commit), and TransActionAction (left for another day). Signed-o

[PULL 14/18] qapi: Move @String out of common.json to discourage reuse

2024-02-12 Thread Markus Armbruster
Use of String is problematic, because it results in awkward interface documentation. The previous commit cleaned up one instance. Move String out of common.json next to its remaining users in net.json to discourage reuse elsewhere. Signed-off-by: Markus Armbruster Message-ID: <20240205074709.36

Re: [PATCH V3 08/13] migration: refactor migrate_fd_connect failures

2024-02-12 Thread David Hildenbrand
On 08.02.24 19:54, Steve Sistare wrote: Move common code for the error path in migrate_fd_connect to a shared fail label. No functional change. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

[PULL 11/18] qapi/dump: Clean up documentation of DumpGuestMemoryCapability

2024-02-12 Thread Markus Armbruster
The type's doc comment describes its member, but it's not marked up as such. Easy enough to fix. Signed-off-by: Markus Armbruster Message-ID: <20240205074709.3613229-12-arm...@redhat.com> Reviewed-by: Daniel P. Berrangé --- qapi/dump.json | 2 +- qapi/pragma.json | 1 - 2 files changed, 1 in

Re: [PATCH 08/14] vfio: Use new Error** argument in vfio_save_setup()

2024-02-12 Thread Avihai Horon
Hi Cedric, On 07/02/2024 15:33, Cédric Le Goater wrote: External email: Use caution opening links or attachments Add an Error** argument to vfio_migration_set_state() and adjust callers, including vfio_save_setup(). The error will be propagated up to qemu_savevm_state_setup() where the save_se

[PULL 17/18] MAINTAINERS: Cover qapi/cxl.json

2024-02-12 Thread Markus Armbruster
Commit 415442a1b4a (hw/mem/cxl_type3: Add CXL RAS Error Injection Support.) created qapi/cxl.json without adding it to MAINTAINERS. Fix that. Cc: Ben Widawsky Cc: Jonathan Cameron Cc: Fan Ni Signed-off-by: Markus Armbruster Message-ID: <20240205084747.3623569-2-arm...@redhat.com> Reviewed-by:

Re: [PATCH 09/14] vfio: Add Error** argument to .vfio_save_config() handler

2024-02-12 Thread Avihai Horon
On 07/02/2024 15:33, Cédric Le Goater wrote: External email: Use caution opening links or attachments Use vmstate_save_state_with_err() to improve error reporting in the callers. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 2 +- hw/vfio/migration.c | 18

Re: [PATCH v7 1/5] softmmu: Per-AddressSpace bounce buffering

2024-02-12 Thread Jonathan Cameron via
On Mon, 12 Feb 2024 00:06:13 -0800 Mattias Nissler wrote: > Instead of using a single global bounce buffer, give each AddressSpace > its own bounce buffer. The MapClient callback mechanism moves to > AddressSpace accordingly. > > This is in preparation for generalizing bounce buffer handling fur

Re: [PATCH v7 2/5] softmmu: Support concurrent bounce buffers

2024-02-12 Thread Jonathan Cameron via
On Mon, 12 Feb 2024 00:06:14 -0800 Mattias Nissler wrote: > When DMA memory can't be directly accessed, as is the case when > running the device model in a separate process without shareable DMA > file descriptors, bounce buffering is used. > > It is not uncommon for device models to request map

Re: [PATCH V3 09/13] migration: notifier error checking

2024-02-12 Thread David Hildenbrand
On 08.02.24 19:54, Steve Sistare wrote: Check the status returned by migration notifiers and report errors. If notifiers fail, call the notifiers again so they can clean up. IIUC, if any of the notifiers will actually start to fail, say, during MIG_EVENT_PRECOPY_SETUP, you will call MIG_EVENT_

Re: [PATCH 11/14] vfio: Extend vfio_set_migration_error() with Error* argument

2024-02-12 Thread Avihai Horon
Hi Cedric, On 07/02/2024 15:33, Cédric Le Goater wrote: External email: Use caution opening links or attachments vfio_set_migration_error() sets the 'return' error on the migration stream if a migration is in progress. To improve error reporting, add a new Error* argument to also set the Error

Re: hw/qdev: Can qdev_unrealize() ever fail?

2024-02-12 Thread Akihiko Odaki
On 2024/02/12 17:35, Philippe Mathieu-Daudé wrote: Hi, QDev base class doesn't expect UNREALIZE to fail, and this handler is only recommended for hot-plug devices: /**  * qdev_unrealize: Unrealize a device  * @dev: device to unrealize  *  * Warning: most devices in QEMU do not expect to be

Re: [PATCH v2 2/6] vfio: Avoid inspecting option QDict for rombar

2024-02-12 Thread Akihiko Odaki
On 2024/02/12 17:25, Cédric Le Goater wrote: On 2/12/24 09:04, Philippe Mathieu-Daudé wrote: On 10/2/24 11:24, Akihiko Odaki wrote: Use pci_rom_bar_explicitly_enabled() to determine if rombar is explicitly enabled. Signed-off-by: Akihiko Odaki ---   hw/vfio/pci.c | 3 +--   1 file changed, 1

[PATCH v3 4/7] hw/qdev: Remove opts member

2024-02-12 Thread Akihiko Odaki
It is no longer used. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- 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/include/hw/qdev-core.h b/include/

[PATCH v3 0/7] hw/pci: SR-IOV related fixes and improvements

2024-02-12 Thread Akihiko Odaki
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 are independently useful. This series extracts those fixes and improvements from the RFC series. Below is an explanat

[PATCH v3 5/7] pcie_sriov: Validate NumVFs

2024-02-12 Thread Akihiko Odaki
The guest may write NumVFs greater than TotalVFs and that can lead to buffer overflow in VF implementations. Fixes: 7c0fa8dff811 ("pcie: Add support for Single Root I/O Virtualization (SR/IOV)") Signed-off-by: Akihiko Odaki --- hw/pci/pcie_sriov.c | 3 +++ 1 file changed, 3 insertions(+) diff

[PATCH v3 6/7] pcie_sriov: Reuse SR-IOV VF device instances

2024-02-12 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 v3 2/7] hw/pci: Determine if rombar is explicitly enabled

2024-02-12 Thread Akihiko Odaki
vfio determines if rombar is explicitly enabled by inspecting QDict. Inspecting QDict is not nice because QDict is untyped and depends on the details on the external interface. Add an infrastructure to determine if rombar is explicitly enabled to hw/pci. Signed-off-by: Akihiko Odaki --- include/

[PATCH v3 1/7] hw/pci: Use -1 as a default value for rombar

2024-02-12 Thread Akihiko Odaki
Currently there is no way to distinguish the case that rombar is explicitly specified as 1 and the case that rombar is not specified. Set rombar -1 by default to distinguish these cases just as it is done for addr and romsize. It was confirmed that changing the default value to -1 will not change

[PATCH v3 3/7] vfio: Avoid inspecting option QDict for rombar

2024-02-12 Thread Akihiko Odaki
Use pci_rom_bar_explicitly_enabled() to determine if rombar is explicitly enabled. Signed-off-by: Akihiko Odaki --- hw/vfio/pci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index d7fe06715c4b..44178ac9355f 100644 --- a/hw/vfio/pci.c +++ b/

[PATCH v3 7/7] pcie_sriov: Release VFs failed to realize

2024-02-12 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

Re:Re: [PATCH] This patch implements several Octeon +/II instructions.

2024-02-12 Thread owl129
Hi > How can we test it? Is there any distribution producing kernel for > Octeon+/2? Per https://github.com/MarvellEmbeddedProcessors/marvell-dpdk > I understand there could be Linux and FreeBSD, is that correct?Actually I > don't know how to fully test each intruction. To the best of my knowl

Re: [PATCH v3 02/11] hw/rx/rx62n: Reduce inclusion of 'qemu/units.h'

2024-02-12 Thread Yoshinori Sato
On Fri, 09 Feb 2024 03:12:35 +0900, Philippe Mathieu-Daudé wrote: > > "qemu/units.h" is not used in the "hw/rx/rx62n.h" > header, include it in the source where it is. > > Signed-off-by: Philippe Mathieu-Daudé > --- > include/hw/rx/rx62n.h | 1 - > hw/rx/rx-gdbsim.c | 1 + > hw/rx/rx62n.c

Re: [PATCH v3 03/11] hw/rx/rx62n: Only call qdev_get_gpio_in() when necessary

2024-02-12 Thread Yoshinori Sato
On Fri, 09 Feb 2024 03:12:36 +0900, Philippe Mathieu-Daudé wrote: > > Instead of filling an array of all the possible IRQs, only call > qdev_get_gpio_in() when an IRQ is used. Remove the array from > RX62NState. Doing so we avoid calling qdev_get_gpio_in() on an > unrealized device. > > Signed-of

[PATCH] main-loop: Avoid some unnecessary poll calls

2024-02-12 Thread Ross Lagerwall via
A common pattern is seen where a timer fires, the callback does some work, then rearms the timer which implicitly calls qemu_notify_event(). qemu_notify_event() is supposed to interrupt the main loop's poll() by calling qemu_bh_schedule(). In the case that this is being called from a main loop cal

possible deprecation and removal of some old QEMU Arm machine types (pxa2xx, omap, sa1110)

2024-02-12 Thread Peter Maydell
QEMU includes some models of old Arm machine types which are a bit problematic for us because: * they're written in a very old way that uses numerous APIs that we would like to get away from (eg they don't use qdev, they use qemu_system_reset_request(), they use vmstate_register(), etc) * t

Re: [PATCH v3 07/11] hw/sh4/r2d: Realize IDE controller before accessing it

2024-02-12 Thread Yoshinori Sato
On Fri, 09 Feb 2024 03:12:40 +0900, Philippe Mathieu-Daudé wrote: > > We should not wire IRQs on unrealized device. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/sh4/r2d.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c > index e9f316

Re: [PATCH 13/14] migration: Use migrate_has_error() in close_return_path_on_source()

2024-02-12 Thread Cédric Le Goater
On 2/8/24 14:57, Fabiano Rosas wrote: Cédric Le Goater writes: On 2/8/24 14:07, Fabiano Rosas wrote: Cédric Le Goater writes: close_return_path_on_source() retrieves the migration error from the the QEMUFile '->to_dst_file' to know if a shutdown is required. This shutdown is required to ex

Re: [PATCH v3] hw/usb: fix xhci port notify

2024-02-12 Thread Nikita Ostrenkov
(+Michael) ping https://patchew.org/QEMU/20231117173916.3658-1-n.ostren...@gmail.com/ чт, 25 янв. 2024 г. в 23:06, Nikita Ostrenkov : > ping > https://patchew.org/QEMU/20231117173916.3658-1-n.ostren...@gmail.com/ > > пн, 18 дек. 2023 г., 13:40 Nikita Ostrenkov : > >> ping >> https://patchew.org/

[PATCH RFCv2 2/8] vfio/iommufd: Introduce auto domain creation

2024-02-12 Thread Joao Martins
There's generally two modes of operation for IOMMUFD: * The simple user API which intends to perform relatively simple things with IOMMUs e.g. DPDK. It generally creates an IOAS and attach to VFIO and mainly performs IOAS_MAP and UNMAP. * The native IOMMUFD API where you have fine grained control

[PATCH RFCv2 0/8] vfio/iommufd: IOMMUFD Dirty Tracking

2024-02-12 Thread Joao Martins
This small series adds support for Dirty Tracking in IOMMUFD backend. The sole reason I still made it RFC is because of the second patch, where we are implementing user-managed auto domains. In essence it is quite similar to the original IOMMUFD series where we would allocate a HWPT, until we swit

[PATCH RFCv2 1/8] backends/iommufd: Introduce helper function iommufd_device_get_hw_capabilities()

2024-02-12 Thread Joao Martins
The new helper will fetch vendor agnostic IOMMU capabilities supported both by hardware and software. Right now it is only iommu dirty tracking. Signed-off-by: Joao Martins --- backends/iommufd.c | 25 + include/sysemu/iommufd.h | 2 ++ 2 files changed, 27 insertio

[PATCH RFCv2 5/8] vfio/iommufd: Implement VFIOIOMMUClass::query_dirty_bitmap support

2024-02-12 Thread Joao Martins
ioctl(iommufd, IOMMU_HWPT_GET_DIRTY_BITMAP, arg) is the UAPI that fetches the bitmap that tells what was dirty in an IOVA range. A single bitmap is allocated and used across all the hwpts sharing an IOAS which is then used in log_sync() to set Qemu global bitmaps. Signed-off-by: Joao Martins ---

[PATCH RFCv2 6/8] backends/iommufd: Add ability to disable hugepages

2024-02-12 Thread Joao Martins
Allow disabling hugepages to be dirty track at base page granularity in similar vein to vfio_type1_iommu.disable_hugepages but per IOAS. Signed-off-by: Joao Martins --- backends/iommufd.c | 36 backends/trace-events| 1 + hw/vfio/iommufd.c|

[PATCH RFCv2 3/8] vfio/iommufd: Probe and request hwpt dirty tracking capability

2024-02-12 Thread Joao Martins
Probe hardware dirty tracking support by querying device hw capabilities via IOMMUFD_GET_HW_INFO. In preparation to using the dirty tracking UAPI, request dirty tracking in the HWPT flags when the device doesn't support dirty page tracking or has it disabled; or when support when the VF backing IO

[PATCH RFCv2 4/8] vfio/iommufd: Implement VFIOIOMMUClass::set_dirty_tracking support

2024-02-12 Thread Joao Martins
ioctl(iommufd, IOMMU_HWPT_SET_DIRTY_TRACKING, arg) is the UAPI that enables or disables dirty page tracking. It is called on the whole list of iommu domains it is are tracking, and on failure it rolls it back. Signed-off-by: Joao Martins --- backends/iommufd.c | 19 +++ ba

[PATCH RFCv2 7/8] vfio/migration: Don't block migration device dirty tracking is unsupported

2024-02-12 Thread Joao Martins
By default VFIO migration is set to auto, which will support live migration if the migration capability is set *and* also dirty page tracking is supported. For testing purposes one can force enable without dirty page tracking via enable-migration=on, but that option is generally left for testing p

[PATCH RFCv2 8/8] vfio/common: Allow disabling device dirty page tracking

2024-02-12 Thread Joao Martins
The property 'x-pre-copy-dirty-page-tracking' allows disabling the whole tracking of VF pre-copy phase of dirty page tracking, though it means that it will only be used at the start of the switchover phase. Add an option that disables the VF dirty page tracking, and fall back into container-based

Re: possible deprecation and removal of some old QEMU Arm machine types (pxa2xx, omap, sa1110)

2024-02-12 Thread Guenter Roeck
On 2/12/24 04:32, Peter Maydell wrote: QEMU includes some models of old Arm machine types which are a bit problematic for us because: * they're written in a very old way that uses numerous APIs that we would like to get away from (eg they don't use qdev, they use qemu_system_reset_reque

[PATCH v2] tap-win32: Remove unnecessary stubs

2024-02-12 Thread Akihiko Odaki
, -.using_vnet_hdr = tap_using_vnet_hdr, -.set_offload = tap_set_offload, -.set_vnet_hdr_len = tap_set_vnet_hdr_len, }; static int tap_win32_init(NetClientState *peer, const char *model, --- base-commit: 5d1fc614413b10dd94858b07a1b2e26b1aa0296c change-id: 20240212-tap-51087194c8eb

Re: [PULL 00/61] riscv-to-apply queue

2024-02-12 Thread Peter Maydell
On Fri, 9 Feb 2024 at 10:59, Alistair Francis wrote: > > The following changes since commit 03e4bc0bc02779fdf6f8e8d83197f05e70881abf: > > Merge tag 'pull-tcg-20240205-2' of https://gitlab.com/rth7680/qemu into > staging (2024-02-08 16:08:42 +) > > are available in the Git repository at: > >

Re: possible deprecation and removal of some old QEMU Arm machine types (pxa2xx, omap, sa1110)

2024-02-12 Thread Guenter Roeck
[ sorry for the earlier noise; accidentally hit "send" ] On 2/12/24 04:32, Peter Maydell wrote: QEMU includes some models of old Arm machine types which are a bit problematic for us because: * they're written in a very old way that uses numerous APIs that we would like to get away from (eg

Re: [PATCH 01/14] migration: Add Error** argument to .save_setup() handler

2024-02-12 Thread Cédric Le Goater
On 2/12/24 09:36, Avihai Horon wrote: Hi, Cedric On 07/02/2024 15:33, Cédric Le Goater wrote: External email: Use caution opening links or attachments The purpose is to record a potential error in the migration stream if qemu_savevm_state_setup() fails. Most of the current .save_setup() handl

Re: [PATCH] iotests: Make 144 deterministic again

2024-02-12 Thread Stefan Hajnoczi
On Fri, Feb 09, 2024 at 06:31:03PM +0100, Kevin Wolf wrote: > Since commit effd60c8 changed how QMP commands are processed, the order > of the block-commit return value and job events in iotests 144 wasn't > fixed and more and caused the test to fail intermittently. > > Change the test to cache ev

Re: [PATCH V3 09/13] migration: notifier error checking

2024-02-12 Thread Steven Sistare
On 2/12/2024 4:24 AM, David Hildenbrand wrote: > On 08.02.24 19:54, Steve Sistare wrote: >> Check the status returned by migration notifiers and report errors. >> If notifiers fail, call the notifiers again so they can clean up. > > IIUC, if any of the notifiers will actually start to fail, say, d

Re: [RFC PATCH 14/14] migration: Fix return-path thread exit

2024-02-12 Thread Cédric Le Goater
Hello Fabiano On 2/8/24 14:29, Fabiano Rosas wrote: Cédric Le Goater writes: In case of error, close_return_path_on_source() can perform a shutdown to exit the return-path thread. However, in migrate_fd_cleanup(), 'to_dst_file' is closed before calling close_return_path_on_source() and the s

Re: [PATCH 01/14] migration: Add Error** argument to .save_setup() handler

2024-02-12 Thread Avihai Horon
On 12/02/2024 16:49, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 2/12/24 09:36, Avihai Horon wrote: Hi, Cedric On 07/02/2024 15:33, Cédric Le Goater wrote: External email: Use caution opening links or attachments The purpose is to record a potentia

Requesting suggestions on how to access I2C Bus of the Guest OS

2024-02-12 Thread Harshit Aghera
We have a Linux image targeted for architecture Cortex A7, that we are running inside QEMU on x86 machine. Our Linux image has I2C slave with EEPROM backend, instantiated from user-space. Reference - Linux I2C slave EEPROM backend - The Linux Kernel documentation

Re: [RFC PATCH 14/14] migration: Fix return-path thread exit

2024-02-12 Thread Cédric Le Goater
Hello Peter On 2/8/24 06:57, Peter Xu wrote: On Wed, Feb 07, 2024 at 02:33:47PM +0100, Cédric Le Goater wrote: In case of error, close_return_path_on_source() can perform a shutdown to exit the return-path thread. However, in migrate_fd_cleanup(), 'to_dst_file' is closed before calling close_r

Re: [PATCH v6 0/2] acpi: report numa nodes for device memory using GI

2024-02-12 Thread Michael S. Tsirkin
On Thu, Jan 04, 2024 at 03:05:27AM +, Ankit Agrawal wrote: > > >> > >> -numa node,nodeid=2 -numa node,nodeid=3 -numa node,nodeid=4 \ > >> -numa node,nodeid=5 -numa node,nodeid=6 -numa node,nodeid=7 \ > >> -numa node,nodeid=8 -numa node,nodeid=9 \ > >> -device > >> vfio-pci-nohotplug,host=0009

Re: Requesting suggestions on how to access I2C Bus of the Guest OS

2024-02-12 Thread Peter Maydell
On Mon, 12 Feb 2024 at 16:01, Harshit Aghera wrote: > > We have a Linux image targeted for architecture Cortex A7, that we are > running inside QEMU on x86 machine. > > > > Our Linux image has I2C slave with EEPROM backend, instantiated from > user-space. Reference - Linux I2C slave EEPROM backe

Bug: physmem: address_space_read_cached_slow() accesses wrong MemoryRegion on latter part of large reads.

2024-02-12 Thread Jonathan Cameron via
Hi All, The continuing saga of a getting CXL emulation to play well with using the memory as normal RAM ran into (hopefully) a last issue. When running my boot image via virtio-blk-pci and having deliberately forced some buffers to end up in the CXL memory via $ numactl --membind=1 ls then on sh

Re: [PATCH RFCv2 2/8] vfio/iommufd: Introduce auto domain creation

2024-02-12 Thread Jason Gunthorpe
On Mon, Feb 12, 2024 at 01:56:37PM +, Joao Martins wrote: > There's generally two modes of operation for IOMMUFD: > > * The simple user API which intends to perform relatively simple things > with IOMMUs e.g. DPDK. It generally creates an IOAS and attach to VFIO > and mainly performs IOAS_MAP

[PATCH 0/2] hw/arm: Fix STM32L4x5 EXTI to CPU irq fan-in connections

2024-02-12 Thread Inès Varhol
The original code was connecting several outbounds qemu_irqs to the same qemu_irq without using a TYPE_OR_IRQ. This patch fixes the issue by using OR gates when necessary (1st commit). I attempted to check that the problem is fixed by using a QTest (2nd commit) but actually the test is passing ev

[PATCH 2/2] tests/qtest: Check that EXTI fan-in irqs are correctly connected

2024-02-12 Thread Inès Varhol
This commit adds a QTest that verifies each input line of a specific EXTI OR gate can influence the output line. Signed-off-by: Inès Varhol --- tests/qtest/stm32l4x5_exti-test.c | 97 +++ 1 file changed, 97 insertions(+) diff --git a/tests/qtest/stm32l4x5_exti-test.c

[PATCH 1/2] hw/arm: Use TYPE_OR_IRQ when connecting STM32L4x5 EXTI fan-in IRQs

2024-02-12 Thread Inès Varhol
Fixes: 52671f69f7a4 ("[PATCH v8 0/3] Add device STM32L4x5 EXTI") Signed-off-by: Inès Varhol --- hw/arm/stm32l4x5_soc.c | 69 -- 1 file changed, 59 insertions(+), 10 deletions(-) diff --git a/hw/arm/stm32l4x5_soc.c b/hw/arm/stm32l4x5_soc.c index f470ff74ec.

  1   2   >