Skip to content

Commit 8318c40

Browse files
davidhildenbrandborntraeger
authored andcommitted
s390/mm: no need for pte_alloc_map_lock() if we know the pmd is present
pte_map_lock() is sufficient. Signed-off-by: David Hildenbrand <[email protected]> Acked-by: Heiko Carstens <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Borntraeger <[email protected]>
1 parent 46c22ff commit 8318c40

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

arch/s390/mm/pgtable.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -814,10 +814,7 @@ int set_guest_storage_key(struct mm_struct *mm, unsigned long addr,
814814
}
815815
spin_unlock(ptl);
816816

817-
ptep = pte_alloc_map_lock(mm, pmdp, addr, &ptl);
818-
if (unlikely(!ptep))
819-
return -EFAULT;
820-
817+
ptep = pte_offset_map_lock(mm, pmdp, addr, &ptl);
821818
new = old = pgste_get_lock(ptep);
822819
pgste_val(new) &= ~(PGSTE_GR_BIT | PGSTE_GC_BIT |
823820
PGSTE_ACC_BITS | PGSTE_FP_BIT);
@@ -912,10 +909,7 @@ int reset_guest_reference_bit(struct mm_struct *mm, unsigned long addr)
912909
}
913910
spin_unlock(ptl);
914911

915-
ptep = pte_alloc_map_lock(mm, pmdp, addr, &ptl);
916-
if (unlikely(!ptep))
917-
return -EFAULT;
918-
912+
ptep = pte_offset_map_lock(mm, pmdp, addr, &ptl);
919913
new = old = pgste_get_lock(ptep);
920914
/* Reset guest reference bit only */
921915
pgste_val(new) &= ~PGSTE_GR_BIT;
@@ -977,10 +971,7 @@ int get_guest_storage_key(struct mm_struct *mm, unsigned long addr,
977971
}
978972
spin_unlock(ptl);
979973

980-
ptep = pte_alloc_map_lock(mm, pmdp, addr, &ptl);
981-
if (unlikely(!ptep))
982-
return -EFAULT;
983-
974+
ptep = pte_offset_map_lock(mm, pmdp, addr, &ptl);
984975
pgste = pgste_get_lock(ptep);
985976
*key = (pgste_val(pgste) & (PGSTE_ACC_BITS | PGSTE_FP_BIT)) >> 56;
986977
paddr = pte_val(*ptep) & PAGE_MASK;

0 commit comments

Comments
 (0)