pci_tsm_bind(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– pci_tsm_bind(9) πŸ’–

okay bestie, welcome to the Kernel API Manual, section 9 β€” this is where the kernel girlies hang out. today we're talking about pci_tsm_bind, and honestly? she's an icon. let's get into it ✨


🌸 NAME 🌸

pci_tsm_bind β€” bind @pdev as a TDI for @kvm. that's it, that's the vibe πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

int pci_tsm_bind (struct pci_dev *pdev , struct kvm *kvm , u32 tdi_id );

like, literally the whole signature. look at her go πŸŽ€


πŸŽ€ ARGUMENTS πŸŽ€

  • pdev β€” the PCI device function you're binding. the main character of this operation, ngl 🫢
  • kvm β€” private memory attach context. think of it as the group chat where all the memory stuff gets discussed πŸ’¬
  • tdi_id β€” the identifier (that's a virtual BDF, fyi) for the TDI as referenced by the TSM and DSM. lowkey the ✨ name tag ✨ of the whole thing πŸ‘‘

✨ DESCRIPTION ✨

returns 0 on success, or a negative error code on failure. periodt. that's the entire description bestie, she's a woman of few words and honestly? respect πŸ’…


πŸ”₯ CONTEXT πŸ”₯

heads up, this one's important, don't skip it 🫣

the caller is responsible for constraining the bind lifetime to the registered state of the device. like, you gotta keep the bind alive only as long as the device is in its registered state β€” no cap.

for example: pci_tsm_bind / pci_tsm_unbind limited to the VFIO driver bound state of the device. so basically the bind and unbind are stuck together inside that VFIO-bound window, and if you're not tracking that you're gonna have a bad time 😭


🌈 SEE ALSO 🌈

the kernel file ./drivers/pci/tsm.c is where the magic lives, and here's the whole friend group you should also go say hi to:

go read them bestie, they're all so valid πŸ’œ


okay that's the whole page! huge shoutout to the source at ./drivers/pci, dated October 2026 β€” mark your calendars, the PCI girlies ate that month and left no crumbs πŸ“πŸ’–βœ¨

πŸ“¦ where this page comes from