x86: max_low_pfn_mapped fix, #2

tighten the boundary checks around max_low_pfn_mapped - dont overmap
nor undermap into holes.

also print out tseg for AMD cpus, for diagnostic purposes.
(this is an SMM area, and we split up any big mappings around that area)

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Yinghai Lu
2008-07-12 14:31:28 -07:00
committed by Ingo Molnar
parent 7ab073b6e0
commit 965194c15d
4 changed files with 7 additions and 6 deletions

View File

@@ -334,9 +334,9 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
flags = new_flags;
}
if (((vma->vm_pgoff <= max_low_pfn_mapped) ||
if (((vma->vm_pgoff < max_low_pfn_mapped) ||
(vma->vm_pgoff >= (1UL<<(32 - PAGE_SHIFT)) &&
vma->vm_pgoff <= max_pfn_mapped)) &&
vma->vm_pgoff < max_pfn_mapped)) &&
ioremap_change_attr((unsigned long)__va(addr), len, flags)) {
free_memtype(addr, addr + len);
return -EINVAL;