kvm_gpc_check(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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 β€” a struct gfn_to_pfn_cache object. 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:


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