arch/x86/include/asm/pgtable.h
Source file repositories/reference/linux-study-clean/arch/x86/include/asm/pgtable.h
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/include/asm/pgtable.h- Extension
.h- Size
- 43219 bytes
- Lines
- 1751
- Domain
- Architecture Layer
- Bucket
- arch/x86
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/mem_encrypt.hasm/page.hasm/pgtable_types.hlinux/spinlock.hasm/x86_init.hasm/pkru.hasm/fpu/api.hasm/coco.hasm-generic/pgtable_uffd.hlinux/page_table_check.hasm/paravirt.hasm/pgtable_32.hasm/pgtable_64.hlinux/mm_types.hlinux/mmdebug.hlinux/log2.hasm/fixmap.h
Detected Declarations
struct seq_filestruct vm_area_structstruct vm_area_structfunction arch_flush_lazy_mmu_modefunction pmd_clear_flagsfunction pud_set_flagsfunction pud_clear_flagsfunction pte_presentfunction pte_shstkfunction pte_youngfunction pte_decryptedfunction pmd_dirtyfunction pmd_shstkfunction pmd_youngfunction pud_dirtyfunction pud_youngfunction pud_shstkfunction pte_writefunction pmd_writefunction pud_writefunction pte_hugefunction pte_globalfunction pte_execfunction pte_specialfunction pte_pfnfunction pmd_pfnfunction pud_pfnfunction p4d_pfnfunction pgd_pfnfunction pmd_leaffunction pmd_trans_hugefunction pud_trans_hugefunction has_transparent_hugepagefunction pmd_specialfunction pmd_mkspecialfunction pud_specialfunction pud_mkspecialfunction pte_set_flagsfunction pte_clear_flagsfunction mksaveddirty_shiftfunction clear_saveddirty_shiftfunction pte_mksaveddirtyfunction pte_clear_saveddirtyfunction pte_wrprotectfunction pte_uffd_wpfunction pte_mkuffd_wpfunction pte_clear_uffd_wpfunction pte_mkclean
Annotated Snippet
static inline void arch_flush_lazy_mmu_mode(void) {}
#endif /* CONFIG_PARAVIRT_XXL */
static inline pmd_t pmd_set_flags(pmd_t pmd, pmdval_t set)
{
pmdval_t v = native_pmd_val(pmd);
return native_make_pmd(v | set);
}
static inline pmd_t pmd_clear_flags(pmd_t pmd, pmdval_t clear)
{
pmdval_t v = native_pmd_val(pmd);
return native_make_pmd(v & ~clear);
}
static inline pud_t pud_set_flags(pud_t pud, pudval_t set)
{
pudval_t v = native_pud_val(pud);
return native_make_pud(v | set);
}
static inline pud_t pud_clear_flags(pud_t pud, pudval_t clear)
{
pudval_t v = native_pud_val(pud);
return native_make_pud(v & ~clear);
}
/*
* The following only work if pte_present() is true.
* Undefined behaviour if not..
*/
static inline bool pte_dirty(pte_t pte)
{
return pte_flags(pte) & _PAGE_DIRTY_BITS;
}
static inline bool pte_shstk(pte_t pte)
{
return cpu_feature_enabled(X86_FEATURE_SHSTK) &&
(pte_flags(pte) & (_PAGE_RW | _PAGE_DIRTY)) == _PAGE_DIRTY;
}
static inline int pte_young(pte_t pte)
{
return pte_flags(pte) & _PAGE_ACCESSED;
}
static inline bool pte_decrypted(pte_t pte)
{
return cc_mkdec(pte_val(pte)) == pte_val(pte);
}
#define pmd_dirty pmd_dirty
static inline bool pmd_dirty(pmd_t pmd)
{
return pmd_flags(pmd) & _PAGE_DIRTY_BITS;
}
static inline bool pmd_shstk(pmd_t pmd)
{
return cpu_feature_enabled(X86_FEATURE_SHSTK) &&
(pmd_flags(pmd) & (_PAGE_RW | _PAGE_DIRTY | _PAGE_PSE)) ==
(_PAGE_DIRTY | _PAGE_PSE);
}
#define pmd_young pmd_young
static inline int pmd_young(pmd_t pmd)
{
return pmd_flags(pmd) & _PAGE_ACCESSED;
}
static inline bool pud_dirty(pud_t pud)
{
return pud_flags(pud) & _PAGE_DIRTY_BITS;
}
static inline int pud_young(pud_t pud)
{
return pud_flags(pud) & _PAGE_ACCESSED;
}
static inline bool pud_shstk(pud_t pud)
{
return cpu_feature_enabled(X86_FEATURE_SHSTK) &&
(pud_flags(pud) & (_PAGE_RW | _PAGE_DIRTY | _PAGE_PSE)) ==
(_PAGE_DIRTY | _PAGE_PSE);
Annotation
- Immediate include surface: `linux/mem_encrypt.h`, `asm/page.h`, `asm/pgtable_types.h`, `linux/spinlock.h`, `asm/x86_init.h`, `asm/pkru.h`, `asm/fpu/api.h`, `asm/coco.h`.
- Detected declarations: `struct seq_file`, `struct vm_area_struct`, `struct vm_area_struct`, `function arch_flush_lazy_mmu_mode`, `function pmd_clear_flags`, `function pud_set_flags`, `function pud_clear_flags`, `function pte_present`, `function pte_shstk`, `function pte_young`.
- Atlas domain: Architecture Layer / arch/x86.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.