guest_translate_gva(9)
π 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 capmodeβ 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
gpacontains 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:
guest_range_to_gpas(9)__cmpxchg_with_key(9)cmpxchg_guest_abs_with_key(9)guest_translate_address_with_key(9)check_gva_range(9)check_gpa_range(9)kvm_s390_check_low_addr_prot_real(9)walk_guest_tables(9)__gaccess_shadow_fault(9)
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
- 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