summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorGreg Edwards <gedwards@ddn.com>2013-11-04 09:08:12 -0700
committerGleb Natapov <gleb@redhat.com>2013-11-05 09:55:36 +0200
commit27ef63c7e97d1e5dddd85051c03f8d44cc887f34 (patch)
tree5d93733692e8d11fa3979ebeabb1808b4c3a8c99 /net
parenta9d4e4393b13bca899ab522aa812138437a6c188 (diff)
downloadlinux-27ef63c7e97d1e5dddd85051c03f8d44cc887f34.tar.bz2
KVM: IOMMU: hva align mapping page size
When determining the page size we could use to map with the IOMMU, the page size should also be aligned with the hva, not just the gfn. The gfn may not reflect the real alignment within the hugetlbfs file. Most of the time, this works fine. However, if the hugetlbfs file is backed by non-contiguous huge pages, a multi-huge page memslot starts at an unaligned offset within the hugetlbfs file, and the gfn is aligned with respect to the huge page size, kvm_host_page_size() will return the huge page size and we will use that to map with the IOMMU. When we later unpin that same memslot, the IOMMU returns the unmap size as the huge page size, and we happily unpin that many pfns in monotonically increasing order, not realizing we are spanning non-contiguous huge pages and partially unpin the wrong huge page. Ensure the IOMMU mapping page size is aligned with the hva corresponding to the gfn, which does reflect the alignment within the hugetlbfs file. Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Greg Edwards <gedwards@ddn.com> Cc: stable@vger.kernel.org Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions