kvm_gpc_activate(9)
π kvm_gpc_activate(9) π
okay bestie, so this is a page from the Kernel API Manual β yes, that Kernel API Manual β and it's about kvm_gpc_activate, which is basically the glow-up routine for a cached kernel mapping + HPA for a given guest physical address. literally its whole personality. β¨
πΈ NAME πΈ
kvm_gpc_activate β prepare a cached kernel mapping and HPA for a given guest physical address. that's it, that's the vibe. π
π¦ SYNOPSIS π¦
int kvm_gpc_activate (struct gfn_to_pfn_cache *gpc , gpa_t gpa ,
unsigned long len );
look at that signature. iconic. no cap. π
π ARGUMENTS π
gpcβ astruct gfn_to_pfn_cacheobject, bestie. that's the thing we're priming. π«Άgpaβ the guest physical address to map. the where, if you will.lenβ this one's just a sanity check π§ : the range being access must fit a single page. single page only. one (1) page. don't push it.
β RETURN β
0β success, we ate, everything slayed π β¨-EINVALβ returned for a mapping which would cross a page boundary π« a whole "no β€οΈ" situation.-EFAULTβ returned for an untranslatable guest physical address π that address said "not today".
π¦ DESCRIPTION π¦
so what does this actually do, you ask? it primes a gfn_to_pfn_cache and links it into the gpc->kvm's list for invalidations to be processed. that's the whole little ritual. π₯
β οΈ but listen β callers are required to use kvm_gpc_check to ensure that the cache is valid before accessing the target page. like, mandatory. no skipping steps. do the vibe check first or it's giving undefined chaos, iykyk. π€
π SEE ALSO π
kernel file ./include/linux/kvm_host.h, plus the whole friend group:
guest_state_enter_irqoff(9)guest_state_exit_irqoff(9)kvm_gpc_init(9)kvm_gpc_activate_hva(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)
the whole squad fr fr π
okay that's the whole page, go read kvm_gpc_check next, mwah π this cutie lives in ./include/linux, it's stamped October 2026, and yes it's still kvm_gpc_activate(9) β bye 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