Messages in this thread Patch in this message | | | From | Yinghai Lu <> | Subject | [PATCH v9 13/46] x86, mm: use pfn_range_is_mapped() with gart | Date | Wed, 28 Nov 2012 13:47:24 -0800 |
| |
We are going to map ram only in patch: x86, mm: Only direct map addresses that are marked as E820_RAM
so range under max_low_pfn_mapped, ranges between 4g and max_pfn_mapped could have holes in them and the holes will not be mapped.
Use pfn_range_is_mapped() to check if the range is mapped.
Signed-off-by: Yinghai Lu <yinghai@kernel.org> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> --- arch/x86/kernel/amd_gart_64.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/amd_gart_64.c b/arch/x86/kernel/amd_gart_64.c index e663112..b574b29 100644 --- a/arch/x86/kernel/amd_gart_64.c +++ b/arch/x86/kernel/amd_gart_64.c @@ -768,10 +768,9 @@ int __init gart_iommu_init(void) aper_base = info.aper_base; end_pfn = (aper_base>>PAGE_SHIFT) + (aper_size>>PAGE_SHIFT); - if (end_pfn > max_low_pfn_mapped) { - start_pfn = (aper_base>>PAGE_SHIFT); + start_pfn = PFN_DOWN(aper_base); + if (!pfn_range_is_mapped(start_pfn, end_pfn)) init_memory_mapping(start_pfn<<PAGE_SHIFT, end_pfn<<PAGE_SHIFT); - } pr_info("PCI-DMA: using GART IOMMU.\n"); iommu_size = check_iommu_size(info.aper_base, aper_size); -- 1.7.7
| |