Re: [PATCH v2 18/19] PCI: Replace untrusted state with device trust
From: Kameron Carr
Date: Mon Nov 16 2026 - 14:24:53 EST
On 11/16/2026 11:04 AM, Jason Gunthorpe wrote:
> On Mon, Nov 16, 2026 at 10:46:25AM -0800, Kameron Carr wrote:
>>> @@ -1738,24 +1738,24 @@ static void set_pcie_cxl(struct pci_dev *dev)
>>>
>>> }
>>>
>>> -static void set_pcie_untrusted(struct pci_dev *dev)
>>> +static void pci_set_default_trust_policy(struct pci_dev *dev)
>>> {
>>> - struct pci_dev *parent = pci_upstream_bridge(dev);
>>> + struct pci_dev *parent = pci_physfn(dev);
>>> +
>>> + if (parent == dev)
>>> + parent = pci_upstream_bridge(dev);
>>>
>>> if (!parent)
>>> return;
>>
>> Hi Leon,
>>
>> The default policy here works for physical hierarchies, but there's no
>> opportunity for a paravirtual host bridge to participate in the trust
>> resolution when the host bridge driver itself knows the appropriate
>> trust level for a device.
>
> HW doesn't really "know" the trust level, it can suggest a default but
> the kernel command line and userspace should always be able to
> override it.
>
>> My scenario is pci-hyperv in a confidential VM with a paravisor. The
>> paravisor is inside the guest's trust boundary and owns TDISP. It locks,
>> attests and accepts the device, then answers a VMBus query describing
>> which BAR ranges are private and whether the device's DMA may target
>> private memory. Before a driver can bind pci-hyperv has to:
>
> Sounds like a user in such an environment just wouldn't use the trust
> level mechanism at all.
>
> What use do you see for enabling trust level but having all the
> devices unattestable and accepted already?
Previous iterations of device trust used the trust level to make
decisions around DMA bounce buffering, etc. Is that no longer the case?
You're right that my scenario doesn't really care about the device trust
per se. I'm primarily interested in how device DMA bounce buffering will
be turned off for TDISP devices and how MMIO setup will be managed.
>
> Your bigger issue is the below:
>
>> - query the paravisor,
>> - refuse to operate the device if the query failed or if the response
>> is invalid,
>> - decide whether the device may operate.
>>
>> The modular host bridge driver in this scenario needs a hook to be able
>> to participate in trust resolution.
>>
>> I'm also looking for the right place to setup MMIO and configure DMA
>> in my scenario. Let me know if you have guidance.
>
> Well, you are very far outside what Linux expects for a CC flow, and
> these special requests conflict with the arch code flows we need to
> have.
>
> So, I don't know. Maybe somewhere in the arch code hyperv can hook and
> say the device is special? You'll have to see when we get more of the
> CC stuff layed out.
I am looking for good hook candidates. I was hoping that trust levels
would end up directing DMA behavior, etc. but maybe I am
misunderstanding the design direction for these trust levels.
--
Regards,
Kameron
> Though, FWIW, I don't like it at all as a model. Denying the tenant
> the ability to directly attest the HW is far away from what I'd
> consider as necessary for CC.
>
> Jason