kvm_s390_pv_set_aside(9)
π kvm_s390_pv_set_aside β bestie's guide to parking a protected VM
okay so this is kvm_s390_pv_set_aside(9) from the Kernel API Manual, and honestly it's one of those little functions that does so much heavy lifting. Let's get into it π«Ά
πΈ NAME πΈ
kvm_s390_pv_set_aside β literally just sets aside a protected VM so you can tear it down later. That's the whole vibe check. β¨
π SYNOPSIS π
int kvm_s390_pv_set_aside (struct kvm *kvm , u16 *rc , u16 *rrc );
like, copy that exactly, don't @ me π
π¦ ARGUMENTS π¦
kvmβ the VM. the main character, if you will πrcβ the return value for the RC field of the UVCB. very demure, very mindful, just holding that value for you πrrcβ the return value for the RRC field of the UVCB. same energy, different field π
π DESCRIPTION π
so what this does is set aside the protected VM for a subsequent teardown β like putting it on hold, no cap. Best part? The VM is able to continue immediately as a non-secure VM. iconic behaviour honestly π And the info you need to properly tear down the protected VM? all set aside, neatly, for later. so organized.
but here's the catch bestie: if another protected VM was already set aside and nobody started its teardown yet, this function will fail. it's giving one-at-a-time, no shortcuts. β οΈ
also, real talk β the CPUs of the protected VM need to be destroyed beforehand. like, before you call this. don't skip that step, fr fr π
π₯ CONTEXT π₯
kvm->lock needs to be held. yes, you actually have to hold the lock. this is not a drill π«
β RETURN β
0β slay, it worked. success π-EINVALβ nope, another protected VM was already set aside π-ENOMEMβ the system ran out of memory. budget said no π
π SEE ALSO π
- Kernel file
./arch/s390/kvm/s390/pv.cβshould_export_before_import(9) kvm_s390_pv_make_secure(9)kvm_s390_pv_destroy_page(9)struct pv_vm_to_be_destroyed(9)kvm_s390_pv_dispose_one_leftover(9)kvm_s390_pv_deinit_vm(9)kvm_s390_pv_deinit_cleanup_all(9)kvm_s390_pv_deinit_aside_vm(9)kvm_s390_pv_dump_stor_state(9)kvm_s390_pv_dump_complete(9)
the whole friend group, honestly π§ go read them too, iykyk π¦
tl;dr: hold kvm->lock, destroy the CPUs first, and remember only one protected VM can be set aside at a time. the way that this function has RULES. π
and that's the page bestie! π this one comes from ./arch/s390/kvm/s390, dated October 2026 β go off, s390 kernel devs, you absolute legends πβ¨
π¦ 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