#endif
}
-static inline pgste_t pgste_update_all(pte_t *ptep, pgste_t pgste,
+static inline pgste_t pgste_update_all(pte_t pte, pgste_t pgste,
struct mm_struct *mm)
{
#ifdef CONFIG_PGSTE
unsigned long address, bits, skey;
- if (!mm_use_skey(mm) || pte_val(*ptep) & _PAGE_INVALID)
+ if (!mm_use_skey(mm) || pte_val(pte) & _PAGE_INVALID)
return pgste;
- address = pte_val(*ptep) & PAGE_MASK;
+ address = pte_val(pte) & PAGE_MASK;
skey = (unsigned long) page_get_storage_key(address);
bits = skey & (_PAGE_CHANGED | _PAGE_REFERENCED);
/* Transfer page changed & referenced bit to guest bits in pgste */
unsigned long addr, pte_t *ptep)
{
pgste_t pgste;
- pte_t pte, oldpte;
+ pte_t pte;
int young;
if (mm_has_pgste(vma->vm_mm)) {
pgste = pgste_ipte_notify(vma->vm_mm, addr, ptep, pgste);
}
- oldpte = pte = *ptep;
+ pte = *ptep;
ptep_flush_direct(vma->vm_mm, addr, ptep);
young = pte_young(pte);
- pte = pte_mkold(pte);
if (mm_has_pgste(vma->vm_mm)) {
- pgste = pgste_update_all(&oldpte, pgste, vma->vm_mm);
- pgste = pgste_set_pte(ptep, pgste, pte);
+ pgste = pgste_update_all(pte, pgste, vma->vm_mm);
+ pgste = pgste_set_pte(ptep, pgste, pte_mkold(pte));
pgste_set_unlock(ptep, pgste);
} else
- *ptep = pte;
+ *ptep = pte_mkold(pte);
return young;
}
pte_val(*ptep) = _PAGE_INVALID;
if (mm_has_pgste(mm)) {
- pgste = pgste_update_all(&pte, pgste, mm);
+ pgste = pgste_update_all(pte, pgste, mm);
pgste_set_unlock(ptep, pgste);
}
return pte;
ptep_flush_lazy(mm, address, ptep);
if (mm_has_pgste(mm)) {
- pgste = pgste_update_all(&pte, pgste, mm);
+ pgste = pgste_update_all(pte, pgste, mm);
pgste_set(ptep, pgste);
}
return pte;
if ((pgste_val(pgste) & _PGSTE_GPS_USAGE_MASK) ==
_PGSTE_GPS_USAGE_UNUSED)
pte_val(pte) |= _PAGE_UNUSED;
- pgste = pgste_update_all(&pte, pgste, vma->vm_mm);
+ pgste = pgste_update_all(pte, pgste, vma->vm_mm);
pgste_set_unlock(ptep, pgste);
}
return pte;
pte_val(*ptep) = _PAGE_INVALID;
if (!full && mm_has_pgste(mm)) {
- pgste = pgste_update_all(&pte, pgste, mm);
+ pgste = pgste_update_all(pte, pgste, mm);
pgste_set_unlock(ptep, pgste);
}
return pte;