STRUCT AP_MATRIX_DEV(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct ap_matrix_dev(9)

okay bestie, so this is a page straight out of the Kernel API Manual β€” it's all about struct ap_matrix_dev, which (per the NAME, no cap) contains the data for the matrix device. That's the whole vibe. Let's get into it ✨


🌸 NAME

struct ap_matrix_dev β€” contains the data for the matrix device. yes that's it, that's the whole assignment, and she ate πŸ’…


πŸŽ€ SYNOPSIS

here's the whole struct, copied exactly, do not touch, do not "clean up", do not rename anything, i'm watching you πŸ‘€

struct ap_matrix_dev {
    struct device device;
    struct ap_config_info info;
    struct list_head mdev_list;
    struct mutex mdevs_lock;
    struct ap_driver  *vfio_ap_drv;
    struct mutex guests_lock;
    struct mdev_parent parent;
    struct mdev_type mdev_type;
    struct mdev_type *mdev_types;
 };

πŸ¦‹ Members

okay so these are the members this page actually tells you about β€” each one gets a lil breakdown 🫢

  • device β€” the generic device structure that's associated with the AP matrix device. the everyday, standard-device-struct bestie of the group, holdin' it down 🌈
  • info β€” the struct containing the output from the PQAP(QCI) instruction. literally that instruction's whole output, living in here πŸ’–
  • mdev_list β€” the list of mediated matrix devices that have been created. it's giving roster energy πŸ“‹
  • mdevs_lock β€” a mutex for locking the AP matrix device. and listen, it gets taken every single time we fiddle with state managed by the vfio_ap driver β€” whether that's through mdev_list or through writing the state of a single ap_matrix_mdev device. yes, it's quite coarse 😭 but fr fr, we don't expect much contention, so she's fine πŸ‘‘
  • vfio_ap_drv β€” the vfio_ap device driver. the driver in question, the main character πŸ”₯
  • guests_lock β€” a mutex for controlling access to a guest that's using AP devices passed through by the vfio_ap device driver. it gets taken when the AP devices are plugged into or unplugged from a guest 🌸, and also when an ap_matrix_mdev device is added to or removed from mdev_list, or when the list is iterated. so yeah, she's everywhere, and that's on periodt πŸ’€
heads up bestie: the struct up top also has parent, mdev_type, and mdev_types in it β€” this page only documents the ones listed above, so i'm not out here making stuff up about the rest. no invented lore in this house πŸ™ˆ

🧚 SEE ALSO

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

go read those too, iykyk πŸ“šβœ¨


okay that's the whole page!! πŸ’œ this iconic lil doc lives in ./drivers/s390/crypto and it's dated October 2026, all filed under struct ap_matrix_dev(9) in your Kernel API Manual. mwah, go forth and slay your AP matrix adventures πŸŽ€πŸ¦‹β­

πŸ“¦ where this page comes from