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

Commit 395e6aa1 authored by Martin Schwidefsky's avatar Martin Schwidefsky
Browse files

s390/mm: try to avoid storage key operation in ptep_set_access_flags



The call to pgste_set_key in ptep_set_access_flags can be avoided
if the old pte is found to be valid at the time the new access
rights are set. The function that created the old, valid pte already
completed the required storage key operation.

Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 5da7667c
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1267,8 +1267,10 @@ static inline int ptep_set_access_flags(struct vm_area_struct *vma,
					pte_t entry, int dirty)
{
	pgste_t pgste;
	pte_t oldpte;

	if (pte_same(*ptep, entry))
	oldpte = *ptep;
	if (pte_same(oldpte, entry))
		return 0;
	if (mm_has_pgste(vma->vm_mm)) {
		pgste = pgste_get_lock(ptep);
@@ -1278,6 +1280,7 @@ static inline int ptep_set_access_flags(struct vm_area_struct *vma,
	ptep_flush_direct(vma->vm_mm, address, ptep);

	if (mm_has_pgste(vma->vm_mm)) {
		if (pte_val(oldpte) & _PAGE_INVALID)
			pgste_set_key(ptep, pgste, entry, vma->vm_mm);
		pgste = pgste_set_pte(ptep, pgste, entry);
		pgste_set_unlock(ptep, pgste);