x86, mm: Fixup code testing if a pfn is direct mapped
Update code that previously assumed pfns [ 0 - max_low_pfn_mapped ) and [ 4GB - max_pfn_mapped ) were always direct mapped, to now look up pfn_mapped ranges instead. -v2: change applying sequence to keep git bisecting working. so add dummy pfn_range_is_mapped(). - Yinghai Lu Signed-off-by: Jacob Shin <jacob.shin@amd.com> Link: http://lkml.kernel.org/r/1353123563-3103-12-git-send-email-yinghai@kernel.org Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:

committed by
H. Peter Anvin

parent
4eea6aa581
commit
dda56e1340
@@ -51,6 +51,14 @@ static inline phys_addr_t get_max_mapped(void)
|
||||
return (phys_addr_t)max_pfn_mapped << PAGE_SHIFT;
|
||||
}
|
||||
|
||||
static inline bool pfn_range_is_mapped(unsigned long start_pfn,
|
||||
unsigned long end_pfn)
|
||||
{
|
||||
return end_pfn <= max_low_pfn_mapped ||
|
||||
(end_pfn > (1UL << (32 - PAGE_SHIFT)) &&
|
||||
end_pfn <= max_pfn_mapped);
|
||||
}
|
||||
|
||||
extern unsigned long init_memory_mapping(unsigned long start,
|
||||
unsigned long end);
|
||||
|
||||
|
Reference in New Issue
Block a user