1. 10 1月, 2017 4 次提交
    • J
      virtio: convert to use DMA api · 8607f5c3
      Jason Wang 提交于
      Currently, all virtio devices bypass IOMMU completely. This is because
      address_space_memory is assumed and used during DMA emulation. This
      patch converts the virtio core API to use DMA API. This idea is
      
      - introducing a new transport specific helper to query the dma address
        space. (only pci version is implemented).
      - query and use this address space during virtio device guest memory
        accessing when iommu platform (VIRTIO_F_IOMMU_PLATFORM) was enabled
        for this device.
      
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Amit Shah <amit.shah@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: qemu-block@nongnu.org
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      8607f5c3
    • G
      virtio-crypto: fix possible integer and heap overflow · a08aaff8
      Gonglei 提交于
      Because the 'size_t' type is 4 bytes in 32-bit platform, which
      is the same with 'int'. It's easy to make 'max_len' to zero when
      integer overflow and then cause heap overflow if 'max_len' is zero.
      
      Using uint_64 instead of size_t to avoid the integer overflow.
      
      Cc: qemu-stable@nongnu.org
      Reported-by: NLi Qiang <liqiang6-s@360.cn>
      Signed-off-by: NGonglei <arei.gonglei@huawei.com>
      Tested-by: NLi Qiang <liqiang6-s@360.cn>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      a08aaff8
    • P
      intel_iommu: allow migration · 8cdcf3c1
      Peter Xu 提交于
      IOMMU needs to be migrated before all the PCI devices (in case there are
      devices that will request for address translation). So marking it with a
      priority higher than the default (which PCI devices and other belong).
      Migration framework handled the rest.
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      8cdcf3c1
    • P
      migration: allow to prioritize save state entries · f37bc036
      Peter Xu 提交于
      During migration, save state entries are saved/loaded without a specific
      order - we just traverse the savevm_state.handlers list and do it one by
      one. This might not be enough.
      
      There are requirements that we need to load specific device's vmstate
      first before others. For example, VT-d IOMMU contains DMA address
      remapping information, which is required by all the PCI devices to do
      address translations. We need to make sure IOMMU's device state is
      loaded before the rest of the PCI devices, so that DMA address
      translation can work properly.
      
      This patch provide a VMStateDescription.priority value to allow specify
      the priority of the saved states. The loadvm operation will be done with
      those devices with higher vmsd priority.
      
      Before this patch, we are possibly achieving the ordering requirement by
      an assumption that the ordering will be the same with the ordering that
      objects are created. A better way is to mark it out explicitly in the
      VMStateDescription table, like what this patch does.
      
      Current ordering logic is still naive and slow, but after all that's not
      a critical path so IMO it's a workable solution for now.
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      f37bc036
  2. 09 1月, 2017 36 次提交