Date: Tue, 12 Feb 2019 11:29:03 +0000 (UTC) From: Leandro Lupori <luporl@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344049 - head/sys/powerpc/aim Message-ID: <201902121129.x1CBT3Kq069235@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: luporl Date: Tue Feb 12 11:29:03 2019 New Revision: 344049 URL: https://svnweb.freebsd.org/changeset/base/344049 Log: [ppc64] prevent infinite loop on icache sync At moea64_sync_icache(), when the 'va' argument has page size alignment, round_page() will return the same value as 'va'. This would cause 'len' to be 0 and thus an infinite loop. With this change, 'lim' will always point to the next page boundary. This issue occurred especially during debugging sessions, when a breakpoint was placed on an exact page-aligned offset, for instance. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D19149 Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Tue Feb 12 10:17:21 2019 (r344048) +++ head/sys/powerpc/aim/mmu_oea64.c Tue Feb 12 11:29:03 2019 (r344049) @@ -2807,7 +2807,7 @@ moea64_sync_icache(mmu_t mmu, pmap_t pm, vm_offset_t v PMAP_LOCK(pm); while (sz > 0) { - lim = round_page(va); + lim = round_page(va+1); len = MIN(lim - va, sz); pvo = moea64_pvo_find_va(pm, va & ~ADDR_POFF); if (pvo != NULL && !(pvo->pvo_pte.pa & LPTE_I)) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902121129.x1CBT3Kq069235>