Re: [PATCH 17/17] PCI: Replace untrusted state with device trust
From: Aneesh Kumar K . V
Date: Mon Nov 16 2026 - 10:52:39 EST
Jason Gunthorpe <jgg@xxxxxxxx> writes:
> On Mon, Nov 16, 2026 at 06:38:25PM +0530, Aneesh Kumar K.V wrote:
>> > +static inline bool
>> > +pci_dev_default_is_restricted(const struct pci_dev *pdev)
>> > +{
>> > + enum device_trust_policy policy = READ_ONCE(pdev->dev.trust_policy);
>> > +
>> > + return policy == DEVICE_TRUST_POLICY_DISABLED ||
>> > + policy == DEVICE_TRUST_POLICY_ADVERSARY;
>> > +}
>> > +
>>
>> Could you clarify how this series will work alongside device acceptance
>> and private-memory access?
>>
>> In particular, what should callers of device_cc_accepted() use under
>> this model?
>
> Who is calling device_cc_accepted? I thought we were keeping that
> internal to the DMA PI?
>
>> My understanding is that trust describes the operating
>> policy, not TDISP acceptance or DMA access to private memory.
>
> Right.
>
>> Therefore,
>> neither FULL nor ADVERSARY alone indicates whether a device can access
>> private memory?
>
> Right.
>
> Once you turn on TDISP you effectively activate DMA, just like turning
> on the IOMMU.
>
We considered two options for doing this:
1. Via the ->accept() callback in pci_tsm_ops.
2. Via pci_dma_configure(), based on a combination of device trust and device acceptance.
If I understand correctly, you are suggesting that we stick with the
former?
-aneesh