kvm_gpc_check(9)
kvm_gpc_check(9) β¨
okay so welcome to the Kernel API Manual, bestie π this page is all about kvm_gpc_check(9) and whether your gfn_to_pfn_cache is still valid. group-chat summary: it checks the cache, no cap.
π NAME π
kvm_gpc_check β check validity of a gfn_to_pfn_cache. π
πΈ SYNOPSIS πΈ
bool kvm_gpc_check (struct gfn_to_pfn_cache *gpc , unsigned long len );
π¦ ARGUMENTS π¦
gpcβ astruct gfn_to_pfn_cacheobject. that's the cache babe, the main character here πlenβ sanity check; the range being access must fit a single page. so like keep it inside one page, periodt π
π RETURN π
trueβ the cache is still valid and the address matches. slay β¨falseβ the cache is not valid. π
π₯ DESCRIPTION π₯
okay so here's the lock lore, bestie π. callers outside IN_GUEST_MODE context should hold a read lock on gpc->lock while calling this function, and then keep holding that lock until the access is complete. do not let go early, fr fr π«Ά
callers in IN_GUEST_MODE may do so without locking, although they should still hold a read lock on kvm->scru for the memslot checks. that's the vibe check: no locking in that mode, but the kvm->scru read lock still matters for memslot checks. iykyk π
π SEE ALSO π
Kernel file: ./include/linux/kvm_host.h πΈ
also go peek at these icons:
guest_state_enter_irqoff(9)guest_state_exit_irqoff(9)kvm_gpc_init(9)kvm_gpc_activate(9)kvm_gpc_activate_hva(9)kvm_gpc_refresh(9)kvm_gpc_deactivate(9)kvm_stats_linear_hist_update(9)kvm_stats_log_hist_update(9)
mwah π β source/version is ./include/linux, dated October 2026, and this page is kvm_gpc_check(9) signing off. bye bestie, go check that cache! π¦
π¦ 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