[PATCH v10 10/18] PCI/TSM: Add helpers to prevent disconnect while in use

Aneesh Kumar K.V aneesh.kumar at kernel.org
Thu Dec 3 00:26:14 PST 2026


"Tian, Kevin" <kevin.tian at intel.com> writes:

>> From: Aneesh Kumar K.V (Arm) <aneesh.kumar at kernel.org>
>> Sent: Wednesday, November 25, 2026 4:11 PM
>> 
>> Add PCI TEE Security Manager (TSM) helpers that prevent PF0 disconnect
>> while a function is in use. Validate the function's TSM association and
>> increment PF0's dsm_context_users count on get. Find PF0 through the
>> same function and decrement the count on put. Reject disconnect with
>> -EBUSY until all users have released it.
>
> 'context' is confusing here. what about 'link_users" as the real purpose
> is to reject link disconnect when the count is positive?
>
> then the related helpers can be renamed:
>
> pci_tsm_context_get/put() -> pci_tsm_link_get/put()
>


Sure, I'll update the names.

>
>> 
>> The caller must prevent removal of the function between get and put, for
>> example by keeping its VFIO device open. No per-call allocation is
>> needed.
>
> closing the VFIO device doesn't remove the pci device.
>

What I meant is that VFIO prevents the PCI function itself from being
removed.

-aneesh



More information about the linux-arm-kernel mailing list