Author: bdragon Date: Wed Jun 12 15:58:11 2019 New Revision: 348994 URL: https://svnweb.freebsd.org/changeset/base/348994
Log: Fix PPC970 boot after r348783 r348783 changed the behavior of the kernel mappings and broke booting on G5. - Split the kernel mapping logic out so that the case where we are running from the wrong memory space is handled using identity mappings, and the case where we are not using a DMAP is handled by forcibly mapping the kernel into the dmap range as intended by r348783. Reported by: Mikael Urankar Reviewed by: luporl Approved by: jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D20608 Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Wed Jun 12 13:34:12 2019 (r348993) +++ head/sys/powerpc/aim/mmu_oea64.c Wed Jun 12 15:58:11 2019 (r348994) @@ -684,8 +684,16 @@ moea64_setup_direct_map(mmu_t mmup, vm_offset_t kernel * without a direct map or on which the kernel is not already executing * out of the direct-mapped region. */ - - if (!hw_direct_map || kernelstart < DMAP_BASE_ADDRESS) { + if (kernelstart < DMAP_BASE_ADDRESS) { + /* + * For pre-dmap execution, we need to use identity mapping + * because we will be operating with the mmu on but in the + * wrong address configuration until we __restartkernel(). + */ + for (pa = kernelstart & ~PAGE_MASK; pa < kernelend; + pa += PAGE_SIZE) + moea64_kenter(mmup, pa, pa); + } else if (!hw_direct_map) { pkernelstart = kernelstart & ~DMAP_BASE_ADDRESS; pkernelend = kernelend & ~DMAP_BASE_ADDRESS; for (pa = pkernelstart & ~PAGE_MASK; pa < pkernelend; _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"