Re: [PATCH v2 04/12] python: update shebangs to standard, using /usr/bin/env

2025-06-16 Thread Akihiko Odaki
easily.) Signed-off-by: John Snow Reviewed-by: Akihiko Odaki

Re: [PATCH v2 00/12] Python: Fix 'make check-dev' and modernize to 3.9+

2025-06-16 Thread Akihiko Odaki
ny time. I figured now was a good time as any to get rid of them before they become a problem randomly some day in the future. I guess you meant that the old style type hints are deprecated. Regards, Akihiko Odaki

Re: [PATCH v2 02/12] python: update pylint ignores

2025-06-16 Thread Akihiko Odaki
On 2025/06/13 5:54, John Snow wrote: The next patch will synchronize the qemu.qmp library with the external, standalone version. That synchronization will require an extra ignore for pylint, so do that now. Signed-off-by: John Snow Reviewed-by: Akihiko Odaki

Re: [PATCH v2 05/12] python: fix illegal escape sequences

2025-06-16 Thread Akihiko Odaki
On 2025/06/13 5:54, John Snow wrote: \{ is an illegal escape sequence, to get a literal backslash we need to use \\. This is being fixed because of an issue spotted when attempting to use the pyupgrade script. Signed-off-by: John Snow Reviewed-by: Akihiko Odaki

Re: [PATCH v2 03/12] python: sync changes from external qemu.qmp package

2025-06-16 Thread Akihiko Odaki
erent repositories. Signed-off-by: John Snow Reviewed-by: Akihiko Odaki

[PATCH v2] file-posix: Tolerate unaligned hole at middle

2025-05-29 Thread Akihiko Odaki
the alignment of holes. So stop asserting the assumption on the holes and handle unaligned holes properly. Signed-off-by: Akihiko Odaki --- Changes in v2: - Changed to round the number also when the specified offset in a hole. - Changed to iterate until finding an aligned location. - Link to v1:

Re: [PATCH] file-posix: Tolerate unaligned hole at middle

2025-05-28 Thread Akihiko Odaki
On 2025/05/28 22:00, 'Eric Blake' via devel wrote: On Wed, May 28, 2025 at 08:30:05PM +0900, Akihiko Odaki wrote: file-posix used to assume that existing holes satisfy the requested alignment, which equals to the estimated direct I/O alignment requirement if direct I/O is requested,

[PATCH] file-posix: Tolerate unaligned hole at middle

2025-05-28 Thread Akihiko Odaki
the alignment of holes. So stop asserting the assumption on the holes and tolerate them being unaligned. Signed-off-by: Akihiko Odaki --- block/file-posix.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index ec95b7

Re: [PATCH v5 03/11] tests/qtest: Add libqos function for testing msix interrupt status

2025-05-04 Thread Akihiko Odaki
On 2025/05/02 12:04, Nicholas Piggin wrote: This function is duplicated 3 times, with more potential future users. Factor it into libqos, using qtest_memset instead of qtest_writel to clear the message just because that looks nicer with the qtest_memread used to read it. Reviewed-by: Philippe Ma

Re: [PATCH v5 06/11] tests/qtest/ahci: don't unmap pci bar if it wasn't mapped

2025-05-04 Thread Akihiko Odaki
On 2025/05/02 12:04, Nicholas Piggin wrote: ahci-test has a bunch of tests where the pci bar was not mapped. Avoid unmapping it in these cases, to keep iomaps balanced. Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Cc: Akihiko Odaki Cc: Fabiano Rosas Signed-off-by: Nicholas Piggin

Re: [PATCH v5 02/11] tests/qtest: Fix virtio msix message endianness

2025-05-04 Thread Akihiko Odaki
On 2025/05/02 12:04, Nicholas Piggin wrote: msix messages are written to memory in little-endian order, so they should not be byteswapped depending on target endianness, but read as le and converted to host endian by the qtest. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Fabiano Rosas Sig

Re: [PATCH v5 05/11] tests/qtest/ahci: unmap pci bar before reusing device

2025-05-04 Thread Akihiko Odaki
On 2025/05/02 12:04, Nicholas Piggin wrote: ahci-test double-maps the hba bar in the pending_callback test. Unmap it first, to keep iomaps balanced. Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Cc: Akihiko Odaki Reviewed-by: Akihiko Odaki Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas

Re: [PATCH v4 4/7] tests/qtest/libquos/pci: Add migration fixup helper for pci devices

2025-04-19 Thread Akihiko Odaki
noop and will be used subsequently. Signed-off-by: Nicholas Piggin Reviewed-by: Akihiko Odaki

Re: [PATCH v4 2/7] tests/qtest/ahci: don't unmap pci bar if it wasn't mapped

2025-04-19 Thread Akihiko Odaki
On 2025/04/11 13:41, Nicholas Piggin wrote: ahci-test has a bunch of tests where the pci bar was not mapped. Avoid unmapping it in these cases, to keep iomaps balanced. Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Cc: Akihiko Odaki Cc: Akihiko Odaki My address is duplicated. Cc: Fabiano

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

2025-03-20 Thread Akihiko Odaki
tested changes you found significant, - you found no problems with them, and - you are fine to record that in Git commit logs Pasha Tatashin (who told me they tried the patches), it would be nice if you do the same. Regards, Akihiko Odaki Yui On 2025/03/14 15:14, Akihiko Odaki wrote

[PATCH for-10.1 v9 8/9] docs: Document composable SR-IOV device

2025-03-15 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- MAINTAINERS | 1 + docs/system/index.rst | 1 + docs/system/sriov.rst | 36 3 files changed, 38 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 0e5db7a57449..4cde71687645 100644 --- a/MAINTAINERS +++ b

[PATCH for-10.1 v9 2/9] hw/pci: Fix SR-IOV VF number calculation

2025-03-15 Thread Akihiko Odaki
pci_config_get_bar_addr() had a division by vf_stride. vf_stride needs to be non-zero when there are multiple VFs, but the specification does not prohibit to make it zero when there is only one VF. Do not perform the division for the first VF to avoid division by zero. Signed-off-by: Akihiko

[PATCH for-10.1 v9 1/9] hw/pci: Do not add ROM BAR for SR-IOV VF

2025-03-15 Thread Akihiko Odaki
A SR-IOV VF cannot have a ROM BAR. Co-developed-by: Yui Washizu Signed-off-by: Akihiko Odaki --- hw/pci/pci.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 2844ec55560f..8460b6105338 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2522,6

[PATCH for-10.1 v9 3/9] pcie_sriov: Ensure PF and VF are mutually exclusive

2025-03-13 Thread Akihiko Odaki
A device cannot be a SR-IOV PF and a VF at the same time. Signed-off-by: Akihiko Odaki --- hw/pci/pcie_sriov.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/pci/pcie_sriov.c b/hw/pci/pcie_sriov.c index 1eb4358256de..109b2ebcccba 100644 --- a/hw/pci/pcie_sriov.c +++ b/hw/pci

[PATCH for-10.1 v9 5/9] pcie_sriov: Allow user to create SR-IOV device

2025-03-13 Thread Akihiko Odaki
-creatable VFs can be attached calls pcie_sriov_pf_init_from_user_created_vfs() during realization and pcie_sriov_pf_exit() when exiting. Signed-off-by: Akihiko Odaki --- include/hw/pci/pci_device.h | 6 +- include/hw/pci/pcie_sriov.h | 18 +++ hw/pci/pci.c| 62 ++ hw/pci

[PATCH for-10.1 v9 7/9] virtio-net: Implement SR-IOV VF

2025-03-13 Thread Akihiko Odaki
A virtio-net device can be added as a SR-IOV VF to another virtio-pci device that will be the PF. Signed-off-by: Akihiko Odaki --- hw/virtio/virtio-net-pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/virtio-net-pci.c b/hw/virtio/virtio-net-pci.c index e18953ad674b

[PATCH for-10.1 v9 4/9] pcie_sriov: Check PCI Express for SR-IOV PF

2025-03-13 Thread Akihiko Odaki
SR-IOV requires PCI Express. Signed-off-by: Akihiko Odaki --- hw/pci/pcie_sriov.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/pci/pcie_sriov.c b/hw/pci/pcie_sriov.c index 109b2ebcccba..a5b546abe8bb 100644 --- a/hw/pci/pcie_sriov.c +++ b/hw/pci/pcie_sriov.c @@ -42,6 +42,11

[PATCH for-10.1 v9 9/9] pcie_sriov: Make a PCI device with user-created VF ARI-capable

2025-03-13 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- docs/system/sriov.rst | 3 ++- include/hw/pci/pcie_sriov.h | 7 +-- hw/pci/pcie_sriov.c | 8 +++- hw/virtio/virtio-pci.c | 16 ++-- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/docs/system/sriov.rst b

[PATCH for-10.1 v9 6/9] virtio-pci: Implement SR-IOV PF

2025-03-13 Thread Akihiko Odaki
Allow user to attach SR-IOV VF to a virtio-pci PF. Signed-off-by: Akihiko Odaki --- include/hw/virtio/virtio-pci.h | 1 + hw/virtio/virtio-pci.c | 20 +++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/include/hw/virtio/virtio-pci.h b/include/hw/virtio

[PATCH for-10.1 v9 0/9] virtio-net: add support for SR-IOV emulation

2025-03-13 Thread Akihiko Odaki
OV VFs with virtio-net-pci. [1] https://patchew.org/QEMU/1689731808-3009-1-git-send-email-yui.wash...@gmail.com/ [2] https://lore.kernel.org/all/5d46f455-f530-4e5e-9ae7-13a2297d4...@daynix.com/ Co-developed-by: Yui Washizu Signed-off-by: Akihiko Odaki --- Changes in v9: - Rebased. - Link to

Re: [PATCH v20 00/11] hw/pci: SR-IOV related fixes and improvements

2025-02-14 Thread Akihiko Odaki
Hi Michael, It has been a while since this series was reviewed by maintainers of relevant architectures. Can you check if this series is ready to pull? Regards, Akihiko Odaki On 2025/01/16 18:00, Akihiko Odaki wrote: Supersedes: <20240714-rombar-v2-0-af1504ef5...@daynix.com> ("[P

Re: [PATCH v7 1/2] memory: Update inline documentation

2025-01-18 Thread Akihiko Odaki
On 2025/01/18 2:46, Peter Xu wrote: On Fri, Jan 17, 2025 at 03:24:34PM +0900, Akihiko Odaki wrote: On 2025/01/16 23:33, Peter Xu wrote: On Thu, Jan 16, 2025 at 02:37:38PM +0900, Akihiko Odaki wrote: On 2025/01/16 1:14, Peter Xu wrote: On Thu, Jan 16, 2025 at 12:52:56AM +0900, Akihiko Odaki

Re: [PATCH v3 0/4] qtest/libqos/pci: pci and msix fixes

2025-01-18 Thread Akihiko Odaki
, Reviewed-by: Akihiko Odaki Thanks, Nick Nicholas Piggin (4): qtest/libqos/pci: Do not write to PBA memory qtest/libqos/pci: Enforce balanced iomap/unmap qtest/libqos/pci: Fix qpci_msix_enable sharing bar0 qtest/libqos/pci: Factor msix entry helpers into pci common code tests/qtest

Re: [PATCH v7 1/2] memory: Update inline documentation

2025-01-16 Thread Akihiko Odaki
On 2025/01/16 23:33, Peter Xu wrote: On Thu, Jan 16, 2025 at 02:37:38PM +0900, Akihiko Odaki wrote: On 2025/01/16 1:14, Peter Xu wrote: On Thu, Jan 16, 2025 at 12:52:56AM +0900, Akihiko Odaki wrote: Functionally, the ordering of container/subregion finalization matters if some device tries to

Re: [PATCH v7 1/2] memory: Update inline documentation

2025-01-16 Thread Akihiko Odaki
On 2025/01/17 1:13, BALATON Zoltan wrote: On Thu, 16 Jan 2025, Peter Maydell wrote: On Tue, 14 Jan 2025 at 19:12, Peter Xu wrote: On Tue, Jan 14, 2025 at 05:42:57PM +, Peter Maydell wrote: There's at least one test in the arm qtests that will hit this. I suspect that you'll find that mos

Re: [PATCH v19 09/14] pcie_sriov: Reuse SR-IOV VF device instances

2025-01-16 Thread Akihiko Odaki
On 2025/01/09 19:51, Philippe Mathieu-Daudé wrote: Hi Akihiko, On 9/1/25 07:29, Akihiko Odaki wrote: 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

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

2025-01-16 Thread Akihiko Odaki
rovements that I think are independently useful. This series extracts those fixes and improvements from the RFC series. [1]: https://patchew.org/QEMU/20231210-sriov-v2-0-b959e8a6d...@daynix.com/ Signed-off-by: Akihiko Odaki --- Changes in v20: - Use qdev_is_realized(). - Link to v19: https://l

[PATCH v20 04/11] s390x/pci: Allow plugging SR-IOV devices

2025-01-16 Thread Akihiko Odaki
The guest cannot use VFs due to the lack of multifunction support but can use PFs. Signed-off-by: Akihiko Odaki --- hw/s390x/s390-pci-bus.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 8c5eb69f7d76

[PATCH v20 06/11] pcie_sriov: Do not manually unrealize

2025-01-16 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

[PATCH v20 08/11] pcie_sriov: Reuse SR-IOV VF device instances

2025-01-16 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 --- include/hw/pci/pcie_sriov.h | 1 - hw

[PATCH v20 11/11] pcie_sriov: Register VFs after migration

2025-01-16 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

[PATCH v20 10/11] pcie_sriov: Remove num_vfs from PCIESriovPF

2025-01-16 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

[PATCH v20 05/11] s390x/pci: Check for multifunction after device realization

2025-01-16 Thread Akihiko Odaki
The SR-IOV PFs set the multifunction bit during device realization so check them after that. There is no functional change because we explicitly ignore the multifunction bit for SR-IOV devices. Signed-off-by: Akihiko Odaki --- hw/s390x/s390-pci-bus.c | 28 +--- 1 file

[PATCH v20 09/11] pcie_sriov: Release VFs failed to realize

2025-01-16 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.

[PATCH v20 03/11] s390x/pci: Avoid creating zpci for VFs

2025-01-16 Thread Akihiko Odaki
VFs are automatically created by PF, and creating zpci for them will result in unexpected usage of fids. Currently QEMU does not support multifunction for s390x so we don't need zpci for VFs anyway. Signed-off-by: Akihiko Odaki --- hw/s390x/s390-pci-bus.c | 21 +++-- 1

[PATCH v20 07/11] pcie_sriov: Ensure VF addr does not overflow

2025-01-16 Thread Akihiko Odaki
pci_new() aborts when creating a VF with addr >= PCI_DEVFN_MAX. Signed-off-by: Akihiko Odaki --- docs/pcie_sriov.txt | 8 +--- include/hw/pci/pcie_sriov.h | 5 +++-- hw/net/igb.c| 10 +++--- hw/nvme/ctrl.c | 22 ++ hw/

[PATCH v20 02/11] hw/ppc/spapr_pci: Do not reject VFs created after a PF

2025-01-16 Thread Akihiko Odaki
A PF may automatically create VFs and the PF may be function 0. Signed-off-by: Akihiko Odaki Reviewed-by: Shivaprasad G Bhat Tested-by: Shivaprasad G Bhat --- 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

[PATCH v20 01/11] hw/ppc/spapr_pci: Do not create DT for disabled PCI device

2025-01-16 Thread Akihiko Odaki
Disabled means it is a disabled SR-IOV VF and hidden from the guest. Do not create DT when starting the system and also keep the disabled PCI device not linked to DRC, which generates DT in case of hotplug. Signed-off-by: Akihiko Odaki Reviewed-by: Shivaprasad G Bhat Tested-by: Shivaprasad G

Re: [PATCH v2 5/5] qtest/e1000e|igb: Fix msix to re-trigger interrupts

2025-01-15 Thread Akihiko Odaki
sirkin Cc: Marcel Apfelbaum Cc: Dmitry Fleytman Cc: Akihiko Odaki Cc: Sriram Yagnaraman Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/e1000e.h | 11 - tests/qtest/libqos/e1000e.c | 87 +++-- tests/qtest/libqos/igb.c| 9 3 files ch

Re: [PATCH v7 1/2] memory: Update inline documentation

2025-01-15 Thread Akihiko Odaki
On 2025/01/16 1:14, Peter Xu wrote: On Thu, Jan 16, 2025 at 12:52:56AM +0900, Akihiko Odaki wrote: Functionally, the ordering of container/subregion finalization matters if some device tries to a container during finalization. In such a case

Re: [PATCH v7 1/2] memory: Update inline documentation

2025-01-15 Thread Akihiko Odaki
On 2025/01/16 0:40, Peter Xu wrote: On Wed, Jan 15, 2025 at 11:54:56PM +0900, Akihiko Odaki wrote: On 2025/01/15 22:43, Peter Xu wrote: On Wed, Jan 15, 2025 at 01:46:29PM +0900, Akihiko Odaki wrote: On 2025/01/15 2:02, Peter Xu wrote: On Tue, Jan 14, 2025 at 05:43:09PM +0900, Akihiko Odaki

Re: [PATCH v7 1/2] memory: Update inline documentation

2025-01-15 Thread Akihiko Odaki
On 2025/01/15 22:43, Peter Xu wrote: On Wed, Jan 15, 2025 at 01:46:29PM +0900, Akihiko Odaki wrote: On 2025/01/15 2:02, Peter Xu wrote: On Tue, Jan 14, 2025 at 05:43:09PM +0900, Akihiko Odaki wrote: memory_region_finalize() is not a function to tell the owner is leaving, but the memory region

Re: [PATCH v17 08/11] hw/vmapple/virtio-blk: Add support for apple virtio-blk

2025-01-15 Thread Akihiko Odaki
#x27; device type are selected using the 'variant' property. Signed-off-by: Alexander Graf Signed-off-by: Phil Dennis-Jordan Reviewed-by: Akihiko Odaki Tested-by: Akihiko Odaki v4: * Use recommended object type declaration pattern. * Correctly log unimplemented code paths. *

Re: [PATCH v7 1/2] memory: Update inline documentation

2025-01-14 Thread Akihiko Odaki
On 2025/01/15 2:02, Peter Xu wrote: On Tue, Jan 14, 2025 at 05:43:09PM +0900, Akihiko Odaki wrote: memory_region_finalize() is not a function to tell the owner is leaving, but the memory region itself is being destroyed. It is when the lifecycle of the MR is the same as the owner. That holds

Re: [PATCH v7 1/2] memory: Update inline documentation

2025-01-14 Thread Akihiko Odaki
On 2025/01/14 0:57, Peter Xu wrote: On Sat, Jan 11, 2025 at 01:15:24PM +0900, Akihiko Odaki wrote: On 2025/01/11 0:18, Peter Xu wrote: On Fri, Jan 10, 2025 at 05:43:15PM +0900, Akihiko Odaki wrote: On 2025/01/10 4:37, Peter Xu wrote: On Thu, Jan 09, 2025 at 02:29:21PM -0500, Peter Xu wrote

Re: [PATCH v4 0/7] util: Introduce qemu_get_runtime_dir()

2025-01-10 Thread Akihiko Odaki
Hi, It seems this series has been forgotten for a while. Can anyone take a look at it? Regards, Akihiko Odaki On 2024/07/16 16:27, Akihiko Odaki wrote: qemu_get_runtime_dir() returns a dynamically allocated directory path that is appropriate for storing runtime files. It corresponds to &quo

Re: [PATCH v7 1/2] memory: Update inline documentation

2025-01-10 Thread Akihiko Odaki
On 2025/01/11 0:18, Peter Xu wrote: On Fri, Jan 10, 2025 at 05:43:15PM +0900, Akihiko Odaki wrote: On 2025/01/10 4:37, Peter Xu wrote: On Thu, Jan 09, 2025 at 02:29:21PM -0500, Peter Xu wrote: On Thu, Jan 09, 2025 at 01:30:35PM +0100, BALATON Zoltan wrote: On Thu, 9 Jan 2025, Akihiko Odaki

[PATCH v8 1/2] memory: Update inline documentation

2025-01-10 Thread Akihiko Odaki
f() and memory_region_unref() do nothing for such. memory: Clarify owner must not call memory_region_ref() -------- The owner must not call this function as it results in a circular reference. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Xu --- incl

[PATCH v8 2/2] memory: Do not create circular reference with subregion

2025-01-10 Thread Akihiko Odaki
instead ot its owner in such a case; the reference to the subregion is still necessary to ensure that the subregion gets finalized after the container. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Xu --- system/memory.c | 24 ++-- 1 file changed, 22 insertions(+), 2 deletions

[PATCH v8 0/2] Fix check-qtest-ppc64 sanitizer errors

2025-01-10 Thread Akihiko Odaki
this patch series combined with the following change for GLib: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4120 Signed-off-by: Akihiko Odaki --- Changes in v8: - Clarified that the memory region should be passed to object_ref() when creating a reference internal to owner. - Link to v7

Re: [PATCH v7 1/2] memory: Update inline documentation

2025-01-10 Thread Akihiko Odaki
On 2025/01/10 4:37, Peter Xu wrote: On Thu, Jan 09, 2025 at 02:29:21PM -0500, Peter Xu wrote: On Thu, Jan 09, 2025 at 01:30:35PM +0100, BALATON Zoltan wrote: On Thu, 9 Jan 2025, Akihiko Odaki wrote: Do not refer to "memory region's refer

[PATCH v19 04/14] s390x/pci: Avoid creating zpci for VFs

2025-01-08 Thread Akihiko Odaki
VFs are automatically created by PF, and creating zpci for them will result in unexpected usage of fids. Currently QEMU does not support multifunction for s390x so we don't need zpci for VFs anyway. Signed-off-by: Akihiko Odaki --- hw/s390x/s390-pci-bus.c | 21 +++-- 1

[PATCH v19 08/14] pcie_sriov: Ensure VF addr does not overflow

2025-01-08 Thread Akihiko Odaki
pci_new() aborts when creating a VF with addr >= PCI_DEVFN_MAX. Signed-off-by: Akihiko Odaki --- docs/pcie_sriov.txt | 8 +--- include/hw/pci/pcie_sriov.h | 5 +++-- hw/net/igb.c| 10 +++--- hw/nvme/ctrl.c | 22 ++ hw/

[PATCH v19 14/14] hw/qdev: Remove opts member

2025-01-08 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

[PATCH v19 05/14] s390x/pci: Allow plugging SR-IOV devices

2025-01-08 Thread Akihiko Odaki
The guest cannot use VFs due to the lack of multifunction support but can use PFs. Signed-off-by: Akihiko Odaki --- hw/s390x/s390-pci-bus.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 8c5eb69f7d76

[PATCH v19 11/14] pcie_sriov: Remove num_vfs from PCIESriovPF

2025-01-08 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

[PATCH v19 09/14] pcie_sriov: Reuse SR-IOV VF device instances

2025-01-08 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 --- include/hw/pci/pcie_sriov.h | 1 - hw

[PATCH v19 10/14] pcie_sriov: Release VFs failed to realize

2025-01-08 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.

[PATCH v19 12/14] pcie_sriov: Register VFs after migration

2025-01-08 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

[PATCH v19 03/14] hw/ppc/spapr_pci: Do not reject VFs created after a PF

2025-01-08 Thread Akihiko Odaki
A PF may automatically create VFs and the PF may be function 0. Signed-off-by: Akihiko Odaki Reviewed-by: Shivaprasad G Bhat Tested-by: Shivaprasad G Bhat --- 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

[PATCH v19 06/14] s390x/pci: Check for multifunction after device realization

2025-01-08 Thread Akihiko Odaki
The SR-IOV PFs set the multifunction bit during device realization so check them after that. There is no functional change because we explicitly ignore the multifunction bit for SR-IOV devices. Signed-off-by: Akihiko Odaki --- hw/s390x/s390-pci-bus.c | 28 +--- 1 file

[PATCH v19 13/14] hw/pci: Use -1 as the default value for rombar

2025-01-08 Thread Akihiko Odaki
it is safe to give it a new meaning. The values in [2 ^ 31, 2 ^ 32) become invalid, but nobody should have typed these values by chance. Suggested-by: Markus Armbruster Signed-off-by: Akihiko Odaki Reviewed-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé --- include/hw/pci/pci_devic

[PATCH v19 07/14] pcie_sriov: Do not manually unrealize

2025-01-08 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

[PATCH v19 02/14] hw/ppc/spapr_pci: Do not create DT for disabled PCI device

2025-01-08 Thread Akihiko Odaki
Disabled means it is a disabled SR-IOV VF and hidden from the guest. Do not create DT when starting the system and also keep the disabled PCI device not linked to DRC, which generates DT in case of hotplug. Signed-off-by: Akihiko Odaki Reviewed-by: Shivaprasad G Bhat Tested-by: Shivaprasad G

[PATCH v19 01/14] hw/pci: Rename has_power to enabled

2025-01-08 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 Reviewed-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h| 1 + include/hw/pci/pci_device.h | 2 +- hw/pci/pci.c| 17

[PATCH v19 00/14] hw/pci: SR-IOV related fixes and improvements

2025-01-08 Thread Akihiko Odaki
rovements that I think are independently useful. This series extracts those fixes and improvements from the RFC series. [1]: https://patchew.org/QEMU/20231210-sriov-v2-0-b959e8a6d...@daynix.com/ Signed-off-by: Akihiko Odaki --- Changes in v19: - Avoided inling pci_set_power(). - Link to v18: https:/

[PATCH v7 2/2] memory: Do not create circular reference with subregion

2025-01-08 Thread Akihiko Odaki
instead ot its owner in such a case; the reference to the subregion is still necessary to ensure that the subregion gets finalized after the container. Signed-off-by: Akihiko Odaki --- system/memory.c | 24 ++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a

[PATCH v7 0/2] Fix check-qtest-ppc64 sanitizer errors

2025-01-08 Thread Akihiko Odaki
this patch series combined with the following change for GLib: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4120 Signed-off-by: Akihiko Odaki --- Changes in v7: - Don't open code memory_region_ref(). (Peter Xu) - Link to v6: https://lore.kernel.org/r/20250105-san-v6-0-11fc859b9...@dayni

[PATCH v7 1/2] memory: Update inline documentation

2025-01-08 Thread Akihiko Odaki
f() and memory_region_unref() do nothing for such. memory: Clarify owner must not call memory_region_ref() -------- The owner must not call this function as it results in a circular reference. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Xu --- incl

Re: [PATCH v5 1/2] memory: Update inline documentation

2025-01-05 Thread Akihiko Odaki
On 2025/01/04 21:51, BALATON Zoltan wrote: On Sat, 4 Jan 2025, Akihiko Odaki wrote: Do not refer to "memory region's reference count" - Now MemoryRegions do have their own reference counts, but they will not be used when their

[PATCH v6 1/2] memory: Update inline documentation

2025-01-05 Thread Akihiko Odaki
f() and memory_region_unref() do nothing for such. memory: Clarify owner must not call memory_region_ref() -------- The owner must not call this function as it results in a circular reference. Signed-off-by: Akihiko Odaki --- include/exec/memory.h | 59 +++

[PATCH v6 2/2] memory: Do not create circular reference with subregion

2025-01-05 Thread Akihiko Odaki
instead ot its owner in such a case; the reference to the subregion is still necessary to ensure that the subregion gets finalized after the container. Signed-off-by: Akihiko Odaki --- system/memory.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/system/memory.c b

[PATCH v6 0/2] Fix check-qtest-ppc64 sanitizer errors

2025-01-05 Thread Akihiko Odaki
this patch series combined with the following change for GLib: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4120 Signed-off-by: Akihiko Odaki --- Changes in v6: - Avoid referring owner as "the object that tracks the region's reference count". - Noted that memroy_r

Re: [PATCH v16 14/14] hw/vmapple/vmapple: Add vmapple machine type

2025-01-04 Thread Akihiko Odaki
hew.org/QEMU/ docs/devel/submitting-a-patch.rst describes the details. Regards, Akihiko Odaki

[PATCH v8 6/9] virtio-pci: Implement SR-IOV PF

2025-01-04 Thread Akihiko Odaki
Allow user to attach SR-IOV VF to a virtio-pci PF. Signed-off-by: Akihiko Odaki --- include/hw/virtio/virtio-pci.h | 1 + hw/virtio/virtio-pci.c | 20 +++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/include/hw/virtio/virtio-pci.h b/include/hw/virtio

[PATCH v8 9/9] pcie_sriov: Make a PCI device with user-created VF ARI-capable

2025-01-04 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- docs/system/sriov.rst | 3 ++- include/hw/pci/pcie_sriov.h | 7 +-- hw/pci/pcie_sriov.c | 8 +++- hw/virtio/virtio-pci.c | 16 ++-- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/docs/system/sriov.rst b

[PATCH v8 3/9] pcie_sriov: Ensure PF and VF are mutually exclusive

2025-01-04 Thread Akihiko Odaki
A device cannot be a SR-IOV PF and a VF at the same time. Signed-off-by: Akihiko Odaki --- hw/pci/pcie_sriov.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/pci/pcie_sriov.c b/hw/pci/pcie_sriov.c index 1eb4358256de..109b2ebcccba 100644 --- a/hw/pci/pcie_sriov.c +++ b/hw/pci

[PATCH v8 4/9] pcie_sriov: Check PCI Express for SR-IOV PF

2025-01-04 Thread Akihiko Odaki
SR-IOV requires PCI Express. Signed-off-by: Akihiko Odaki --- hw/pci/pcie_sriov.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/pci/pcie_sriov.c b/hw/pci/pcie_sriov.c index 109b2ebcccba..a5b546abe8bb 100644 --- a/hw/pci/pcie_sriov.c +++ b/hw/pci/pcie_sriov.c @@ -42,6 +42,11

[PATCH v8 7/9] virtio-net: Implement SR-IOV VF

2025-01-04 Thread Akihiko Odaki
A virtio-net device can be added as a SR-IOV VF to another virtio-pci device that will be the PF. Signed-off-by: Akihiko Odaki --- hw/virtio/virtio-net-pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/virtio-net-pci.c b/hw/virtio/virtio-net-pci.c index e18953ad674b

[PATCH v8 5/9] pcie_sriov: Allow user to create SR-IOV device

2025-01-04 Thread Akihiko Odaki
-creatable VFs can be attached calls pcie_sriov_pf_init_from_user_created_vfs() during realization and pcie_sriov_pf_exit() when exiting. Signed-off-by: Akihiko Odaki --- include/hw/pci/pci_device.h | 6 +- include/hw/pci/pcie_sriov.h | 18 +++ hw/pci/pci.c| 62 ++ hw/pci

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

2025-01-04 Thread Akihiko Odaki
OV VFs with virtio-net-pci. [1] https://patchew.org/QEMU/1689731808-3009-1-git-send-email-yui.wash...@gmail.com/ [2] https://lore.kernel.org/all/5d46f455-f530-4e5e-9ae7-13a2297d4...@daynix.com/ Co-developed-by: Yui Washizu Signed-off-by: Akihiko Odaki --- Changes in v8: - Rebased. - Link to

[PATCH v8 8/9] docs: Document composable SR-IOV device

2025-01-04 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- MAINTAINERS | 1 + docs/system/index.rst | 1 + docs/system/sriov.rst | 36 3 files changed, 38 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 38a290e9c2ce..b0821a17c4fa 100644 --- a/MAINTAINERS +++ b

[PATCH v8 1/9] hw/pci: Do not add ROM BAR for SR-IOV VF

2025-01-04 Thread Akihiko Odaki
A SR-IOV VF cannot have a ROM BAR. Co-developed-by: Yui Washizu Signed-off-by: Akihiko Odaki --- hw/pci/pci.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 8f160c0c0d8a..c4fa32dc987a 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2432,6

[PATCH v8 2/9] hw/pci: Fix SR-IOV VF number calculation

2025-01-04 Thread Akihiko Odaki
pci_config_get_bar_addr() had a division by vf_stride. vf_stride needs to be non-zero when there are multiple VFs, but the specification does not prohibit to make it zero when there is only one VF. Do not perform the division for the first VF to avoid division by zero. Signed-off-by: Akihiko

[PATCH v18 08/14] pcie_sriov: Ensure VF addr does not overflow

2025-01-03 Thread Akihiko Odaki
pci_new() aborts when creating a VF with addr >= PCI_DEVFN_MAX. Signed-off-by: Akihiko Odaki --- docs/pcie_sriov.txt | 8 +--- include/hw/pci/pcie_sriov.h | 5 +++-- hw/net/igb.c| 10 +++--- hw/nvme/ctrl.c | 22 ++ hw/

[PATCH v18 14/14] hw/qdev: Remove opts member

2025-01-03 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

[PATCH v18 13/14] hw/pci: Use -1 as the default value for rombar

2025-01-03 Thread Akihiko Odaki
it is safe to give it a new meaning. The values in [2 ^ 31, 2 ^ 32) become invalid, but nobody should have typed these values by chance. Suggested-by: Markus Armbruster Signed-off-by: Akihiko Odaki Reviewed-by: Markus Armbruster --- include/hw/pci/pci_device.h | 2 +- hw/pci/pc

[PATCH v18 04/14] s390x/pci: Avoid creating zpci for VFs

2025-01-03 Thread Akihiko Odaki
VFs are automatically created by PF, and creating zpci for them will result in unexpected usage of fids. Currently QEMU does not support multifunction for s390x so we don't need zpci for VFs anyway. Signed-off-by: Akihiko Odaki --- hw/s390x/s390-pci-bus.c | 21 +++-- 1

[PATCH v18 11/14] pcie_sriov: Remove num_vfs from PCIESriovPF

2025-01-03 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

[PATCH v18 12/14] pcie_sriov: Register VFs after migration

2025-01-03 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

[PATCH v18 09/14] pcie_sriov: Reuse SR-IOV VF device instances

2025-01-03 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 --- include/hw/pci/pci.h| 5

[PATCH v18 07/14] pcie_sriov: Do not manually unrealize

2025-01-03 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

[PATCH v18 10/14] pcie_sriov: Release VFs failed to realize

2025-01-03 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.

[PATCH v18 03/14] hw/ppc/spapr_pci: Do not reject VFs created after a PF

2025-01-03 Thread Akihiko Odaki
A PF may automatically create VFs and the PF may be function 0. Signed-off-by: Akihiko Odaki Reviewed-by: Shivaprasad G Bhat Tested-by: Shivaprasad G Bhat --- 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

[PATCH v18 01/14] hw/pci: Rename has_power to enabled

2025-01-03 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

  1   2   3   4   5   6   7   8   9   10   >