* Patch "iommu/io-pgtable-arm: Fix iova_to_phys for block entries" has been added to the 4.7-stable tree
@ 2016-08-18 10:57 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-08-18 10:57 UTC (permalink / raw)
To: will.deacon, gregkh, robin.murphy; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
iommu/io-pgtable-arm: Fix iova_to_phys for block entries
to the 4.7-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
iommu-io-pgtable-arm-fix-iova_to_phys-for-block-entries.patch
and it can be found in the queue-4.7 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 7c6d90e2bb1a98b86d73b9e8ab4d97ed5507e37c Mon Sep 17 00:00:00 2001
From: Will Deacon <will.deacon@arm.com>
Date: Thu, 16 Jun 2016 18:21:19 +0100
Subject: iommu/io-pgtable-arm: Fix iova_to_phys for block entries
From: Will Deacon <will.deacon@arm.com>
commit 7c6d90e2bb1a98b86d73b9e8ab4d97ed5507e37c upstream.
The implementation of iova_to_phys for the long-descriptor ARM
io-pgtable code always masks with the granule size when inserting the
low virtual address bits into the physical address determined from the
page tables. In cases where the leaf entry is found before the final
level of table (i.e. due to a block mapping), this results in rounding
down to the bottom page of the block mapping. Consequently, the physical
address range batching in the vfio_unmap_unpin is defeated and we end
up taking the long way home.
This patch fixes the problem by masking the virtual address with the
appropriate mask for the level at which the leaf descriptor is located.
The short-descriptor code already gets this right, so no change is
needed there.
Reported-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iommu/io-pgtable-arm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/iommu/io-pgtable-arm.c
+++ b/drivers/iommu/io-pgtable-arm.c
@@ -576,7 +576,7 @@ static phys_addr_t arm_lpae_iova_to_phys
return 0;
found_translation:
- iova &= (ARM_LPAE_GRANULE(data) - 1);
+ iova &= (ARM_LPAE_BLOCK_SIZE(lvl, data) - 1);
return ((phys_addr_t)iopte_to_pfn(pte,data) << data->pg_shift) | iova;
}
Patches currently in stable-queue which might be from will.deacon@arm.com are
queue-4.7/iommu-io-pgtable-arm-fix-iova_to_phys-for-block-entries.patch
queue-4.7/arm64-hibernate-handle-allocation-failures.patch
queue-4.7/arm64-hibernate-avoid-potential-tlb-conflict.patch
queue-4.7/arm64-debug-unmask-pstate.d-earlier.patch
queue-4.7/arm64-fix-incorrect-per-cpu-usage-for-boot-cpu.patch
queue-4.7/arm64-honor-nosmp-kernel-command-line-option.patch
queue-4.7/arm64-vmlinux.lds-make-__rela_offset-and-__dynsym_offset-absolute.patch
queue-4.7/arm64-mm-avoid-fdt_check_header-before-the-fdt-is-fully-mapped.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-08-18 10:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-18 10:57 Patch "iommu/io-pgtable-arm: Fix iova_to_phys for block entries" has been added to the 4.7-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox