[Qemu-devel] [PATCH RFC v2 13/17] memory: add MemoryRegionIOMMUOps.replay() callback

2017-01-02 Thread Peter Xu
Originally we have one memory_region_iommu_replay() function, which is the default behavior to replay the translations of the whole IOMMU region. However, on some platform like x86, we may want our own replay logic for IOMMU regions. This patch add one more hook for IOMMUOps for the callback, and i

[Qemu-devel] [PATCH RFC v2 11/17] memory: provide iommu_replay_all()

2017-01-02 Thread Peter Xu
This is an "global" version of exising memory_region_iommu_replay() - we announce the translations to all the registered notifiers, instead of a specific one. Signed-off-by: Peter Xu --- include/exec/memory.h | 8 memory.c | 9 + 2 files changed, 17 insertions(+) d

[Qemu-devel] [PATCH RFC v2 10/17] memory: add section range info for IOMMU notifier

2017-01-02 Thread Peter Xu
In this patch, IOMMUNotifier.{start|end} are introduced to store section information for a specific notifier. When notification occurs, we not only check the notification type (MAP|UNMAP), but also check whether the notified iova is in the range of specific IOMMU notifier, and skip those notifiers

[Qemu-devel] [PATCH RFC v2 15/17] intel_iommu: do replay when context invalidate

2017-01-02 Thread Peter Xu
Before this one we only invalidate context cache when we receive context entry invalidations. However it's possible that the invalidation also contains a domain switch (only if cache-mode is enabled for vIOMMU). In that case we need to notify all the registered components about the new mapping. Si

[Qemu-devel] [PATCH RFC v2 14/17] intel_iommu: provide its own replay() callback

2017-01-02 Thread Peter Xu
The default replay() don't work for VT-d since vt-d will have a huge default memory region which covers address range 0-(2^64-1). This will normally bring a dead loop when guest starts. The solution is simple - we don't walk over all the regions. Instead, we jump over the regions when we found tha

[Qemu-devel] [PATCH RFC v2 16/17] intel_iommu: allow dynamic switch of IOMMU region

2017-01-02 Thread Peter Xu
This is preparation work to finally enabled dynamic switching ON/OFF for VT-d protection. The old VT-d codes is using static IOMMU region, and that won't satisfy vfio-pci device listeners. Let me explain. vfio-pci devices depend on the memory region listener and IOMMU replay mechanism to make sur

[Qemu-devel] [PATCH RFC v2 17/17] intel_iommu: enable vfio devices

2017-01-02 Thread Peter Xu
This patch is based on Aviv Ben-David ()'s patch upstream: "IOMMU: enable intel_iommu map and unmap notifiers" https://lists.gnu.org/archive/html/qemu-devel/2016-11/msg01453.html However I removed/fixed some content, and added my own codes. Instead of translate() every page for iotlb invalid

Re: [Qemu-devel] [PATCH RFC v2 00/17] VT-d: vfio enablement and misc enhances

2017-01-02 Thread no-reply
Hi, Your series seems to have some coding style problems. See output below for more information: Subject: [Qemu-devel] [PATCH RFC v2 00/17] VT-d: vfio enablement and misc enhances Type: series Message-id: 1483428594-28880-1-git-send-email-pet...@redhat.com === TEST SCRIPT BEGIN === #!/bin/bash

<    1   2