STRUCT ARM_SMMU_INVS(9)
πΈ struct arm_smmu_invs(9) πΈ
okay bestie, so this is a page straight outta the Kernel API Manual β it's all about struct arm_smmu_invs, and ngl it's giving main-character energy in the world of invalidation bookkeeping π
β¨ NAME β¨
struct arm_smmu_invs β the per-domain invalidation array, periodt π
π¦ SYNOPSIS π¦
struct arm_smmu_invs {
size_t max_invs;
size_t num_invs;
size_t num_trashes;
rwlock_t rwlock;
bool has_ats;
struct rcu_head rcu;
struct arm_smmu_inv inv[];
};
π Members π
max_invsβ the maximum capacity of that flexible array, like the hard ceiling, fr fr π§num_invsβ how many invalidations are actually chillin' in the flexible array. lowkey it may be smaller thanmax_invsonce a tailing trash entry gets excluded, but it must not be greater thanmax_invsβ that's the vibe check π«Άnum_trashesβ the number of trash entries in the array, there forarm_smmu_invs_purgeto deal with. Must not be greater thannum_invs, no cap πrwlockβ an optionalrwlockthat fences ATS operations πhas_atsβ a flag that says whether the array contains anINV_TYPE_ATSor anINV_TYPE_ATS_FULLβrcuβ thercuhead forkfree_rcuπ§invβ the flexible invalidation array itself, the icon π
π₯ Description π₯
So the arm_smmu_invs is an RCU data structure. During a ->attach_dev callback, arm_smmu_invs_merge, arm_smmu_invs_unref and arm_smmu_invs_purge all get used to allocate a brand-new copy of an old array β that's how additions and deletions happen in the old domain's and the new domain's invs arrays. it's giving "copy + glow-up" energy β¨
Then there's arm_smmu_invs_unref, which mutates a given array by internally reducing the user counts of some given entries. why?? because it exists to support a no-fail routine, like attaching to an IOMMU_DOMAIN_BLOCKED β no room for failure, bestie π€. and it could totally pair with a followup arm_smmu_invs_purge call to generate a new clean array. fresh start, slay π
The concurrent invalidation thread will push every invalidation described in the array into the command queue, once for each invalidation event. it's designed like this on purpose β to optimize the invalidation fast path by avoiding locks. speed, elegance, no lock drama π
A domain can be shared across SMMU instances, okay? so when an instance gets removed, it would delete all the entries that belong to that particular SMMU instance. then a synchronize_rcu would have to be called to sync the array β this exists to prevent any concurrent invalidation thread that's still accessing the old array from issuing commands to the command queue of a removed SMMU instance. safety first, always π‘οΈπ
π SEE ALSO π
- Kernel file
./drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.hstruct arm_smmu_inv_state(9)
and that's the whole page, bestie π that little footer energy at the bottom was the ./drivers/iommu/arm/arm-smmu-v3 source, dated October 2026 β so yeah, mark your calendars, iykyk π
πΈ
π¦ 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