kvm_gpc_activate_hva(9)
π 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β yourstruct gfn_to_pfn_cacheobject. 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 π
- Kernel file
./include/linux/kvm_host.h guest_state_enter_irqoff(9)guest_state_exit_irqoff(9)kvm_gpc_init(9)kvm_gpc_activate(9)kvm_gpc_check(9)kvm_gpc_refresh(9)kvm_gpc_deactivate(9)kvm_stats_linear_hist_update(9)kvm_stats_log_hist_update(9)
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
- 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