kvm_pgtable..._clear_young(9)
π kvm_pgtable..._clear_young(9) β like, the Kernel API Manual, bestie β¨
okay so picture this: it's a Kernel API Manual page, the header situation is kvm_pgtable..._clear_young(9), and we're about to get into it. this one is lowkey about checking a flag and maybe wiping it. no cap. let's go π«Ά
πΈ NAME πΈ
kvm_pgtable_stage2_test_clear_young β peeks at the access flag in a page-table entry, and if you're feeling spicy, clears it too. that's the whole vibe check π
β¨ SYNOPSIS β¨
bool kvm_pgtable_stage2_test_clear_young (struct kvm_pgtable *pgt , u64
addr , u64 size , bool mkold );
she returns a bool, she takes four things. iconic signature, honestly π
π¦ ARGUMENTS π¦
pgtβ the page-table structure, and it has to be one that was initialised bykvm_pgtable_stage2_init*(). like, don't hand her a random struct and expect magic, bestie πaddrβ the intermediate physical address, aka how you point at the exact page-table entry you're talking about. it's giving "who's that" but for memory π§sizeβ how big the address range you're visiting is. yes, you can be nosy about more than one entry at a time πmkoldβtrueif the access flag should be cleared. that's it, that's the toggle. she's simple like that π
π DESCRIPTION π
first thing's first: the offset of addr within a page gets straight-up ignored. not her problem, not her business, we don't see it π
what she actually does is test and conditionally clear the access flag for every valid, leaf page-table entry used to translate the range [addr, addr + size). so she walks the whole range, checks the flags, and clears them only when you asked her to. very considered, very methodical, main character energy fr fr π₯
β οΈ ok this is the important bit, don't skip it: it is the caller's responsibility to invalidate the TLB after calling this function, so the updated permissions are actually visible to the CPUs. she does the page-table part, you do the TLB part. teamwork, babes π€ if you skip it, that's on you, not her π
π RETURN π
Returns true if any of the visited PTEs had the access flag set. even one. she only needs one little flag to be like "yep, found it" β
π SEE ALSO π
the whole friend group, assembled π«Ά and also the kernel file ./arch/arm64/include/asm/kvm_pgtable.h:
struct kvm_pgtable_mm_ops(9)enum kvm_pgtable_stage2_flags(9)enum kvm_pgtable_prot(9)enum kvm_pgtable_walk_flags(9)struct kvm_pgtable_walker(9)struct kvm_pgtable(9)kvm_pgtable_hyp_init(9)kvm_pgtable_hyp_destroy(9)kvm_pgtable_hyp_map(9)kvm_pgtable_hyp_unmap(9)kvm_get_vtcr(9)kvm_pgtable_stage2_pgd_size(9)__kvm_pgtable_stage2_init(9)kvm_pgtable_stage2_destroy(9)kvm_pgtable_stage2_destroy_range(9)kvm_pgtable_stage2_destroy_pgd(9)kvm_pgtable_stage2_free_unlinked(9)kvm_pgtable_stage2_create_unlinked(9)kvm_pgtable_stage2_map(9)kvm_pgtable_stage2_annotate(9)kvm_pgtable_stage2_unmap(9)kvm_pgtable_stage2_wrprotect(9)kvm_pgtable_stage2_mkyoung(9)kvm_pgtable_stage2_relax_perms(9)kvm_pgtable_stage2_split(9)kvm_pgtable_walk(9)kvm_pgtable_get_leaf(9)kvm_pgtable_stage2_pte_prot(9)kvm_pgtable_hyp_pte_prot(9)kvm_tlb_flush_vmid_range(9)
and that's the whole page, bestie π« shoutout to ./arch/arm64/include/asm for hosting her, October 2026 for the timestamp, and kvm_pgtable..._clear_young(9) for being the name on the door π go forth, clear some flags, flush that TLB, and slay π
β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms