write_guest_real(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ write_guest_real(9) ✨

okay so bestie, this one's from the Kernel API Manual and it's literally about yeeting bytes from kernel space into guest real memory πŸŽ€ like, it's giving "delivery service but for memory" fr fr.


🌸 NAME 🌸

write_guest_real β€” copy data from kernel space to guest space real πŸ’…


✨ SYNOPSIS ✨

int write_guest_real (struct kvm_vcpu *vcpu , unsigned long gra , void
*data , unsigned long len );

that's the whole vibe. four things in, one int out. no cap. πŸ¦‹


πŸŽ€ ARGUMENTS πŸŽ€

  • vcpu β€” the virtual cpu, aka the main character of this whole operation πŸ‘‘
  • gra β€” the guest real address, where the data's headed 🏠
  • data β€” the source address in kernel space, where the data's coming from 🧳
  • len β€” number of bytes to copy, the actual amount of stuff we're hauling over πŸ“¦

πŸ’– DESCRIPTION πŸ’–

so here's what it does: copy len bytes from data (kernel space) over to gra (guest real address). simple as that. 🫢

πŸ’€ important caveat bestie: guest low address and key protection are not checked. like, at all. so don't be surprised, okay?

Returns zero on success πŸŽ‰ β€” but if things go sideways:

  • -EFAULT when copying from data failed 😭
  • PGM_ADRESSING in case gra is outside a memslot 🚫

in that PGM_ADRESSING situation, pgm check info is also stored, so you can inject it into the guest (if applicable) using kvm_s390_inject_prog_cond. iykyk πŸ’…

⚠️ and like, real talk: if an error occurs, data may have been copied partially to guest memory. so the job might be half-done. no refunds, no takebacks. 😭

🌈 SEE ALSO 🌈

Kernel file ./arch/s390/kvm/s390/gaccess.h β€” plus literally all these besties:


🧚 okay that's the whole page, slay. it lives in ./arch/s390/kvm/s390 and it's dated October 2026. go forth and copy those bytes responsibly, bestie πŸ’œβœ¨πŸŽ€
πŸ“¦ where this page comes from