get_update_locks_for_mdev(9)
π get_update_locks_for_mdev β the kernel API manual, bestie edition π
okay so picture this: it's a Kernel API Manual page, and the star of the show is get_update_locks_for_mdev. She grabs all the locks you need to dynamically update a KVM guest's APCB β and she grabs them in the correct order, because order is literally everything here. periodt. π
β¨ SYNOPSIS β¨
void get_update_locks_for_mdev (struct ap_matrix_mdev *matrix_mdev );
πΈ ARGUMENTS πΈ
matrix_mdevβ a pointer to astruct ap_matrix_mdevobject. She's holding the AP configuration data you're gonna use to update a KVM guest's APCB. that's her whole job tbh π«Ά
π₯ DESCRIPTION π₯
the way this function works is honestly so organized of her. the proper locking order is exactly this, no improvising, no vibes-based reordering:
matrix_dev->guests_lockβ required to use the KVM pointer to update a KVM guest's APCB.matrix_mdev->kvm->lockβ required to update a guest's APCB.matrix_dev->mdevs_lockβ required to access data stored in amatrix_mdev.
like, she said "the locks come in a specific order and I'm not negotiating." iconic behavior, honestly. π
π¦ NOTE π¦
lowkey important caveat: ifmatrix_mdevisNULL, or it's not attached to a KVM guest, then the KVM lock will not be taken. no guest, no lock, no problem. π
π SEE ALSO π
the whole friend group, in no particular order (okay, it's in this particular order):
- Kernel file
./drivers/s390/crypto/vfio_ap_ops.c get_update_locks_for_kvm(9)release_update_locks_for_kvm(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 one lives over in ./drivers/s390/crypto, stamped October 2026, and it answers to the name get_update_locks_for_mdev(9). go forth and lock in the right order, ily, 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