kvm_s390_inject_prog_cond(9)
π kvm_s390_inject_prog_cond(9) β the Kernel API Manual page your group chat needed
okay so bestie, welcome to the Kernel API Manual entry for kvm_s390_inject_prog_cond β a function name so long it's basically its own vibe π but don't run, it's actually lowkey adorable once you get what it does. It conditionally injects a program check, and "conditionally" is doing so much work in that sentence, iykyk.
β¨ NAME β¨
kvm_s390_inject_prog_cond β conditionally inject a program check π
πΈ SYNOPSIS πΈ
int kvm_s390_inject_prog_cond (struct kvm_vcpu *vcpu , int rc );
π¦ ARGUMENTS π¦
vcpuβ the virtual cpu in question, the main character of this whole operation πrcβ the original return/error code, i.e. the receipts from whatever just happened π§Ύ
π DESCRIPTION π
So here's the lore: this function is supposed to be used after regular guest access functions failed, and its whole job is to conditionally inject a program check to a vcpu. Not always β conditionally. That distinction is literally the entire point, bestie, don't skip it π
The typical pattern looks like this:
rc = write_guest(vcpu, addr, data, len); if (rc) return kvm_s390_inject_prog_cond(vcpu, rc);
Now the part where you have to actually pay attention π₯ A negative return code from guest access functions implies an internal error, like e.g. out of memory. When that happens, no program check should be injected to the guest β hard no, do not pass go, do not inject. π ββοΈ
A positive value, on the other hand, implies that an exception happened while accessing a guest's memory. In that case, all the data belonging to the corresponding program check has already been stored in vcpu->arch.pgm, and it can be injected with kvm_s390_inject_prog_irq. See how it all connects? It's giving ecosystem π«Ά
β RETURN β
- the original
rcvalue ifrcwas negative (internal error) π - zero if
rcwas already zero βοΈ - zero or error code from injecting if
rcwas positive (program check injected to vcpu) π
π SEE ALSO π
Kernel file ./arch/s390/kvm/s390/s390.h __kvm_s390_pv_destroy_page(9), kvm_s390_vcpu_crypto_reset_all(9), kvm_s390_vcpu_pci_enable_interp(9)
lowkey go read those too, they're in the same friend group fr fr π
and that's the whole page, bestie β no cap, you ate that π§ sign-off time: this lil masterpiece comes from the Kernel API Manual source at ./arch/s390/kvm/s390, dated October 2026. iconic. 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