arch/x86/mm/dump_pagetables.c
Source file repositories/reference/linux-study-clean/arch/x86/mm/dump_pagetables.c
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/mm/dump_pagetables.c- Extension
.c- Size
- 14240 bytes
- Lines
- 546
- 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.
- 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
linux/debugfs.hlinux/kasan.hlinux/mm.hlinux/init.hlinux/sched.hlinux/seq_file.hlinux/highmem.hlinux/pci.hlinux/ptdump.hasm/e820/types.h
Detected Declarations
struct pg_statestruct addr_markerenum address_markers_idxenum address_markers_idxfunction printk_protfunction note_wxfunction effective_protfunction effective_prot_ptefunction effective_prot_pmdfunction effective_prot_pudfunction effective_prot_p4dfunction effective_prot_pgdfunction note_pagefunction note_page_ptefunction note_page_pmdfunction note_page_pudfunction note_page_p4dfunction note_page_pgdfunction note_page_flushfunction ptdump_walk_pgd_level_corefunction ptdump_walk_pgd_levelfunction ptdump_walk_pgd_level_debugfsfunction ptdump_walk_user_pgd_level_checkwxfunction ptdump_walk_pgd_level_checkwxfunction pt_dump_init
Annotated Snippet
struct pg_state {
struct ptdump_state ptdump;
int level;
pgprotval_t current_prot;
pgprotval_t effective_prot;
pgprotval_t prot_levels[5];
unsigned long start_address;
const struct addr_marker *marker;
unsigned long lines;
bool to_dmesg;
bool check_wx;
unsigned long wx_pages;
struct seq_file *seq;
};
struct addr_marker {
unsigned long start_address;
const char *name;
unsigned long max_lines;
};
/* Address space markers hints */
#ifdef CONFIG_X86_64
enum address_markers_idx {
USER_SPACE_NR = 0,
KERNEL_SPACE_NR,
#ifdef CONFIG_MODIFY_LDT_SYSCALL
LDT_NR,
#endif
LOW_KERNEL_NR,
VMALLOC_START_NR,
VMEMMAP_START_NR,
#ifdef CONFIG_KASAN
KASAN_SHADOW_START_NR,
KASAN_SHADOW_END_NR,
#endif
CPU_ENTRY_AREA_NR,
#ifdef CONFIG_X86_ESPFIX64
ESPFIX_START_NR,
#endif
#ifdef CONFIG_EFI
EFI_END_NR,
#endif
HIGH_KERNEL_NR,
MODULES_VADDR_NR,
MODULES_END_NR,
FIXADDR_START_NR,
END_OF_SPACE_NR,
};
static struct addr_marker address_markers[] = {
[USER_SPACE_NR] = { 0, "User Space" },
[KERNEL_SPACE_NR] = { (1UL << 63), "Kernel Space" },
[LOW_KERNEL_NR] = { 0UL, "Low Kernel Mapping" },
[VMALLOC_START_NR] = { 0UL, "vmalloc() Area" },
[VMEMMAP_START_NR] = { 0UL, "Vmemmap" },
#ifdef CONFIG_KASAN
/*
* These fields get initialized with the (dynamic)
* KASAN_SHADOW_{START,END} values in pt_dump_init().
*/
[KASAN_SHADOW_START_NR] = { 0UL, "KASAN shadow" },
[KASAN_SHADOW_END_NR] = { 0UL, "KASAN shadow end" },
#endif
#ifdef CONFIG_MODIFY_LDT_SYSCALL
[LDT_NR] = { 0UL, "LDT remap" },
#endif
[CPU_ENTRY_AREA_NR] = { CPU_ENTRY_AREA_BASE,"CPU entry Area" },
#ifdef CONFIG_X86_ESPFIX64
[ESPFIX_START_NR] = { ESPFIX_BASE_ADDR, "ESPfix Area", 16 },
#endif
#ifdef CONFIG_EFI
[EFI_END_NR] = { EFI_VA_END, "EFI Runtime Services" },
#endif
[HIGH_KERNEL_NR] = { __START_KERNEL_map, "High Kernel Mapping" },
[MODULES_VADDR_NR] = { MODULES_VADDR, "Modules" },
[MODULES_END_NR] = { MODULES_END, "End Modules" },
[FIXADDR_START_NR] = { FIXADDR_START, "Fixmap Area" },
[END_OF_SPACE_NR] = { -1, NULL }
};
#define INIT_PGD ((pgd_t *) &init_top_pgt)
#else /* CONFIG_X86_64 */
enum address_markers_idx {
USER_SPACE_NR = 0,
KERNEL_SPACE_NR,
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/kasan.h`, `linux/mm.h`, `linux/init.h`, `linux/sched.h`, `linux/seq_file.h`, `linux/highmem.h`, `linux/pci.h`.
- Detected declarations: `struct pg_state`, `struct addr_marker`, `enum address_markers_idx`, `enum address_markers_idx`, `function printk_prot`, `function note_wx`, `function effective_prot`, `function effective_prot_pte`, `function effective_prot_pmd`, `function effective_prot_pud`.
- Atlas domain: Architecture Layer / arch/x86.
- 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.