CVSROOT: /cvs Module name: src Changes by: m...@cvs.openbsd.org 2012/05/10 15:12:26
Modified files: sys/arch/mips64/include: pmap.h sys/arch/mips64/mips64: pmap.c Log message: The uvm_map() changes introduced about two months ago yield a different memory allocation pattern, exposing aliasing bugs in the mips64 pmap, on kernels where virtual aliasing may happen (that is, IP32 kernels on R5000, R10000 and R12000 O2). Fix these (or at least, sweep them better under the rug) by: - always flush caches in pmap_copy_page() and pmap_zero_page(), if the destination page is mapped uncached. - when removing a mapping of a managed page which has been forced uncached due to virtual aliasing conflict, map it back cached as soon as the remaining mappings are non conflicting. - writeback, instead of simply invalidating, pool pages and page table pages, upon release, for there might be stale data in the cache. While these, apply more paranoia and only perform cache operations on pages which have been mapped with the cache enabled. Initially reported by mikeb@ on an R12k O2 (that will teach me to use an RM7000-powered O2, without virtual aliasing, to test IP32 kernels). Verified on an R5k O2, as well as a custom IP30 kernel with page size forced to 4KB (to introduce virtual aliasing). This diff tested on O2 (R5k, RM7k, R12k), IP30, IP35, as well as on Loongson (no aliasing) by mikeb@ and I.