_PAGE_RW
#define _PAGE_WRENABLE (_PAGE_RW | _PAGE_DIRTY | _PAGE_HWWRITE)
#define PAGE_SHARED __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW)
__pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW | _PAGE_EXEC)
static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; }
{ pte_val(pte) &= ~(_PAGE_RW | _PAGE_HWWRITE); return pte; }
{ pte_val(pte) |= _PAGE_RW; return pte; }
#define _PAGE_IOREMAP (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | \
(_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW | _PAGE_EXEC);
return __pte(pte_val(pte) | _PAGE_RW);
#define _PAGE_KERNEL_RW (_PAGE_PRIVILEGED | _PAGE_RW | _PAGE_DIRTY)
#define _PAGE_KERNEL_RWX (_PAGE_PRIVILEGED | _PAGE_DIRTY | _PAGE_RW | _PAGE_EXEC)
return __pte_raw(pte_raw(pte) | cpu_to_be64(_PAGE_RW));
(_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW | _PAGE_EXEC);
return __pte(pte_val(pte) | _PAGE_RW);
#define _PAGE_KERNEL_RW (_PAGE_RW | _PAGE_DIRTY)
#define PAGE_SHARED __pgprot(_PAGE_BASE | _PAGE_RW)
_PAGE_ACCESSED | _PAGE_RW | _PAGE_EXEC);
if (!cpu_has_feature(CPU_FTR_ARCH_31) && (change & _PAGE_RW) &&
prot |= _PAGE_RW;
#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | \
#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_CACHABLE | \
__pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | \
__pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | \
#define pte_write(pte) ((pte).pte_low & _PAGE_RW)
PTE_BIT_FUNC(low, wrprotect, &= ~_PAGE_RW);
PTE_BIT_FUNC(low, mkwrite_novma, |= _PAGE_RW);
#define _PAGE_PR_MASK (_PAGE_RW | _PAGE_USER)
return((pte_get_bits(pte, _PAGE_RW)) &&
pte_clear_bits(pte, _PAGE_RW);
pte_set_bits(pte, _PAGE_RW);
#define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY)
#define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED)
#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
pflags = _PAGE_NX | _PAGE_RW;
need_pte_bits |= _PAGE_RW;
(pte_flags(pte) & (_PAGE_RW | _PAGE_DIRTY)) == _PAGE_DIRTY;
(pmd_flags(pmd) & (_PAGE_RW | _PAGE_DIRTY | _PAGE_PSE)) ==
(pud_flags(pud) & (_PAGE_RW | _PAGE_DIRTY | _PAGE_PSE)) ==
return (pte_flags(pte) & _PAGE_RW) || pte_shstk(pte);
return (pmd_flags(pmd) & _PAGE_RW) || pmd_shstk(pmd);
return pud_flags(pud) & _PAGE_RW;
pte = pte_clear_flags(pte, _PAGE_RW);
pte = pte_clear_flags(pte, _PAGE_RW);
return pte_set_flags(pte, _PAGE_RW);
pmd = pmd_clear_flags(pmd, _PAGE_RW);
pmd = pmd_clear_flags(pmd, _PAGE_RW);
return pmd_set_flags(pmd, _PAGE_RW);
pud = pud_clear_flags(pud, _PAGE_RW);
pud = pud_set_flags(pud, _PAGE_RW);
WARN_ON_ONCE((pgprot_val(pgprot) & (_PAGE_DIRTY | _PAGE_RW)) ==
if (oldval & _PAGE_RW)
if (oldval & _PAGE_RW)
if (oldval & _PAGE_RW)
#define _PAGE_SWP_SOFT_DIRTY _PAGE_RW
#define __RW _PAGE_RW
const pteval_t flush_on_change = _PAGE_RW | _PAGE_USER | _PAGE_PWT |
#define PGTABLE_PROT ((_KERNPG_TABLE & ~_PAGE_RW) | _PAGE_NX)
tmp = (i << 22) + (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER |
if (pr & _PAGE_RW)
effective = (higher_prot & prot & (_PAGE_USER | _PAGE_RW)) |
if (st->check_wx && (eff & _PAGE_RW) && !(eff & _PAGE_NX))
return change_page_attr_clear(&addr, numpages, __pgprot(_PAGE_RW | _PAGE_DIRTY), 0);
pgprot_t clr = __pgprot(_PAGE_RW | _PAGE_DIRTY);
return change_page_attr_set(&addr, numpages, __pgprot(_PAGE_RW), 0);
.mask_set = __pgprot(_PAGE_PRESENT | _PAGE_RW),
.mask_clr = __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY),
.mask_clr = __pgprot(~page_flags & (_PAGE_NX|_PAGE_RW|_PAGE_DIRTY)),
.mask_clr = __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY),
return _PAGE_RW;
return _PAGE_RW;
if (!((pgprot_val(old) ^ pgprot_val(new)) & (_PAGE_RW | _PAGE_NX)))
if ((pgprot_val(new) & (_PAGE_RW | _PAGE_NX)) != _PAGE_RW)
*rw &= pgd_flags(*pgd) & _PAGE_RW;
*rw &= p4d_flags(*p4d) & _PAGE_RW;
*rw &= pud_flags(*pud) & _PAGE_RW;
*rw &= pmd_flags(*pmd) & _PAGE_RW;
pf = _PAGE_NX | _PAGE_RW | _PAGE_ENC;
unsigned long flags = _PAGE_RW;
pf |= _PAGE_RW;
pte &= ~_PAGE_RW;