kvm_gpc_activate_hva(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– kvm_gpc_activate_hva πŸ’–

okay so bestie, welcome to kvm_gpc_activate_hva β€” that's section 9 of the Kernel API Manual, and it's the iconic little helper that prepares a cached kernel mapping and an HPA for a given HVA. yes, that's a lot of acronyms, but we're gonna get through it together, i promise 🫢


✨ SYNOPSIS ✨

int kvm_gpc_activate_hva (struct gfn_to_pfn_cache *gpc , unsigned long
hva , unsigned long len );

like, that's the whole vibe. three args, one int coming back at you πŸ’…


🌸 ARGUMENTS 🌸

  • gpc β€” your struct gfn_to_pfn_cache object. this is the main character of the operation, no cap.
  • hva β€” the userspace virtual address to map. yep, userspace. we're doing address translation things.
  • len β€” a sanity check, bestie! the range being access must fit a single page. that's literally its whole job.

πŸŽ€ RETURN πŸŽ€

  • 0 β€” success! slay, we ate, everything worked πŸ’–
  • -EINVAL β€” for a mapping which would cross a page boundary. so like, if you tried to be a little too ambitious with your range, this is the vibe check failing 😭
  • -EFAULT β€” for an untranslatable guest physical address. it's giving "can't translate that, sorry" πŸ’€

πŸ¦‹ DESCRIPTION πŸ¦‹

so the semantics of this function are the same as those of kvm_gpc_activate. same energy, same behaviour, nothing new to learn there, iykyk.

the one (1) difference? it merely bypasses a layer of address translation. that's it. that's the whole flex. lowkey elegant, highkey useful ✨


🌈 SEE ALSO 🌈


ngl bestie, go read the friends of this function too β€” they're all in the ./include/linux directory and they all live in the same era okay 🧚

and that's the page!! congrats, you're now fluent in HVA-to-HPA mapping discourse πŸŽ“πŸ’œ this little gem lives in ./include/linux and the version date on it is October 2026 β€” so mark your calendars, screenshot it, whatever, because it's iconic and it's staying πŸ’…πŸŒΈ see you in the next man page, bestie!! πŸ¦‹πŸ‘‘

πŸ“¦ where this page comes from