kvm_pgtable_..._relax_perms(9)
π kvm_pgtable_..._relax_perms(9) β from the Kernel API Manual π
okay so bestie, welcome to the glow-up page for kvm_pgtable_..._relax_perms(9). this is straight out of the Kernel API Manual and it's genuinely such a serve. we're talking arm64 KVM page tables, we're talking permission granting, we're talking the tiniest little permission relax you've ever seen. let's go π
β¨ NAME β¨
kvm_pgtable_stage2_relax_perms β relax the permissions enforced by a page-table entry.
the way this function just... loosens things up a lil bit? iconic. it doesn't take permissions away, it only grants. we love a generous queen π
π¦ SYNOPSIS π¦
int kvm_pgtable_stage2_relax_perms (struct kvm_pgtable *pgt , u64 addr ,
enum kvm_pgtable_prot prot , enum kvm_pgtable_walk_flags flags );
that's the whole signature fr fr. four args, one int coming back at you. no notes π
πΈ ARGUMENTS πΈ
pgtβ the page-table structure, and it has to have been initialised bykvm_pgtable_stage2_init*(). like, don't hand her an uninitialised struct bestie, she deserves better πaddrβ intermediate physical address that identifies which page-table entry we're talking about. this is the "which one" of the whole operation.protβ the additional permissions to grant for the mapping. read, write, execute β whatever you're handing out here β¨flagsβ flags that control the page-table walk (ex. a shared walk). lowkey controls the vibe of the stroll through the table πΆββοΈ
π DESCRIPTION π
first thing's first: the offset of addr within a page is ignored. so don't stress about where exactly inside the page you landed, she's not looking at that π«Ά
so here's the tea. if there is a valid, leaf page-table entry used to translate addr, then we relax the permissions in that entry according to the read, write and execute permissions specified by prot. simple as that, no cap.
and the important part, bestie: no permissions are removed. this function only adds. it's a strictly additive moment πβ¨ and TLB invalidation is performed after updating the entry β so yes she cleans up after herself, main character energy.
π¨ also, the big caveat: software bits cannot be set or cleared using kvm_pgtable_stage2_relax_perms. don't try it. not the vibe. that's just not what she does π
β RETURN β
0on success π- a negative error code on failure π
that's it. that's the return. binary queen.
π SEE ALSO π
okay prepare yourself, this list is LONG and we are NOT skipping a single one. every single reference, exactly as written, because we keep the facts and we keep them immaculate π
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_test_clear_young(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 page! go forth and relax those permissions (additively only, bestie).
mwah π β this page lives in the kernel file ./arch/arm64/include/asm, dated October 2026, and it's filed under kvm_pgtable_..._relax_perms(9). slay, periodt, see you in the man pages πβ¨
π¦ 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