get_update_locks_for_kvm(9)
π get_update_locks_for_kvm β from the Kernel API Manual, bestie
okay so this one's a locking page from the kernel API manual, and honestly? it's giving "VIP queue at the club" energy. because that's literally what it is β grabbing a whole stack of locks in exactly the right order or everything falls apart. no pressure π«Ά
β¨ NAME β¨
get_update_locks_for_kvm β grabs every lock you need to dynamically update a KVM guest's APCB, and grabs them in the correct order, because order is everything here π₯
πΈ SYNOPSIS πΈ
void get_update_locks_for_kvm (struct kvm *kvm );
π ARGUMENTS π
kvmβ a pointer to astruct kvmobject that holds the KVM guest's APCB. that's the whole vibe. π
π¦ DESCRIPTION π¦
so the proper locking order is this, and you cannot freestyle it β it's a numbered list for a reason, bestie:
matrix_dev->guests_lock: needed so you can use the KVM pointer to update a KVM guest's APCB.kvm->lock: needed to update a guest's APCB.kvm->arch.crypto.pqap_hook_rwsem: needed to updatepqap_hook, and it serializes against PQAP intercepts.matrix_dev->mdevs_lock: needed to access data stored in amatrix_mdev.
likeβ¦ lock one, lock two, lock three, lock four. in that order. periodt. π
π NOTE π
ifkvmisNULL, the KVM lock andpqap_hook_rwsemwill not be taken. so like, they just don't show up to the party. noted. π«‘
π SEE ALSO π
kernel file ./drivers/s390/crypto/vfio_ap_ops.c β that's the source, go read it iykyk π
and the whole friend group π:
release_update_locks_for_kvm(9)get_update_locks_for_mdev(9)release_update_locks_for_mdev(9)get_update_locks_by_apqn(9)get_update_locks_for_queue(9)vfio_ap_mdev_get_queue(9)vfio_ap_wait_for_irqclear(9)vfio_ap_free_aqic_resources(9)vfio_ap_irq_disable(9)vfio_ap_validate_nib(9)ensure_nib_shared(9)vfio_ap_irq_enable(9)vfio_ap_le_guid_to_be_uuid(9)handle_pqap(9)vfio_ap_mdev_verify_no_sharing(9)vfio_ap_mdev_validate_masks(9)assign_adapter_store(9)vfio_ap_mdev_unlink_adapter(9)unassign_adapter_store(9)assign_domain_store(9)unassign_domain_store(9)assign_control_domain_store(9)unassign_control_domain_store(9)vfio_ap_mdev_set_kvm(9)vfio_ap_mdev_unset_kvm(9)vfio_ap_mdev_resource_in_use(9)vfio_ap_mdev_hot_unplug_cfg(9)vfio_ap_mdev_cfg_remove(9)vfio_ap_mdev_on_cfg_remove(9)vfio_ap_filter_apid_by_qtype(9)vfio_ap_mdev_cfg_add(9)vfio_ap_mdev_on_cfg_add(9)vfio_ap_on_cfg_changed(9)
and that's the whole page, bestie π this lil icon lives in ./drivers/s390/crypto, dated October 2026, and it ate, no cap. mwah πβ¨π
π¦ 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