]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: enhance region_is_ram() to region_intersects()
authorDan Williams <dan.j.williams@intel.com>
Tue, 11 Aug 2015 03:07:05 +0000 (23:07 -0400)
committerDan Duval <dan.duval@oracle.com>
Wed, 7 Dec 2016 17:19:19 +0000 (12:19 -0500)
commite11a3210dde67ef3401775a1d34ec113897c48e1
tree58003681cbc9ef686d749bb1f7f3fe0d10524880
parentdd2a5ce317a36bb12324b5c04f091b8c5e0b49c2
mm: enhance region_is_ram() to region_intersects()

Orabug: 22913653

region_is_ram() is used to prevent the establishment of aliased mappings
to physical "System RAM" with incompatible cache settings.  However, it
uses "-1" to indicate both "unknown" memory ranges (ranges not described
by platform firmware) and "mixed" ranges (where the parameters describe
a range that partially overlaps "System RAM").

Fix this up by explicitly tracking the "unknown" vs "mixed" resource
cases and returning REGION_INTERSECTS, REGION_MIXED, or REGION_DISJOINT.
This re-write also adds support for detecting when the requested region
completely eclipses all of a resource.  Note, the implementation treats
overlaps between "unknown" and the requested memory type as
REGION_INTERSECTS.

Finally, other memory types can be passed in by name, for now the only
usage "System RAM".

Suggested-by: Luis R. Rodriguez <mcgrof@suse.com>
Reviewed-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
(cherry picked from commit 124fe20d94630b6f173dae5eb815e6e6e350c72d)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
include/linux/mm.h
kernel/resource.c