[PATCH v9 0/9] virtio-iommu: VFIO integration

Bharat Bhushan posted 9 patches 4 years, 1 month ago
Test docker-mingw@fedora failed
Test docker-quick@centos7 passed
Test checkpatch failed
Test FreeBSD passed
Test asan passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200323084617.1782-1-bbhushan2@marvell.com
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Alex Williamson <alex.williamson@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Eric Auger <eric.auger@redhat.com>
There is a newer version of this series
include/exec/memory.h                         |  20 +
include/hw/virtio/virtio-iommu.h              |   3 +
include/standard-headers/linux/virtio_iommu.h |   6 +
hw/vfio/common.c                              |   5 +-
hw/virtio/virtio-iommu.c                      | 352 +++++++++++++++++-
memory.c                                      |  10 +
hw/virtio/trace-events                        |   7 +
7 files changed, 397 insertions(+), 6 deletions(-)
[PATCH v9 0/9] virtio-iommu: VFIO integration
Posted by Bharat Bhushan 4 years, 1 month ago
This patch series integrates VFIO with virtio-iommu.
This is only applicable for PCI pass-through with virtio-iommu.

This series is available at:
https://github.com/bharat-bhushan-devel/qemu.git virtio-iommu-vfio-integration-v8

This is tested with assigning more than one pci devices to Virtual Machine.

v8-v9:
  - Have page size mask per endpint
  - Add PROBE interface, return page size mask
 
v7->v8:
  - Set page size mask as per host
    This fixes issue with 64K host/guest 
  - Device list from IOMMUDevice directly removed VirtioIOMMUNotifierNode
  - Add missing iep->viommu init on post-load

v6->v7:
  - corrected email-address

v5->v6:
  - Rebase to v16 version from Eric
  - Tested with upstream Linux
  - Added a patch from Eric/Myself on removing mmio-region error print in vfio

v4->v5:
 - Rebase to v9 version from Eric
 - PCIe device hotplug fix
 - Added Patch 1/5 from Eric previous series (Eric somehow dropped in
   last version.
 - Patch "Translate the MSI doorbell in kvm_arch_fixup_msi_route"
   already integrated with vsmmu3

v3->v4:
 - Rebase to v4 version from Eric
 - Fixes from Eric with DPDK in VM
 - Logical division in multiple patches

v2->v3:
 - This series is based on "[RFC v3 0/8] VIRTIO-IOMMU device"
   Which is based on top of v2.10-rc0 that
 - Fixed issue with two PCI devices
 - Addressed review comments

v1->v2:
  - Added trace events
  - removed vSMMU3 link in patch description

Bharat Bhushan (9):
  hw/vfio/common: Remove error print on mmio region translation by
    viommu
  memory: Add interface to set iommu page size mask
  vfio: set iommu page size as per host supported page size
  virtio-iommu: set supported page size mask
  virtio-iommu: Add iommu notifier for map/unmap
  virtio-iommu: Call iommu notifier for attach/detach
  virtio-iommu: add iommu replay
  virtio-iommu: Implement probe request
  virtio-iommu: add iommu notifier memory-region

 include/exec/memory.h                         |  20 +
 include/hw/virtio/virtio-iommu.h              |   3 +
 include/standard-headers/linux/virtio_iommu.h |   6 +
 hw/vfio/common.c                              |   5 +-
 hw/virtio/virtio-iommu.c                      | 352 +++++++++++++++++-
 memory.c                                      |  10 +
 hw/virtio/trace-events                        |   7 +
 7 files changed, 397 insertions(+), 6 deletions(-)

-- 
2.17.1


Re: [PATCH v9 0/9] virtio-iommu: VFIO integration
Posted by no-reply@patchew.org 4 years, 1 month ago
Patchew URL: https://patchew.org/QEMU/20200323084617.1782-1-bbhushan2@marvell.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Subject: [PATCH v9 0/9] virtio-iommu: VFIO integration
Message-id: 20200323084617.1782-1-bbhushan2@marvell.com
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
   9b26a61..29e0855  master     -> master
 - [tag update]      patchew/20200320160622.8040-1-richard.henderson@linaro.org -> patchew/20200320160622.8040-1-richard.henderson@linaro.org
Switched to a new branch 'test'
8eeb60c virtio-iommu: add iommu notifier memory-region
176e083 virtio-iommu: Implement probe request
221f4ba virtio-iommu: add iommu replay
30211fd virtio-iommu: Call iommu notifier for attach/detach
84f316d virtio-iommu: Add iommu notifier for map/unmap
8cc559f virtio-iommu: set supported page size mask
d4062a9 vfio: set iommu page size as per host supported page size
cc9310f memory: Add interface to set iommu page size mask
2b43555 hw/vfio/common: Remove error print on mmio region translation by viommu

=== OUTPUT BEGIN ===
1/9 Checking commit 2b43555a2f62 (hw/vfio/common: Remove error print on mmio region translation by viommu)
2/9 Checking commit cc9310f32d06 (memory: Add interface to set iommu page size mask)
3/9 Checking commit d4062a953cef (vfio: set iommu page size as per host supported page size)
4/9 Checking commit 8cc559f025ae (virtio-iommu: set supported page size mask)
5/9 Checking commit 84f316d68429 (virtio-iommu: Add iommu notifier for map/unmap)
6/9 Checking commit 30211fdb36cd (virtio-iommu: Call iommu notifier for attach/detach)
7/9 Checking commit 221f4ba0d125 (virtio-iommu: add iommu replay)
8/9 Checking commit 176e0834bcee (virtio-iommu: Implement probe request)
ERROR: code indent should never use tabs
#93: FILE: hw/virtio/virtio-iommu.c:539:
+^I}$

ERROR: code indent should never use tabs
#122: FILE: hw/virtio/virtio-iommu.c:568:
+^Ibreak;$

total: 2 errors, 0 warnings, 250 lines checked

Patch 8/9 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

9/9 Checking commit 8eeb60c12ace (virtio-iommu: add iommu notifier memory-region)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20200323084617.1782-1-bbhushan2@marvell.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [PATCH v9 0/9] virtio-iommu: VFIO integration
Posted by no-reply@patchew.org 4 years, 1 month ago
Patchew URL: https://patchew.org/QEMU/20200323084617.1782-1-bbhushan2@marvell.com/



Hi,

This series failed the docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#! /bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-mingw@fedora J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      x86_64-softmmu/hw/virtio/virtio-blk-pci.o
  CC      x86_64-softmmu/hw/virtio/virtio-net-pci.o
/tmp/qemu-test/src/hw/virtio/virtio-iommu.c: In function 'virtio_iommu_fill_property':
/tmp/qemu-test/src/hw/virtio/virtio-iommu.c:576:22: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'size_t' {aka 'long long unsigned int'} [-Werror=format=]
         error_report("%s property of type=%d could not be filled (%d),"
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/qemu-test/src/hw/virtio/virtio-iommu.c:578:43:
---
                                           ~~^
                                           %llx
cc1: all warnings being treated as errors
make[1]: *** [/tmp/qemu-test/src/rules.mak:69: hw/virtio/virtio-iommu.o] Error 1
make[1]: *** Waiting for unfinished jobs....
  CC      aarch64-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      aarch64-softmmu/hw/semihosting/config.o
---
  CC      aarch64-softmmu/hw/virtio/virtio-balloon-pci.o
  CC      aarch64-softmmu/hw/virtio/virtio-iommu-pci.o
  CC      aarch64-softmmu/hw/virtio/virtio-scsi-pci.o
make: *** [Makefile:527: x86_64-softmmu/all] Error 2
make: *** Waiting for unfinished jobs....
  CC      aarch64-softmmu/hw/virtio/virtio-blk-pci.o
  CC      aarch64-softmmu/hw/virtio/virtio-net-pci.o
---
  CC      aarch64-softmmu/hw/arm/virt.o
  CC      aarch64-softmmu/hw/arm/virt-acpi-build.o
/tmp/qemu-test/src/hw/virtio/virtio-iommu.c: In function 'virtio_iommu_fill_property':
/tmp/qemu-test/src/hw/virtio/virtio-iommu.c:576:22: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'size_t' {aka 'long long unsigned int'} [-Werror=format=]
         error_report("%s property of type=%d could not be filled (%d),"
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/qemu-test/src/hw/virtio/virtio-iommu.c:578:43:
---
                                           ~~^
                                           %llx
cc1: all warnings being treated as errors
make[1]: *** [/tmp/qemu-test/src/rules.mak:69: hw/virtio/virtio-iommu.o] Error 1
make[1]: *** Waiting for unfinished jobs....
  CC      aarch64-softmmu/hw/arm/digic_boards.o
make: *** [Makefile:527: aarch64-softmmu/all] Error 2
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 664, in <module>
    sys.exit(main())
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=480fcb56b8454a80ae140ce373e940ee', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-rkry8xh9/src/docker-src.2020-03-23-05.55.47.1669:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=480fcb56b8454a80ae140ce373e940ee
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-rkry8xh9/src'
make: *** [docker-run-test-mingw@fedora] Error 2

real    3m47.039s
user    0m7.589s


The full log is available at
http://patchew.org/logs/20200323084617.1782-1-bbhushan2@marvell.com/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com