Commit 8318c404 authored by David Hildenbrand's avatar David Hildenbrand Committed by Christian Borntraeger

s390/mm: no need for pte_alloc_map_lock() if we know the pmd is present

pte_map_lock() is sufficient.
Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
Acked-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Link: https://lore.kernel.org/r/20210909162248.14969-8-david@redhat.comSigned-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
parent 46c22ffd
...@@ -814,10 +814,7 @@ int set_guest_storage_key(struct mm_struct *mm, unsigned long addr, ...@@ -814,10 +814,7 @@ int set_guest_storage_key(struct mm_struct *mm, unsigned long addr,
} }
spin_unlock(ptl); spin_unlock(ptl);
ptep = pte_alloc_map_lock(mm, pmdp, addr, &ptl); ptep = pte_offset_map_lock(mm, pmdp, addr, &ptl);
if (unlikely(!ptep))
return -EFAULT;
new = old = pgste_get_lock(ptep); new = old = pgste_get_lock(ptep);
pgste_val(new) &= ~(PGSTE_GR_BIT | PGSTE_GC_BIT | pgste_val(new) &= ~(PGSTE_GR_BIT | PGSTE_GC_BIT |
PGSTE_ACC_BITS | PGSTE_FP_BIT); PGSTE_ACC_BITS | PGSTE_FP_BIT);
...@@ -912,10 +909,7 @@ int reset_guest_reference_bit(struct mm_struct *mm, unsigned long addr) ...@@ -912,10 +909,7 @@ int reset_guest_reference_bit(struct mm_struct *mm, unsigned long addr)
} }
spin_unlock(ptl); spin_unlock(ptl);
ptep = pte_alloc_map_lock(mm, pmdp, addr, &ptl); ptep = pte_offset_map_lock(mm, pmdp, addr, &ptl);
if (unlikely(!ptep))
return -EFAULT;
new = old = pgste_get_lock(ptep); new = old = pgste_get_lock(ptep);
/* Reset guest reference bit only */ /* Reset guest reference bit only */
pgste_val(new) &= ~PGSTE_GR_BIT; pgste_val(new) &= ~PGSTE_GR_BIT;
...@@ -977,10 +971,7 @@ int get_guest_storage_key(struct mm_struct *mm, unsigned long addr, ...@@ -977,10 +971,7 @@ int get_guest_storage_key(struct mm_struct *mm, unsigned long addr,
} }
spin_unlock(ptl); spin_unlock(ptl);
ptep = pte_alloc_map_lock(mm, pmdp, addr, &ptl); ptep = pte_offset_map_lock(mm, pmdp, addr, &ptl);
if (unlikely(!ptep))
return -EFAULT;
pgste = pgste_get_lock(ptep); pgste = pgste_get_lock(ptep);
*key = (pgste_val(pgste) & (PGSTE_ACC_BITS | PGSTE_FP_BIT)) >> 56; *key = (pgste_val(pgste) & (PGSTE_ACC_BITS | PGSTE_FP_BIT)) >> 56;
paddr = pte_val(*ptep) & PAGE_MASK; paddr = pte_val(*ptep) & PAGE_MASK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment