[Qemu-devel] [PATCH v3 00/12] VT-d: PT (passthrough) mode support and misc fixes

Peter Xu posted 12 patches 6 years, 11 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1494403315-12760-1-git-send-email-peterx@redhat.com
Test checkpatch failed
Test docker passed
Test s390x passed
There is a newer version of this series
exec.c                         |  26 ++++-
hw/alpha/typhoon.c             |   2 +-
hw/dma/rc4030.c                |   2 +-
hw/i386/amd_iommu.c            |   4 +-
hw/i386/intel_iommu.c          | 260 +++++++++++++++++++++++++++++++----------
hw/i386/intel_iommu_internal.h |   1 +
hw/i386/pc_piix.c              |  15 ++-
hw/i386/pc_q35.c               |  13 ++-
hw/i386/trace-events           |   2 +
hw/i386/x86-iommu.c            |  48 ++------
hw/pci-host/apb.c              |   2 +-
hw/ppc/spapr_iommu.c           |   2 +-
hw/s390x/s390-pci-bus.c        |   2 +-
hw/s390x/s390-pci-inst.c       |   2 +-
hw/vfio/common.c               |   2 +-
hw/virtio/trace-events         |   4 +
hw/virtio/vhost.c              |  49 ++++++++
include/exec/memory.h          |  15 ++-
include/hw/compat.h            |   6 +-
include/hw/i386/pc.h           |   3 +
include/hw/i386/x86-iommu.h    |   1 +
memory.c                       |   7 +-
22 files changed, 339 insertions(+), 129 deletions(-)
[Qemu-devel] [PATCH v3 00/12] VT-d: PT (passthrough) mode support and misc fixes
Posted by Peter Xu 6 years, 11 months ago
v3:
- add one patch to provide machine type 2.10 for pc, add r-b for Edurado
- add r-b/a-b for David on the two memory patches
- add a-b for Paolo on the two memory patches
- remove useless if in vtd_switch_address_space() [Jason]
- check pt_supported when needed [Yi]
- one more patch to check whether dev-iotlb is supported before
  allowing such type of context entry
- enable pt fast path (squashed into current patch 10). when we found
  pt is setup on the first translation, we do address space switch.
  When it's unset, we can capture it via invalidations. [Jason]
- add compat bit for HW_COMPAT_2_9 for "pt" param [Jason]
- one vhost fix for pt (added patch 4)
- faster vhost caching (added patch 12) [Jason]

This series add support for per-device passthrough mode for VT-d
emulation, along with some tweaks on existing codes.

Patch 1: introduce pc 2.10 machine type, it's in mst's pull request
         already, but to be complete, I included this patch.

Patches 2-3: memory related cleanups.

Patch 4: a fix for vhost to be prepared for passthrough mode.

Patches 5-9: some VT-d cleanups and fixes.

Patch 10: add support for passthrough.

Patch 11: turn pt off for machine type <=2.9, for compatibility.

Patch 12: vhost enhancement when used with passthrough, to pre-cache
          static mappings.

A simple test with PT mode using 10g nic is line speed.

Please review. Thanks.

Peter Xu (12):
  pc: add 2.10 machine type
  memory: tune last param of iommu_ops.translate()
  memory: remove the last param in memory_region_iommu_replay()
  memory: fix address_space_get_iotlb_entry()
  x86-iommu: use DeviceClass properties
  intel_iommu: renaming context entry helpers
  intel_iommu: provide vtd_ce_get_type()
  intel_iommu: use IOMMU_ACCESS_FLAG()
  intel_iommu: allow dev-iotlb context entry conditionally
  intel_iommu: support passthrough (PT)
  intel_iommu: turn off pt before 2.9
  vhost: iommu: cache static mapping if there is

 exec.c                         |  26 ++++-
 hw/alpha/typhoon.c             |   2 +-
 hw/dma/rc4030.c                |   2 +-
 hw/i386/amd_iommu.c            |   4 +-
 hw/i386/intel_iommu.c          | 260 +++++++++++++++++++++++++++++++----------
 hw/i386/intel_iommu_internal.h |   1 +
 hw/i386/pc_piix.c              |  15 ++-
 hw/i386/pc_q35.c               |  13 ++-
 hw/i386/trace-events           |   2 +
 hw/i386/x86-iommu.c            |  48 ++------
 hw/pci-host/apb.c              |   2 +-
 hw/ppc/spapr_iommu.c           |   2 +-
 hw/s390x/s390-pci-bus.c        |   2 +-
 hw/s390x/s390-pci-inst.c       |   2 +-
 hw/vfio/common.c               |   2 +-
 hw/virtio/trace-events         |   4 +
 hw/virtio/vhost.c              |  49 ++++++++
 include/exec/memory.h          |  15 ++-
 include/hw/compat.h            |   6 +-
 include/hw/i386/pc.h           |   3 +
 include/hw/i386/x86-iommu.h    |   1 +
 memory.c                       |   7 +-
 22 files changed, 339 insertions(+), 129 deletions(-)

