vfio_ap_mdev...y_no_sharing(9)
π¦ vfio_ap_mdev_verify_no_sharing π
okay bestie, welcome to the Kernel API Manual β yes we're in kernel land today, and yes this one is lowkey a bouncer at the club door of s390 crypto. The function is vfio_ap_mdev_verify_no_sharing and it's on gatekeeping duty β¨
πΈ NAME πΈ
vfio_ap_mdev_verify_no_sharing β the function that checks your APQNs aren't being shared by matrix mdevs. no cap, that's literally its whole job π
β SYNOPSIS β
int vfio_ap_mdev_verify_no_sharing (struct ap_matrix_mdev *assignee ,
unsigned long *mdev_apm , unsigned long *mdev_aqm );
that's the whole signature, icon, memorize it π«Ά
π ARGUMENTS π
assigneeβ the matrix mdev thatmdev_apmandmdev_aqmare getting assigned to β¨ orβ¦NULLπ if this function got called by the AP bus driverin_usecallback, in which case the vibe check is different: it's verifying that none of the APQNs being reserved for the host device driver are in use by avfio_apmediated device. two moods, one parameter πmdev_apmβ the mask showing off the APIDs of the APQNs that need verifying π₯mdev_aqmβ and this one's the mask showing the APQIs of the APQNs that need verifying π
π DESCRIPTION π
so here's the tea π this function verifies that each APQN you get from the Cartesian product of the APIDs represented by the bits set in mdev_apm and the APQIs of the bits set in mdev_aqm is not assigned to a mediated device other than the mdev the APQN is being assigned to β that's assignee btw, keep up π
AP queue sharing is not allowed. periodt. hard no. π«
πΈ RETURN πΈ
0β the APQNs are not shared, slay, you're so valid β-EADDRINUSEβ otherwise π the APQNs are shared and the function is giving you that error back π
β¨ SEE ALSO β¨
the whole friend group, in order, no one gets left out π«Ά
- Kernel file
./drivers/s390/crypto/vfio_ap_ops.c get_update_locks_for_kvm(9),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_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)
ok and before you go β this page came from ./drivers/s390/crypto and it's dated October 2026, alongside the Kernel API Manual header up top π that's the source/version/date sign-off bestie, we're done here π§
go forth and never share an AP queue π β¨
π¦ 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