Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd5050e3 authored by Aneesh Kumar K.V's avatar Aneesh Kumar K.V Committed by Michael Ellerman
Browse files

powerpc/mm/radix: Change pte relax sequence to handle nest MMU hang



When relaxing access (read -> read_write update), pte needs to be marked invalid
to handle a nest MMU bug. We also need to do a tlb flush after the pte is
marked invalid before updating the pte with new access bits.

We also move tlb flush to platform specific __ptep_set_access_flags. This will
help us to gerid of unnecessary tlb flush on BOOK3S 64 later. We don't do that
in this patch. This also helps in avoiding multiple tlbies with coprocessor
attached.

Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent e4c1112c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -245,6 +245,8 @@ static inline void __ptep_set_access_flags(struct vm_area_struct *vma,
	unsigned long clr = ~pte_val(entry) & _PAGE_RO;

	pte_update(ptep, clr, set);

	flush_tlb_page(vma, address);
}

#define __HAVE_ARCH_PTE_SAME
+2 −0
Original line number Diff line number Diff line
@@ -266,6 +266,8 @@ static inline void __ptep_set_access_flags(struct vm_area_struct *vma,
	unsigned long clr = ~pte_val(entry) & (_PAGE_RO | _PAGE_NA);

	pte_update(ptep, clr, set);

	flush_tlb_page(vma, address);
}

static inline int pte_young(pte_t pte)
+2 −0
Original line number Diff line number Diff line
@@ -304,6 +304,8 @@ static inline void __ptep_set_access_flags(struct vm_area_struct *vma,
	unsigned long old = pte_val(*ptep);
	*ptep = __pte(old | bits);
#endif

	flush_tlb_page(vma, address);
}

#define __HAVE_ARCH_PTE_SAME
+1 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
#include <asm/processor.h>		/* For TASK_SIZE */
#include <asm/mmu.h>
#include <asm/page.h>
#include <asm/tlbflush.h>

struct mm_struct;

+0 −1
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@ int pmdp_set_access_flags(struct vm_area_struct *vma, unsigned long address,
		 */
		__ptep_set_access_flags(vma, pmdp_ptep(pmdp),
					pmd_pte(entry), address, MMU_PAGE_2M);
		flush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
	}
	return changed;
}
Loading