diff options
author | Greg Edwards <gedwards@ddn.com> | 2013-11-04 16:08:12 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-11-29 19:28:06 (GMT) |
commit | 6492d85c63e0e59f8c6c42ad8cc7eee2f0bee9df (patch) | |
tree | 85bc4a716ef5bedc2b32c71d390142023cbd788a /sound/oss/opl3_hw.h | |
parent | 26146207c9fc024ff6752225d271ec47ccd35dfc (diff) | |
download | linux-fsl-qoriq-6492d85c63e0e59f8c6c42ad8cc7eee2f0bee9df.tar.xz |
KVM: IOMMU: hva align mapping page size
commit 27ef63c7e97d1e5dddd85051c03f8d44cc887f34 upstream.
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>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/oss/opl3_hw.h')
0 files changed, 0 insertions, 0 deletions