-- 
2.7.4


Re: [Qemu-devel] [PATCH v3 00/12] VT-d: PT (passthrough) mode support and misc fixes
Posted by no-reply@patchew.org 6 years, 11 months ago
Hi,

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

Message-id: 1494403315-12760-1-git-send-email-peterx@redhat.com
Type: series
Subject: [Qemu-devel] [PATCH v3 00/12] VT-d: PT (passthrough) mode support and misc fixes

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/1494405683-20877-1-git-send-email-pradeep.jagadeesh@huawei.com -> patchew/1494405683-20877-1-git-send-email-pradeep.jagadeesh@huawei.com
 * [new tag]         patchew/20170510083259.3900-1-xiaoguangrong@tencent.com -> patchew/20170510083259.3900-1-xiaoguangrong@tencent.com
Switched to a new branch 'test'
9d93e4b vhost: iommu: cache static mapping if there is
0b1f60a intel_iommu: turn off pt before 2.9
d3b8897 intel_iommu: support passthrough (PT)
d6288b6 intel_iommu: allow dev-iotlb context entry conditionally
cde41e2 intel_iommu: use IOMMU_ACCESS_FLAG()
c0e7f1a intel_iommu: provide vtd_ce_get_type()
cf9559d intel_iommu: renaming context entry helpers
4177ae0 x86-iommu: use DeviceClass properties
fd8a285 memory: fix address_space_get_iotlb_entry()
ca5bda6 memory: remove the last param in memory_region_iommu_replay()
03ec6e5 memory: tune last param of iommu_ops.translate()
b663efd pc: add 2.10 machine type

=== OUTPUT BEGIN ===
Checking PATCH 1/12: pc: add 2.10 machine type...
Checking PATCH 2/12: memory: tune last param of iommu_ops.translate()...
Checking PATCH 3/12: memory: remove the last param in memory_region_iommu_replay()...
Checking PATCH 4/12: memory: fix address_space_get_iotlb_entry()...
Checking PATCH 5/12: x86-iommu: use DeviceClass properties...
Checking PATCH 6/12: intel_iommu: renaming context entry helpers...
Checking PATCH 7/12: intel_iommu: provide vtd_ce_get_type()...
Checking PATCH 8/12: intel_iommu: use IOMMU_ACCESS_FLAG()...
Checking PATCH 9/12: intel_iommu: allow dev-iotlb context entry conditionally...
Checking PATCH 10/12: intel_iommu: support passthrough (PT)...
ERROR: "(foo**)" should be "(foo **)"
#34: FILE: hw/i386/intel_iommu.c:656:
+        while (g_hash_table_iter_next (&iter, NULL, (void**)&vtd_bus)) {

ERROR: space prohibited between function name and open parenthesis '('
#34: FILE: hw/i386/intel_iommu.c:656:
+        while (g_hash_table_iter_next (&iter, NULL, (void**)&vtd_bus)) {

total: 2 errors, 0 warnings, 305 lines checked

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

Checking PATCH 11/12: intel_iommu: turn off pt before 2.9...
Checking PATCH 12/12: vhost: iommu: cache static mapping if there is...
ERROR: spaces required around that '-' (ctx:VxV)
#79: FILE: hw/virtio/vhost.c:811:
+                                                          UINT64_MAX-1)) {
                                                                     ^

total: 1 errors, 0 warnings, 80 lines checked

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

=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org