vfio_ap_mdev...y_no_sharing(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ 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 that mdev_apm and mdev_aqm are getting assigned to ✨ or… NULL πŸ™ˆ if this function got called by the AP bus driver in_use callback, 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 a vfio_ap mediated 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 🫢


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