guest_translate_gva(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… guest_translate_gva(9) β€” the Kernel API Manual moment πŸŽ€

okay so bestie, we're in the Kernel API Manual today and the star of the show is guest_translate_gva(9), which is literally just... taking a guest virtual address and turning it into a guest absolute address. glow-up for addresses fr fr ✨


🌸 NAME 🌸

guest_translate_gva β€” translate a guest virtual into a guest absolute address πŸ¦‹


✨ SYNOPSIS ✨

unsigned long guest_translate_gva (struct kvm_vcpu *vcpu , unsigned long
gva , unsigned long *gpa , const union asce asce , enum gacc_mode mode ,
enum prot_type *prot );

like yes she's a long signature, she's high maintenance, she ate πŸ’…


🫢 ARGUMENTS 🫢

  • vcpu β€” your virtual cpu, the main character in this little story πŸ‘‘
  • gva β€” the guest virtual address (the "before" pic) 🌸
  • gpa β€” a pointer to where the guest physical (absolute) address should get stored, i.e. the "after" pic πŸ’–
  • asce β€” the effective asce, no cap
  • mode β€” says which access mode to use πŸ”₯
  • prot β€” returns the type for protection exceptions, so like, it tells u what kind of protection oopsie happened πŸ™ˆ

⭐ DESCRIPTION ⭐

So what she does is translate a guest virtual address into a guest absolute address by means of dynamic address translation, exactly as specified by the architecture. iconic behavior honestly 🧚

⚠️ but bestie listen β€” if the resulting absolute address is not available in the configuration, an addressing exception is indicated and gpa will not be changed. like she simply refuses to touch it, periodt. πŸ’€

🌈 RETURN 🌈

  • zero on success β€” and gpa contains the resulting absolute address πŸŽ‰
  • a negative value if the guest access failed, e.g. because of a broken guest mapping 😭
  • a positive value if an access exception happened. in that case the returned value is the program interruption code as defined by the architecture, iykyk πŸ‘‘

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./arch/s390/kvm/s390/gaccess.c and her whole friend group:

like go read them too, they're all slay in their own way πŸ’œ


okay that's the whole page, mwah πŸ’‹ β€” this little number lives in ./arch/s390/kvm/s390 and she's dated October 2026, so mark your calendars bestie, guest_translate_gva(9) said see u then πŸ“βœ¨

πŸ“¦ where this page comes from