arch/powerpc/include/asm/book3s/64/pgtable.h
Source file repositories/reference/linux-study-clean/arch/powerpc/include/asm/book3s/64/pgtable.h
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/include/asm/book3s/64/pgtable.h- Extension
.h- Size
- 42129 bytes
- Lines
- 1465
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
asm-generic/pgtable-nop4d.hlinux/mmdebug.hlinux/bug.hlinux/sizes.hasm/pgtable-masks.hlinux/page_table_check.hasm/book3s/64/hash.hasm/book3s/64/radix.hasm/book3s/64/pgtable-64k.hasm/barrier.h
Detected Declarations
struct spinlockenum pgtable_indexfunction ioremap_max_orderfunction pmd_leaffunction pud_leaffunction pmd_leaf_sizefunction pud_leaf_sizefunction regionfunction __ptep_test_and_clear_youngfunction thefunction pte_readfunction ptep_set_wrprotectfunction huge_ptep_set_wrprotectfunction ptep_get_and_clearfunction ptep_get_and_clear_fullfunction pte_clearfunction pte_dirtyfunction pte_youngfunction pte_specialfunction pte_execfunction pte_soft_dirtyfunction pte_mksoft_dirtyfunction pte_clear_soft_dirtyfunction pte_protnonefunction pte_hw_validfunction pte_presentfunction arch_pte_access_permittedfunction pte_userfunction pte_access_permittedfunction pte_user_accessible_pagefunction pfn_ptefunction pte_wrprotectfunction pte_exprotectfunction pte_mkcleanfunction pte_mkoldfunction pte_mkexecfunction pte_mkwrite_novmafunction pte_mkdirtyfunction pte_mkyoungfunction pte_mkspecialfunction pte_mkhugefunction pte_modifyfunction pte_swp_mksoft_dirtyfunction pte_swp_soft_dirtyfunction pte_swp_clear_soft_dirtyfunction pte_swp_mkexclusivefunction pte_swp_exclusivefunction pte_swp_clear_exclusive
Annotated Snippet
#ifndef _ASM_POWERPC_BOOK3S_64_PGTABLE_H_
#define _ASM_POWERPC_BOOK3S_64_PGTABLE_H_
#include <asm-generic/pgtable-nop4d.h>
#ifndef __ASSEMBLER__
#include <linux/mmdebug.h>
#include <linux/bug.h>
#include <linux/sizes.h>
#endif
/*
* Common bits between hash and Radix page table
*/
#define _PAGE_EXEC 0x00001 /* execute permission */
#define _PAGE_WRITE 0x00002 /* write access allowed */
#define _PAGE_READ 0x00004 /* read access allowed */
#define _PAGE_PRIVILEGED 0x00008 /* kernel access only */
#define _PAGE_SAO 0x00010 /* Strong access order */
#define _PAGE_NON_IDEMPOTENT 0x00020 /* non idempotent memory */
#define _PAGE_TOLERANT 0x00030 /* tolerant memory, cache inhibited */
#define _PAGE_DIRTY 0x00080 /* C: page changed */
#define _PAGE_ACCESSED 0x00100 /* R: page referenced */
/*
* Software bits
*/
#define _RPAGE_SW0 0x2000000000000000UL
#define _RPAGE_SW1 0x00800
#define _RPAGE_SW2 0x00400
#define _RPAGE_SW3 0x00200
#define _RPAGE_RSV1 0x00040UL
#define _RPAGE_PKEY_BIT4 0x1000000000000000UL
#define _RPAGE_PKEY_BIT3 0x0800000000000000UL
#define _RPAGE_PKEY_BIT2 0x0400000000000000UL
#define _RPAGE_PKEY_BIT1 0x0200000000000000UL
#define _RPAGE_PKEY_BIT0 0x0100000000000000UL
#define _PAGE_PTE 0x4000000000000000UL /* distinguishes PTEs from pointers */
#define _PAGE_PRESENT 0x8000000000000000UL /* pte contains a translation */
/*
* We need to mark a pmd pte invalid while splitting. We can do that by clearing
* the _PAGE_PRESENT bit. But then that will be taken as a swap pte. In order to
* differentiate between two use a SW field when invalidating.
*
* We do that temporary invalidate for regular pte entry in ptep_set_access_flags
*
* This is used only when _PAGE_PRESENT is cleared.
*/
#define _PAGE_INVALID _RPAGE_SW0
/*
* Top and bottom bits of RPN which can be used by hash
* translation mode, because we expect them to be zero
* otherwise.
*/
#define _RPAGE_RPN0 0x01000
#define _RPAGE_RPN1 0x02000
#define _RPAGE_RPN43 0x0080000000000000UL
#define _RPAGE_RPN42 0x0040000000000000UL
#define _RPAGE_RPN41 0x0020000000000000UL
/* Max physical address bit as per radix table */
#define _RPAGE_PA_MAX 56
/*
* Max physical address bit we will use for now.
*
* This is mostly a hardware limitation and for now Power9 has
* a 51 bit limit.
*
* This is different from the number of physical bit required to address
* the last byte of memory. That is defined by MAX_PHYSMEM_BITS.
* MAX_PHYSMEM_BITS is a linux limitation imposed by the maximum
* number of sections we can support (SECTIONS_SHIFT).
*
* This is different from Radix page table limitation above and
* should always be less than that. The limit is done such that
* we can overload the bits between _RPAGE_PA_MAX and _PAGE_PA_MAX
* for hash linux page table specific bits.
*
* In order to be compatible with future hardware generations we keep
* some offsets and limit this for now to 53
*/
#define _PAGE_PA_MAX 53
#define _PAGE_SOFT_DIRTY _RPAGE_SW3 /* software: software dirty tracking */
#define _PAGE_SPECIAL _RPAGE_SW2 /* software: special page */
Annotation
- Immediate include surface: `asm-generic/pgtable-nop4d.h`, `linux/mmdebug.h`, `linux/bug.h`, `linux/sizes.h`, `asm/pgtable-masks.h`, `linux/page_table_check.h`, `asm/book3s/64/hash.h`, `asm/book3s/64/radix.h`.
- Detected declarations: `struct spinlock`, `enum pgtable_index`, `function ioremap_max_order`, `function pmd_leaf`, `function pud_leaf`, `function pmd_leaf_size`, `function pud_leaf_size`, `function region`, `function __ptep_test_and_clear_young`, `function the`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: source implementation candidate.
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.