arch/powerpc/mm/book3s64/pgtable.c
Source file repositories/reference/linux-study-clean/arch/powerpc/mm/book3s64/pgtable.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/mm/book3s64/pgtable.c- Extension
.c- Size
- 17457 bytes
- Lines
- 651
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/sched.hlinux/mm_types.hlinux/memblock.hlinux/memremap.hlinux/pkeys.hlinux/debugfs.hlinux/proc_fs.hlinux/page_table_check.hasm/pgalloc.hasm/tlb.hasm/trace.hasm/powernv.hasm/firmware.hasm/ultravisor.hasm/kexec.hmm/mmu_decl.htrace/events/thp.h
Detected Declarations
function parse_kfence_early_initfunction pmdp_set_access_flagsfunction pudp_set_access_flagsfunction pmdp_test_and_clear_youngfunction pudp_test_and_clear_youngfunction set_pmd_atfunction set_pud_atfunction pmdp_invalidatefunction pudp_invalidatefunction pmdp_huge_get_and_clear_fullfunction pudp_huge_get_and_clear_fullfunction pmd_set_protbitsfunction pud_set_protbitsfunction pmd_mkhugefunction pfn_pudfunction pmd_modifyfunction pud_modifyfunction mmu_cleanup_allfunction create_section_mappingfunction remove_section_mappingfunction mmu_partition_table_initfunction flush_partitionfunction mmu_partition_table_set_entryfunction entryfunction pmd_fragment_freefunction pgtable_freefunction pgtable_free_tlbfunction __tlb_remove_tablefunction arch_report_meminfofunction ptep_modify_prot_startfunction ptep_modify_prot_commitfunction pmd_move_must_withdrawfunction setup_disable_tlbiefunction pgtable_debugfs_setupfunction htab_init_page_sizesfunction vm_get_page_protexport mmu_psize_defsexport __pmd_frag_nrexport __pmd_frag_size_shiftexport mmu_partition_table_set_entryexport tlbie_capableexport memremap_compat_alignexport vm_get_page_prot
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright 2015-2016, Aneesh Kumar K.V, IBM Corporation.
*/
#include <linux/sched.h>
#include <linux/mm_types.h>
#include <linux/memblock.h>
#include <linux/memremap.h>
#include <linux/pkeys.h>
#include <linux/debugfs.h>
#include <linux/proc_fs.h>
#include <linux/page_table_check.h>
#include <asm/pgalloc.h>
#include <asm/tlb.h>
#include <asm/trace.h>
#include <asm/powernv.h>
#include <asm/firmware.h>
#include <asm/ultravisor.h>
#include <asm/kexec.h>
#include <mm/mmu_decl.h>
#include <trace/events/thp.h>
struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT];
EXPORT_SYMBOL_GPL(mmu_psize_defs);
#ifdef CONFIG_SPARSEMEM_VMEMMAP
int mmu_vmemmap_psize = MMU_PAGE_4K;
#endif
unsigned long __pmd_frag_nr;
EXPORT_SYMBOL(__pmd_frag_nr);
unsigned long __pmd_frag_size_shift;
EXPORT_SYMBOL(__pmd_frag_size_shift);
#ifdef CONFIG_KFENCE
extern bool kfence_early_init;
static int __init parse_kfence_early_init(char *arg)
{
int val;
if (get_option(&arg, &val))
kfence_early_init = !!val;
return 0;
}
early_param("kfence.sample_interval", parse_kfence_early_init);
#endif
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
/*
* This is called when relaxing access to a hugepage. It's also called in the page
* fault path when we don't hit any of the major fault cases, ie, a minor
* update of _PAGE_ACCESSED, _PAGE_DIRTY, etc... The generic code will have
* handled those two for us, we additionally deal with missing execute
* permission here on some processors
*/
int pmdp_set_access_flags(struct vm_area_struct *vma, unsigned long address,
pmd_t *pmdp, pmd_t entry, int dirty)
{
int changed;
#ifdef CONFIG_DEBUG_VM
WARN_ON(!pmd_trans_huge(*pmdp));
assert_spin_locked(pmd_lockptr(vma->vm_mm, pmdp));
#endif
changed = !pmd_same(*(pmdp), entry);
if (changed) {
/*
* We can use MMU_PAGE_2M here, because only radix
* path look at the psize.
*/
__ptep_set_access_flags(vma, pmdp_ptep(pmdp),
pmd_pte(entry), address, MMU_PAGE_2M);
}
return changed;
}
int pudp_set_access_flags(struct vm_area_struct *vma, unsigned long address,
pud_t *pudp, pud_t entry, int dirty)
{
int changed;
#ifdef CONFIG_DEBUG_VM
assert_spin_locked(pud_lockptr(vma->vm_mm, pudp));
#endif
changed = !pud_same(*(pudp), entry);
if (changed) {
/*
* We can use MMU_PAGE_1G here, because only radix
* path look at the psize.
Annotation
- Immediate include surface: `linux/sched.h`, `linux/mm_types.h`, `linux/memblock.h`, `linux/memremap.h`, `linux/pkeys.h`, `linux/debugfs.h`, `linux/proc_fs.h`, `linux/page_table_check.h`.
- Detected declarations: `function parse_kfence_early_init`, `function pmdp_set_access_flags`, `function pudp_set_access_flags`, `function pmdp_test_and_clear_young`, `function pudp_test_and_clear_young`, `function set_pmd_at`, `function set_pud_at`, `function pmdp_invalidate`, `function pudp_invalidate`, `function pmdp_huge_get_and_clear_full`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: integration 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.