mm/cma: make kmemleak ignore CMA regions
mm/cma: make kmemleak ignore CMA regions

kmemleak will add allocations as objects to a pool.  The memory allocated
for each object in this pool is periodically searched for pointers to
other allocated objects.  This only works for memory that is mapped into
the kernel's virtual address space, which happens not to be the case for
most CMA regions.

Furthermore, CMA regions are typically used to store data transferred to
or from a device and therefore don't contain pointers to other objects.

Without this, the kernel crashes on the first execution of the
scan_gray_list() because it tries to access highmem.  Perhaps a more
appropriate fix would be to reject any object that can't map to a kernel
virtual address?

[5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org: add comment]
[5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org: fix comment, per Catalin]
[4bf0fb350827ce8d86875e76c923a478597c3cef@canb.auug.org.au: include linux/io.h for phys_to_virt()]
Signed-off-by: Thierry Reding <3055038c414aef68bf32c33b8118623e7554e0f2@nvidia.com>
Cc: Michal Nazarewicz <605208d9b4c769ca62e9f9f8b592c9cd465fe6d7@mina86.com>
Cc: Marek Szyprowski <2a0259761cc3e88db42be5300c1579a67c77e65e@samsung.com>
Cc: Joonsoo Kim <bb6c8cfe7699e0f11d1bee88022eb563a5f8e881@lge.com>
Cc: "Aneesh Kumar K.V" <f511f818e8a0748edef6b9ee378967da9ed0c78f@linux.vnet.ibm.com>
Cc: Catalin Marinas <15ce75b290ebaf27c3f9fd73ab848685ed3d8261@arm.com>
Signed-off-by: Stephen Rothwell <4bf0fb350827ce8d86875e76c923a478597c3cef@canb.auug.org.au>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs