git: 28d14569c873 - main - powerpc64: add missing TLB invalidations to radix

Leandro Lupori luporl at FreeBSD.org
Tue Apr 6 11:41:40 UTC 2021


The branch main has been updated by luporl:

URL: https://cgit.FreeBSD.org/src/commit/?id=28d14569c8735060d0a1646a3422562c0741ac44

commit 28d14569c8735060d0a1646a3422562c0741ac44
Author:     Leandro Lupori <luporl at FreeBSD.org>
AuthorDate: 2021-04-06 11:31:44 +0000
Commit:     Leandro Lupori <luporl at FreeBSD.org>
CommitDate: 2021-04-06 11:31:44 +0000

    powerpc64: add missing TLB invalidations to radix
    
    Radix MMU code was missing TLB invalidations when some Level 3 PDEs were
    modified. This caused TLB multi-hit machine check interrupts when
    superpages were enabled.
    
    Reviewed by:            jhibbits
    MFC after:              2 weeks
    Sponsored by:           Eldorado Research Institute (eldorado.org.br)
    Differential Revision:  https://reviews.freebsd.org/D29511
---
 sys/powerpc/aim/mmu_radix.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c
index b2500e4ec359..bb43b64febff 100644
--- a/sys/powerpc/aim/mmu_radix.c
+++ b/sys/powerpc/aim/mmu_radix.c
@@ -3184,6 +3184,7 @@ pmap_enter_l3e(pmap_t pmap, vm_offset_t va, pml3_entry_t newpde, u_int flags,
 			 * a reserved PT page could be freed.
 			 */
 			(void)pmap_remove_l3e(pmap, l3e, va, &free, lockp);
+			pmap_invalidate_l3e_page(pmap, va, oldl3e);
 		} else {
 			if (pmap_remove_ptes(pmap, va, va + L3_PAGE_SIZE, l3e,
 			    &free, lockp))
@@ -3242,6 +3243,7 @@ pmap_enter_l3e(pmap_t pmap, vm_offset_t va, pml3_entry_t newpde, u_int flags,
 	 * be any lingering 4KB page mappings in the TLB.)
 	 */
 	pte_store(l3e, newpde);
+	ptesync();
 
 	atomic_add_long(&pmap_l3e_mappings, 1);
 	CTR2(KTR_PMAP, "pmap_enter_pde: success for va %#lx"
@@ -4943,7 +4945,7 @@ pmap_demote_l3e_locked(pmap_t pmap, pml3_entry_t *l3e, vm_offset_t va,
 	 * the read above and the store below.
 	 */
 	pde_store(l3e, mptepa);
-	ptesync();
+	pmap_invalidate_l3e_page(pmap, trunc_2mpage(va), oldpde);
 	/*
 	 * Demote the PV entry.
 	 */
@@ -5224,6 +5226,7 @@ mmu_radix_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
 			 */
 			if (sva + L3_PAGE_SIZE == va_next && eva >= va_next) {
 				pmap_remove_l3e(pmap, l3e, sva, &free, &lock);
+				anyvalid = true;
 				continue;
 			} else if (!pmap_demote_l3e_locked(pmap, l3e, sva,
 			    &lock)) {


More information about the dev-commits-src-all mailing list