mirror of
https://github.com/mii443/qemu.git
synced 2025-08-23 15:48:20 +00:00
iommu: Add IOMMU index argument to translate method
Add an IOMMU index argument to the translate method of IOMMUs. Since all of our current IOMMU implementations support only a single IOMMU index, this has no effect on the behaviour. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 20180604152941.20374-4-peter.maydell@linaro.org
This commit is contained in:
11
exec.c
11
exec.c
@ -501,8 +501,15 @@ static MemoryRegionSection address_space_translate_iommu(IOMMUMemoryRegion *iomm
|
||||
do {
|
||||
hwaddr addr = *xlat;
|
||||
IOMMUMemoryRegionClass *imrc = memory_region_get_iommu_class_nocheck(iommu_mr);
|
||||
IOMMUTLBEntry iotlb = imrc->translate(iommu_mr, addr, is_write ?
|
||||
IOMMU_WO : IOMMU_RO);
|
||||
int iommu_idx = 0;
|
||||
IOMMUTLBEntry iotlb;
|
||||
|
||||
if (imrc->attrs_to_index) {
|
||||
iommu_idx = imrc->attrs_to_index(iommu_mr, attrs);
|
||||
}
|
||||
|
||||
iotlb = imrc->translate(iommu_mr, addr, is_write ?
|
||||
IOMMU_WO : IOMMU_RO, iommu_idx);
|
||||
|
||||
if (!(iotlb.perm & (1 << is_write))) {
|
||||
goto unassigned;
|
||||
|
Reference in New Issue
Block a user