Commit 5e50a697 authored by Zhou Qihang's avatar Zhou Qihang Committed by guzitao
Browse files

sw64: iommu: work around iova mapping on pci bars

Sunway inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5G5T3



--------------------------------

Since the RCs of SW64 chipset do not support Peer-to-Peer DMA, we used
to return -EINVAL error on iova mampping on PCI BARs. However, it will
cause driver loading errors when QEMU calls vfio module to passthrough
PCI devices with this kind of BARs, shown as follows:
> qemu-system-sw64: VFIO_MAP_DMA: -22
> qemu-system-sw64: vfio_dma_map(0x121c28020, 0x8800c0000000, 0x40000,
  0x4165f21b2000) = -22 (Invalid argument)
> qemu: hardware error: vfio: DMA mapping failed, unable to continue

To fix this problem, this patch will return success on the iova mapping
of PCI BARs that pretends to support this feature.

Signed-off-by: default avatarZhou Qihang <zhouqihang@wxiat.com>

Signed-off-by: default avatarGu Zitao <guzitao@wxiat.com>
parent a75d3cc4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment