trunc_page() goes through unsigned long, which is too short.

sizeof(unsigned long) < sizeof(vm_paddr_t) on Book-E, which uses 36-bit
addressing.  With this, a CCSR with a physical address above 4GB successfully
maps.

Sponsored by:	Alex Perez/Inertial Computing
This commit is contained in:
Justin Hibbits 2015-11-21 06:03:46 +00:00
parent 5101cb4efc
commit ef596c4021
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=291122

View file

@ -3298,7 +3298,7 @@ pmap_early_io_map(vm_paddr_t pa, vm_size_t size)
return (tlb1[i].virt + (pa - tlb1[i].phys));
}
pa_base = trunc_page(pa);
pa_base = rounddown(pa, PAGE_SIZE);
size = roundup(size + (pa - pa_base), PAGE_SIZE);
tlb1_map_base = roundup2(tlb1_map_base, 1 << (ilog2(size) & ~1));
va = tlb1_map_base + (pa - pa_base);