put_guest_lc(9)
β¨ put_guest_lc(9) β¨
okay so bestie, welcome to the put_guest_lc(9) page from the Kernel API Manual β this one's a lil s390 KVM helper and she's lowkey iconic π
π NAME π
put_guest_lc β write a simple variable to a guest vcpu's lowcore π«Ά
πΈ SYNOPSIS πΈ
put_guest_lc (vcpu , x , gra );
π¦ ARGUMENTS π¦
vcpuβ the virtual cpu, the guest's lil brain cell π§xβ the value to copy to guest, aka the thing we're yeeting ingraβ vcpu's destination guest real address, like the exact drop-off spot π
β DESCRIPTION β
So what she does: copies a simple value from kernel space into a guest vcpu's lowcore π literally just that.
The size of the variable may be 1, 2, 4 or 8 bytes β pick your fighter, those are the only sizes allowed, no cap.
The destination must be located in the vcpu's lowcore. Otherwise the result is undefined π like genuinely undefined, not "undefined but probably fine", so don't test her.
Returns zero on success or -EFAULT on error.
π NOTE π
okay this part matters, pay attention bestie π
An error indicates that either the kernel is out of memory or the guest memory mapping is broken. In any case the best solution would be to terminate the guest. It is wrong to inject a guest exception.
so like β the vibes are bad, wrap it up, guest is done for π don't try to be cute and inject an exception, that's wrong.
π₯ SEE ALSO π₯
Kernel file ./arch/s390/kvm/s390/gaccess.h plus her whole friend group:
kvm_s390_real_to_abs(9)_kvm_s390_logical_to_effective(9)kvm_s390_logical_to_effective(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)read_guest_real(9)
and that's the page!! π§ mwah π
sign-off time: this one lives in ./arch/s390/kvm/s390 and she's dated October 2026 β put that in your calendar bestie, that's the whole footer, periodt ππ
π¦ 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