STRUCT AP_MATRIX_MDEV(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ struct ap_matrix_mdev(9) πŸŽ€

okay so bestie, welcome to the Kernel API Manual page for struct ap_matrix_mdev β€” it's giving "the data associated with a matrix mediated device" and honestly? it's a whole vibe. this struct is basically the main character of the vfio_ap world, holding everything the kernel needs to know about one of these bad boys. let's get into it πŸ’…


✨ SYNOPSIS ✨

struct ap_matrix_mdev {
    struct vfio_device vdev;
    struct list_head node;
    struct ap_matrix matrix;
    struct ap_matrix shadow_apcb;
    struct kvm *kvm;
    crypto_hook pqap_hook;
    struct mdev_device *mdev;
    struct ap_queue_table qtable;
    struct eventfd_ctx *req_trigger;
    struct eventfd_ctx *cfg_chg_trigger;
    unsigned long apm_add[BITS_TO_LONGS( AP_DEVICES)];
    unsigned long aqm_add[BITS_TO_LONGS( AP_DOMAINS)];
    unsigned long adm_add[BITS_TO_LONGS( AP_DOMAINS)];
 };

like, that's the whole shape of it. iconic. no notes. 🫢


🌸 Members 🌸

here's the member-by-member breakdown, because every single field matters and we are not skipping any of them:

  • vdev β€” the vfio device πŸ’–
  • node β€” this is what lets the ap_matrix_mdev struct get added onto a list, lowkey doing the social-networking work of the struct world
  • matrix β€” the adapters, usage domains and control domains assigned to the mediated matrix device. the whole assigned squad, basically ✨
  • shadow_apcb β€” the shadow copy of the APCB field of the KVM guest's CRYCB. yes it's a mouthful, no we're not renaming it πŸŽ€
  • kvm β€” the struct holding guest's state
  • pqap_hook β€” the function pointer to the interception handler for the PQAP(AQIC) instruction. it's the bouncer at the club, catching that instruction on the way in πŸ”₯
  • mdev β€” the mediated device
  • qtable β€” table of queues (struct vfio_ap_queue) assigned to the mdev πŸ‘‘
  • req_trigger β€” eventfd ctx for signaling userspace to return a device
  • cfg_chg_trigger β€” eventfd ctx to signal AP config changed to userspace. so userspace always knows when the AP config shifted, no surprises, we love communication πŸ¦‹
  • apm_add β€” bitmap of APIDs added to the host's AP configuration
  • aqm_add β€” bitmap of APQIs added to the host's AP configuration
  • adm_add β€” bitmap of control domain numbers added to the host's AP configuration
ngl bestie, three separate bitmaps for three separate "added to the host's AP configuration" things β€” APIDs, APQIs, and control domain numbers. keep 'em straight and you're golden πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

  • Kernel file ./drivers/s390/crypto/vfio_ap_private.h
  • struct ap_matrix_dev(9)
  • struct ap_matrix(9)
  • struct ap_queue_table(9)
  • struct vfio_ap_queue(9)

go read those too, iykyk 😭✨


and that's the whole page, bestie!! πŸ’œ this one came to you from the kernel file spot at ./drivers/s390/crypto, dated October 2026, and yeah β€” that's the struct ap_matrix_mdev(9) page, periodt. πŸŒˆπŸ“ slay responsibly πŸŽ€

πŸ“¦ where this page comes from