read_guest_real(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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:


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