kvm_vz_guest_tlb_lookup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« kvm_vz_guest_tlb_lookup(9) πŸ’«

ok so this is a page from the Kernel API Manual and honestly? it's a little baddie. it does exactly one thing and it does it well, no notes. let's get into it bestie πŸŽ€


🌸 NAME 🌸

kvm_vz_guest_tlb_lookup β€” literally just looks up a guest VZ TLB mapping. that's the whole vibe. πŸ’…


✨ SYNOPSIS ✨

int kvm_vz_guest_tlb_lookup (struct kvm_vcpu *vcpu , unsigned long gva ,
       unsigned long *gpa );

yes the spacing is like that in the original, we don't touch it, we respect the ancestors 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • vcpu β€” your KVM VCPU pointer. the main character of this whole situation πŸ‘‘
  • gva β€” the original manpage says -- undescribed -- and honestly? iconic. mysterious. unbothered. no cap, it's giving "we ran out of time to write the docs" 😭 (it's the guest virtual address, iykyk β€” but fr the page doesn't say, so i'm not gonna pretend it does)
  • gpa β€” a pointer to the output guest physical address, like, whatever gva maps to. that's where the answer goes πŸ’–

πŸ’œ DESCRIPTION πŸ’œ

so what does it actually DO. it converts a guest virtual address β€” one that lives in a guest TLB mapped segment β€” into a guest physical address. how? by probing the guest TLB. that's it. that's the tea β˜•

lowkey elegant. highkey obsessed. ✨


πŸ”₯ RETURN πŸ”₯

two possible outcomes, bestie, and you gotta know which one you're in:

  • 0 β€” a guest TLB mapping exists for gva. slay! *gpa will have been written. πŸ’–
  • -EFAULT β€” no guest TLB mapping exists for gva. sad trombone πŸ’€ and heads up: *gpa may not have been written. not "wasn't" β€” may not. so don't go reading it and acting surprised, okay? πŸ™ˆ

🌈 SEE ALSO 🌈

the kernel file ./arch/mips/kvm/tlb.c is out here with a whole friend group:

go read them, they're all in their TLB era 🧚


and that's the page!! brought to you by ./arch/mips/kvm, dated October 2026 β€” time traveler behavior honestly, we love to see it β­πŸ’… bye bestie, go probe that TLB πŸ“

πŸ“¦ where this page comes from