arm_smmu_invs_merge(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… arm_smmu_invs_merge β€” bestie's guide to merging invalidation arrays ✨

okay so this is a page from the Kernel API Manual and it's literally about one (1) function, so let's get into it 🫢


🌸 NAME 🌸

arm_smmu_invs_merge β€” the icon that takes @to_merge, folds it into @invs, and hands you back a brand new array πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

so this is the whole signature, no cap, copy it exactly bestie:

VISIBLE_IF_KUNIT struct arm_smmu_invs * arm_smmu_invs_merge (struct
arm_smmu_invs *invs , struct arm_smmu_invs *to_merge );

that VISIBLE_IF_KUNIT in front is just there, do not touch it πŸ’€


πŸŽ€ ARGUMENTS πŸŽ€

  • invs β€” the base invalidation array, aka the main character 🧚
  • to_merge β€” an array of invalidations to merge, aka the plus-one that gets folded in πŸ“

⭐ RETURN ⭐

on success you get a newly allocated array back, fr fr πŸ’–

if it doesn't work out? you get ERR_PTR. sad but true 😭


πŸ’œ DESCRIPTION πŸ’œ

okay so the vibe check on this one: this function must be locked and serialized with arm_smmu_invs_unref and arm_smmu_invs_purge β€” do not skip this, it's giving "consequences" πŸ’€

but bestie, note the exception: do not lockdep on any lock for KUNIT test. that part is non-negotiable, lowkey.

Both invs and to_merge must be sorted β€” that's how the returned array comes back sorted too, and honestly? the way that works is iconic ✨

the caller is responsible for freeing both invs and the returned new one. yes, both. yes, that's on you 🫢

and entries marked as trash will be purged in the returned array. trash takes itself out, we love to see it πŸ™ˆ


🌈 SEE ALSO 🌈


and that's the whole page bestie, go forth and merge responsibly πŸ’…βœ¨

source/version: ./drivers/iommu/arm/arm-smmu-v3 Β· dated October 2026 Β· page arm_smmu_invs_merge(9) β€” mwah, ily, bye πŸŽ€πŸ’–πŸ¦‹

πŸ“¦ where this page comes from