mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Wathsala Wathawana Vithanage <wathsala.vithanage@arm.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	nd <nd@arm.com>, Kevin Tian <kevin.tian@intel.com>,
	Philipp Stanner <pstanner@redhat.com>,
	Yunxiang Li <Yunxiang.Li@amd.com>,
	"Dr. David Alan Gilbert" <linux@treblig.org>,
	Ankit Agrawal <ankita@nvidia.com>,
	"open list:VFIO DRIVER" <kvm@vger.kernel.org>
Subject: Re: [RFC PATCH] vfio/pci: add PCIe TPH to device feature ioctl
Date: Tue, 4 Mar 2025 18:24:21 -0700	[thread overview]
Message-ID: <20250304182421.05b6a12f.alex.williamson@redhat.com> (raw)
In-Reply-To: <PAWPR08MB89093BBC1C7F725873921FB79FC82@PAWPR08MB8909.eurprd08.prod.outlook.com>

On Tue, 4 Mar 2025 22:38:16 +0000
Wathsala Wathawana Vithanage <wathsala.vithanage@arm.com> wrote:

> > > Linux v6.13 introduced the PCIe TLP Processing Hints (TPH) feature for
> > > direct cache injection. As described in the relevant patch set [1],
> > > direct cache injection in supported hardware allows optimal platform
> > > resource utilization for specific requests on the PCIe bus. This feature
> > > is currently available only for kernel device drivers. However,
> > > user space applications, especially those whose performance is sensitive
> > > to the latency of inbound writes as seen by a CPU core, may benefit from
> > > using this information (E.g., DPDK cache stashing RFC [2] or an HPC
> > > application running in a VM).
> > >
> > > This patch enables configuring of TPH from the user space via
> > > VFIO_DEVICE_FEATURE IOCLT. It provides an interface to user space
> > > drivers and VMMs to enable/disable the TPH feature on PCIe devices and
> > > set steering tags in MSI-X or steering-tag table entries using
> > > VFIO_DEVICE_FEATURE_SET flag or read steering tags from the kernel using
> > > VFIO_DEVICE_FEATURE_GET to operate in device-specific mode.  
> > 
> > What level of protection do we expect to have here? Is it OK for
> > userspace to make up any old tag value or is there some security
> > concern with that?
> >   
> Shouldn't be allowed from within a container.
> A hypervisor should have its own STs and map them to platform STs for
> the cores the VM is pinned to and verify any old ST is not written to the
> device MSI-X, ST table or device specific locations.

And how exactly are we mediating device specific steering tags when we
don't know where/how they're written to the device.  An API that
returns a valid ST to userspace doesn't provide any guarantees relative
to what userspace later writes.  MSI-X tables are also writable by
userspace.  I could have missed it, but I also didn't note any pinning
requirement in this proposal.  Thanks,

Alex


  reply	other threads:[~2025-03-05  1:24 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-21 22:46 Wathsala Vithanage
2025-02-28 18:48 ` Alex Williamson
2025-03-03  4:20   ` Wathsala Wathawana Vithanage
2025-03-04  3:12     ` Alex Williamson
2025-03-04  7:01       ` Wathsala Wathawana Vithanage
2025-04-26 12:49       ` Wathsala Wathawana Vithanage
2025-03-03  7:49 ` Philipp Stanner
2025-03-03 17:21   ` Wathsala Wathawana Vithanage
2025-03-04 14:14 ` Jason Gunthorpe
2025-03-04 22:38   ` Wathsala Wathawana Vithanage
2025-03-05  1:24     ` Alex Williamson [this message]
2025-03-05  6:11       ` Wathsala Wathawana Vithanage
2025-03-05 18:58         ` Jason Gunthorpe
2025-03-05 20:21           ` Wathsala Wathawana Vithanage
2025-03-12  7:53         ` Tian, Kevin
2025-03-14  1:49           ` Wathsala Wathawana Vithanage
2025-04-07  5:16             ` Tian, Kevin
2025-04-01 14:11           ` Jason Gunthorpe
2025-04-01 23:38             ` Wathsala Wathawana Vithanage
2025-04-01 23:52               ` Jason Gunthorpe
2025-04-07  5:22             ` Tian, Kevin
2025-04-26 12:42         ` Wathsala Wathawana Vithanage
2025-06-02 23:06 ` [RFC PATCH v2 0/1] VFIO ioctl for TLP Processing Hints Wathsala Vithanage
2025-06-02 23:06   ` [RFC PATCH v2 1/1] vfio/pci: add PCIe TPH device ioctl Wathsala Vithanage

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250304182421.05b6a12f.alex.williamson@redhat.com \
    --to=alex.williamson@redhat.com \
    --cc=Yunxiang.Li@amd.com \
    --cc=ankita@nvidia.com \
    --cc=jgg@ziepe.ca \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@treblig.org \
    --cc=nd@arm.com \
    --cc=pstanner@redhat.com \
    --cc=wathsala.vithanage@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®