]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commit
arm64: mm: dma-mapping: Only map necessary pages in dma_map_page()
authorAlex Waterman <alexw@nvidia.com>
Thu, 15 Oct 2015 00:46:58 +0000 (17:46 -0700)
committermobile promotions <svcmobile_promotions@nvidia.com>
Wed, 20 Jan 2016 14:25:24 +0000 (06:25 -0800)
commitf9f2d7d55cf2022eb4fedd36685b3427952c5460
treee63878be4a394bbb89e8a491a1bed3979818107e
parente67ab72ca176d8389e158d8a5227378f877cc933
arm64: mm: dma-mapping: Only map necessary pages in dma_map_page()

In some cases the offset is greater than 1 page. In such cases we
allocate multiple pages in the IOVA address space. However, when
freeing that mapping we only have the base address (which includes
the offset addition) and size so the pages mapped before offset get
lost.

What we do here to avoid leaking IOVA pages is only map the pages
actually necessary for the mapping. Any pages fully before the
offset are not mapped since those are the pages that will be missed
by the unmap.

The primary culprit here is the network stack. Sometimes the skbuffs
are backed by multiple pages and fragments above the page boundary
are mapped. The skbuff code does not work out the specific page that
needs mapping though.

Change-Id: Ifcfa729787176800ada8f1d666058f90baa56165
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/834290
(cherry picked from commit ea5ad6beb4fac501b89eceb3138208b0b0b498c1)
Reviewed-on: http://git-master/r/932223
(cherry picked from commit c698a00321880a33d31fe7c719f636e5c21f7589)
Reviewed-on: http://git-master/r/934487
Tested-by: Vidya Sagar <vidyas@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Hayden Du <haydend@nvidia.com>
arch/arm64/mm/dma-mapping.c