[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/12] vhost-vdpa: skip ram device from the IOTLB mapping
From: |
Jason Wang |
Subject: |
[PULL 01/12] vhost-vdpa: skip ram device from the IOTLB mapping |
Date: |
Fri, 11 Jun 2021 14:00:13 +0800 |
vDPA is not tie to any specific hardware, for safety and simplicity,
vhost-vDPA doesn't allow MMIO area to be mapped via IOTLB. Only the
doorbell could be mapped via mmap(). So this patch exclude skip the
ram device from the IOTLB mapping.
Reviewed-by: Si-Wei Liu <si-wei.liu@oracle.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
hw/virtio/vhost-vdpa.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index ee51863..aef5055 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -28,6 +28,8 @@ static bool
vhost_vdpa_listener_skipped_section(MemoryRegionSection *section)
{
return (!memory_region_is_ram(section->mr) &&
!memory_region_is_iommu(section->mr)) ||
+ /* vhost-vDPA doesn't allow MMIO to be mapped */
+ memory_region_is_ram_device(section->mr) ||
/*
* Sizing an enabled 64-bit BAR can cause spurious mappings to
* addresses in the upper part of the 64-bit address space. These
@@ -172,22 +174,12 @@ static void vhost_vdpa_listener_region_add(MemoryListener
*listener,
vaddr, section->readonly);
if (ret) {
error_report("vhost vdpa map fail!");
- if (memory_region_is_ram_device(section->mr)) {
- /* Allow unexpected mappings not to be fatal for RAM devices */
- error_report("map ram fail!");
- return ;
- }
goto fail;
}
return;
fail:
- if (memory_region_is_ram_device(section->mr)) {
- error_report("failed to vdpa_dma_map. pci p2p may not work");
- return;
-
- }
/*
* On the initfn path, store the first error in the container so we
* can gracefully fail. Runtime, there's not much we can do other
--
2.7.4
- [PULL 00/12] Net patches, Jason Wang, 2021/06/11
- [PULL 01/12] vhost-vdpa: skip ram device from the IOTLB mapping,
Jason Wang <=
- [PULL 03/12] vhost-vdpa: don't initialize backend_features, Jason Wang, 2021/06/11
- [PULL 02/12] vhost-vdpa: map virtqueue notification area if possible, Jason Wang, 2021/06/11
- [PULL 04/12] vhost-vdpa: remove the unused vhost_vdpa_get_acked_features(), Jason Wang, 2021/06/11
- [PULL 05/12] netdev: add more commands to preconfig mode, Jason Wang, 2021/06/11
- [PULL 07/12] Fix the qemu crash when guest shutdown during checkpoint, Jason Wang, 2021/06/11
- [PULL 08/12] Optimize the function of filter_send, Jason Wang, 2021/06/11
- [PULL 09/12] Remove migrate_set_block_enabled in checkpoint, Jason Wang, 2021/06/11
- [PULL 06/12] Remove some duplicate trace code., Jason Wang, 2021/06/11
- [PULL 10/12] Add a function named packet_new_nocopy for COLO., Jason Wang, 2021/06/11
- [PULL 12/12] Fixed calculation error of pkt->header_size in fill_pkt_tcp_info(), Jason Wang, 2021/06/11