kvm_pgtable_..._relax_perms(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 by kvm_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 ⭐

  • 0 on 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