write_guest_lc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… write_guest_lc(9)

okay so bestie, buckle up β€” this is write_guest_lc from the Kernel API Manual, and it's literally the function that copies stuff from kernel space straight into a guest vcpu's lowcore. lowkey iconic behavior ngl πŸŽ€


✨ NAME ✨

write_guest_lc β€” copy data from kernel space to guest vcpu's lowcore. that's the whole vibe. copy, data, kernel space, lowcore. slay πŸ’–


🌸 SYNOPSIS 🌸

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

like yes, that's the whole signature, keep it exactly like that, no cap 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • vcpu β€” the virtual cpu. the main character, honestly πŸ‘‘
  • gra β€” vcpu's source guest real address. it's giving "where in guest-land" energy ✨
  • data β€” source address in kernel space. this is where the data's actually coming from πŸ’œ
  • len β€” number of bytes to copy. how much we're moving. no more, no less πŸŽ€

πŸ’… DESCRIPTION πŸ’…

So the whole thing is: copy data from kernel space to guest vcpu's lowcore. that's it. that's the function. 🌈

but okay, important caveat bestie β€” the entire range must be located within the vcpu's lowcore, otherwise the result is undefined. like literally undefined. we don't make the rules, we just warn you about them 😭 fr fr, don't test it.

Returns zero on success or -EFAULT on error. that's the whole return contract. periodt. πŸ’€


πŸ”₯ NOTE πŸ”₯

an error here indicates that either the kernel is out of memory or the guest memory mapping is broken. like, one of those two things. 😭

In any case the best solution would be to terminate the guest. yep, you read that right. it's rough out here. πŸ™ˆ

It is wrong to inject a guest exception. don't do that. not the move. 🚫

🌟 SEE ALSO 🌟

Kernel file ./arch/s390/kvm/s390/gaccess.h β€” that's where these besties live 🧚


and that's the page, bestie πŸ“

πŸ’– sign-off time: this little gem comes from ./arch/s390/kvm/s390 and it's dated October 2026 β€” go off, kernel docs, go off βœ¨πŸ‘‘

πŸ“¦ where this page comes from