read_guest_real(9)
π read_guest_real(9) β Kernel API Manual π
okay so bestie, welcome to the Kernel API Manual page for read_guest_real, and no cap, this is the one that yoinks bytes out of guest real memory and drops them into kernel space. it's giving "tiny function, real consequences." let's get into it π«Ά
β¨ NAME β¨
read_guest_real β copy data from guest space real to kernel space π
πΈ SYNOPSIS πΈ
int read_guest_real (struct kvm_vcpu *vcpu , unsigned long gra , void
*data , unsigned long len );
like, yes, the spacing is a whole vibe, don't touch it π
π¦ ARGUMENTS π¦
vcpuβ the virtual cpu, the main character of this whole operation πgraβ guest real address, i.e. where we're reading from πdataβ destination address in kernel space, i.e. where the goodies land πlenβ number of bytes to copy, the literal length of the mission β
π₯ DESCRIPTION π₯
so what it does is: copy len bytes from gra (guest real address) to data (kernel space). simple, iconic, slay β¨
π¨ important vibes: guest key protection is not checked. like, it just does not look. do with that info what you will π
returns zero on success, -EFAULT when copying to data failed, or PGM_ADRESSING in case gra is outside a memslot π (yes, that spelling is exactly how it's written in the source, we do not correct the ancestors). in that case, pgm check info is also stored, so you can inject it into the guest (if applicable) using kvm_s390_inject_prog_cond π§
π also real talk: if an error occurs, data may have been copied partially to kernel space. so it's not all-or-nothing, it's all-or-some, and you have to deal with that.
π SEE ALSO π
Kernel file ./arch/s390/kvm/s390/gaccess.h, plus the whole friend group:
kvm_s390_real_to_abs(9)_kvm_s390_logical_to_effective(9)kvm_s390_logical_to_effective(9)put_guest_lc(9)write_guest_lc(9)read_guest_lc(9)write_guest_with_key(9)write_guest(9)read_guest_with_key(9)read_guest(9)read_guest_instr(9)write_guest_abs(9)read_guest_abs(9)write_guest_real(9)π
and that's the whole page, bestie β sourced from ./arch/s390/kvm/s390, dated October 2026, filed under read_guest_real(9). go forth and copy those bytes responsibly ππ
π¦ 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