Re: [PATCH v2 18/19] PCI: Replace untrusted state with device trust
From: Jason Gunthorpe
Date: Mon Nov 16 2026 - 14:04:48 EST
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?
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.
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