Re: [RFC PATCH] vfio/pci: add PCIe TPH to device feature ioctl
From: Jason Gunthorpe
Date: Wed Mar 05 2025 - 14:00:14 EST
On Wed, Mar 05, 2025 at 06:11:22AM +0000, Wathsala Wathawana Vithanage wrote:
> By not enabling TPH in device-specific mode, hypervisors can ensure that
> setting an ST in a device-specific location (like queue contexts) will have no
> effect. VMs should also not be allowed to enable TPH.
So many workloads run inside VMs now for security reasons that is not
a reasonable approach.
> I believe this could
> be enforced by trapping (causing VM exits) on MSI-X/ST table writes.
Yes, I think this was always part of the plan for virtualization when
using a MSI-X table.
> Having said that, regardless of this proposal or the availability of kernel
> TPH support, a VFIO driver could enable TPH and set an arbitrary ST on the
> MSI-X/ST table or a device-specific location on supported platforms. If the
> driver doesn't have a list of valid STs, it can enumerate 8- or 16-bit STs and
> measure access latencies to determine valid ones.
And you think it is absolutely true that no TPH value can cause a
platform malfunction or security failure?
Jason