Lines Matching +full:sw +full:- +full:exception
1 /* SPDX-License-Identifier: GPL-2.0 */
9 * Derived from "include/asm-i386/pgtable.h"
17 #include <linux/page-flags.h>
18 #include <linux/radix-tree.h>
54 * for zero-mapped memory areas etc..
90 #define VMALLOC_DEFAULT_SIZE ((128UL << 30) - MODULES_LEN)
118 * I Page-Invalid Bit: Page is not available for address-translation
119 * P Page-Protection Bit: Store access not possible for page
120 * C Change-bit override: HW is not required to set change bit
123 * | P-table origin | TT
127 * I Segment-Invalid Bit: Segment is not available for address-translation
128 * C Common-Segment Bit: Segment is not private (PoP 3-30)
129 * P Page-Protection Bit: Store access not possible for page
133 * | S-table origin | TF TTTL
137 * I Segment-Invalid Bit: Segment is not available for address-translation
147 * X Space-Switch event:
148 * G Segment-Invalid Bit:
149 * P Private-Space Bit:
150 * S Storage-Alteration:
152 * TL Table-Length:
164 #define _PAGE_NOEXEC 0x100 /* HW no-execute bit */
165 #define _PAGE_PROTECT 0x200 /* HW read-only bit */
170 #define _PAGE_PRESENT 0x001 /* SW pte present bit */
171 #define _PAGE_YOUNG 0x004 /* SW pte young bit */
172 #define _PAGE_DIRTY 0x008 /* SW pte dirty bit */
173 #define _PAGE_READ 0x010 /* SW pte read bit */
174 #define _PAGE_WRITE 0x020 /* SW pte write bit */
175 #define _PAGE_SPECIAL 0x040 /* SW associated with special page */
176 #define _PAGE_UNUSED 0x080 /* SW bit for pgste usage state */
179 #define _PAGE_SOFT_DIRTY 0x002 /* SW pte soft dirty bit */
191 * distinguish present from not-present ptes. It is changed only with the page
204 * prot-none, clean, old .11.xx0000.1
205 * prot-none, clean, young .11.xx0001.1
206 * prot-none, dirty, old .11.xx0010.1
207 * prot-none, dirty, young .11.xx0011.1
208 * read-only, clean, old .11.xx0100.1
209 * read-only, clean, young .01.xx0101.1
210 * read-only, dirty, old .11.xx0110.1
211 * read-only, dirty, young .01.xx0111.1
212 * read-write, clean, old .11.xx1100.1
213 * read-write, clean, young .01.xx1101.1
214 * read-write, dirty, old .10.xx1110.1
215 * read-write, dirty, young .00.xx1111.1
216 * HW-bits: R read-only, I invalid
217 * SW-bits: p present, y young, d dirty, r read, w write, s special,
225 /* Bits in the segment/region table address-space-control-element */
241 #define _REGION_ENTRY_NOEXEC 0x100 /* region no-execute bit */
258 #define _REGION3_ENTRY_DIRTY 0x2000 /* SW region dirty bit */
259 #define _REGION3_ENTRY_YOUNG 0x1000 /* SW region young bit */
260 #define _REGION3_ENTRY_LARGE 0x0400 /* RTTE-format control, large page */
261 #define _REGION3_ENTRY_READ 0x0002 /* SW region read bit */
262 #define _REGION3_ENTRY_WRITE 0x0001 /* SW region write bit */
265 #define _REGION3_ENTRY_SOFT_DIRTY 0x4000 /* SW region soft dirty bit */
267 #define _REGION3_ENTRY_SOFT_DIRTY 0x0000 /* SW region soft dirty bit */
279 #define _SEGMENT_ENTRY_NOEXEC 0x100 /* segment no-execute bit */
286 #define _SEGMENT_ENTRY_DIRTY 0x2000 /* SW segment dirty bit */
287 #define _SEGMENT_ENTRY_YOUNG 0x1000 /* SW segment young bit */
288 #define _SEGMENT_ENTRY_LARGE 0x0400 /* STE-format control, large page */
289 #define _SEGMENT_ENTRY_WRITE 0x0002 /* SW segment write bit */
290 #define _SEGMENT_ENTRY_READ 0x0001 /* SW segment read bit */
293 #define _SEGMENT_ENTRY_SOFT_DIRTY 0x4000 /* SW segment soft dirty bit */
295 #define _SEGMENT_ENTRY_SOFT_DIRTY 0x0000 /* SW segment soft dirty bit */
320 #define _REGION1_MASK (~(_REGION1_SIZE - 1))
321 #define _REGION2_MASK (~(_REGION2_SIZE - 1))
322 #define _REGION3_MASK (~(_REGION3_SIZE - 1))
323 #define _SEGMENT_MASK (~(_SEGMENT_SIZE - 1))
350 * (R = read-only, I = invalid, y = young bit):
352 * prot-none, clean, old 00..1...1...00
353 * prot-none, clean, young 01..1...1...00
354 * prot-none, dirty, old 10..1...1...00
355 * prot-none, dirty, young 11..1...1...00
356 * read-only, clean, old 00..1...1...01
357 * read-only, clean, young 01..1...0...01
358 * read-only, dirty, old 10..1...1...01
359 * read-only, dirty, young 11..1...0...01
360 * read-write, clean, old 00..1...1...11
361 * read-write, clean, young 01..1...0...11
362 * read-write, dirty, old 10..0...1...11
363 * read-write, dirty, young 11..0...0...11
365 * read-write, old segment table entries (origin!=0)
366 * HW-bits: R read-only, I invalid
367 * SW-bits: y young, d dirty, r read, w write
392 * A user page table pointer has the space-switch-event bit, the
393 * private-space-control bit and the storage-alteration-event-control
422 * On s390 the page table entry has an invalid bit and a read-only bit.
500 return mm->context.asce_limit <= _REGION1_SIZE; in mm_p4d_folded()
506 return mm->context.asce_limit <= _REGION2_SIZE; in mm_pud_folded()
512 return mm->context.asce_limit <= _REGION3_SIZE; in mm_pmd_folded()
519 if (unlikely(mm->context.has_pgste)) in mm_has_pgste()
528 if (unlikely(atomic_read(&mm->context.is_protected))) in mm_is_protected()
537 if (unlikely(mm->context.alloc_pgste)) in mm_alloc_pgste()
551 if (mm->context.uses_skeys) in mm_uses_skeys()
1046 pte = ptep_xchg_direct(vma->vm_mm, addr, ptep, pte_mkold(pte)); in ptep_test_and_clear_young()
1080 res = ptep_xchg_direct(vma->vm_mm, addr, ptep, __pte(_PAGE_INVALID)); in ptep_clear_flush()
1081 if (mm_is_protected(vma->vm_mm) && pte_present(res)) in ptep_clear_flush()
1128 ptep_xchg_direct(vma->vm_mm, addr, ptep, entry); in ptep_set_access_flags()
1216 #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
1217 #define p4d_index(address) (((address) >> P4D_SHIFT) & (PTRS_PER_P4D-1))
1218 #define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
1219 #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
1255 * The pgd_offset function *always* adds the index for the top-level
1258 * pgdp = pgd_offset(current->mm, addr);
1274 return pgd + ((address >> shift) & (PTRS_PER_PGD - 1)); in pgd_offset_raw()
1277 #define pgd_offset(mm, address) pgd_offset_raw(READ_ONCE((mm)->pgd), address)
1327 return end <= current->mm->context.asce_limit; in gup_fast_permitted()
1474 sto = (unsigned long) pmdp - pmd_index(addr) * sizeof(pmd_t); in __pmdp_idte()
1500 r3o = (unsigned long) pudp - pud_index(addr) * sizeof(pud_t); in __pudp_idte()
1546 pmdp_xchg_direct(vma->vm_mm, addr, pmdp, entry); in pmdp_set_access_flags()
1556 pmd = pmdp_xchg_direct(vma->vm_mm, addr, pmdp, pmd_mkold(pmd)); in pmdp_test_and_clear_young()
1601 return pmdp_xchg_lazy(vma->vm_mm, addr, pmdp, __pmd(_SEGMENT_ENTRY_EMPTY)); in pmdp_huge_get_and_clear_full()
1608 return pmdp_huge_get_and_clear(vma->vm_mm, addr, pmdp); in pmdp_huge_clear_flush()
1617 return pmdp_xchg_direct(vma->vm_mm, addr, pmdp, pmd); in pmdp_invalidate()
1634 return pmdp_huge_get_and_clear(vma->vm_mm, address, pmdp); in pmdp_collapse_flush()
1655 * A page-table entry has some bits we have to treat in a special way.
1657 * exception will occur instead of a page translation exception. The
1658 * specification exception has the bad habit not to store necessary
1662 * This leaves the bits 0-51 and bits 56-62 to store type and offset.
1663 * We use the 5 bits from 57-61 for the type and the 52 bits from 0-51
1670 #define __SWP_OFFSET_MASK ((1UL << 52) - 1)
1672 #define __SWP_TYPE_MASK ((1UL << 5) - 1)