linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Yehezkel Bernat <yehezkelshb@gmail.com>
Cc: iommu@lists.linux-foundation.org, joro@8bytes.org,
	David Woodhouse <dwmw2@infradead.org>,
	baolu.lu@linux.intel.com, ashok.raj@intel.com,
	Bjorn Helgaas <bhelgaas@google.com>,
	rjw@rjwysocki.net, jacob.jun.pan@intel.com,
	Andreas Noever <andreas.noever@gmail.com>,
	michael.jamet@intel.com, lukas@wunner.de,
	Christian Kellner <ckellner@redhat.com>,
	Mario Limonciello <Mario.Limonciello@dell.com>,
	Anthony Wong <anthony.wong@canonical.com>,
	linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/4] thunderbolt: Export IOMMU based DMA protection support to userspace
Date: Tue, 13 Nov 2018 13:40:20 +0200	[thread overview]
Message-ID: <20181113114020.GV2500@lahna.fi.intel.com> (raw)
In-Reply-To: <CA+CmpXtre+A-sNT0XBWfdkuq9xJ+j34EGZ0nEpahJCSe3Kvg9A@mail.gmail.com>

On Tue, Nov 13, 2018 at 01:13:31PM +0200, Yehezkel Bernat wrote:
> On Tue, Nov 13, 2018 at 12:56 PM Mika Westerberg
> <mika.westerberg@linux.intel.com> wrote:
> >
> > > Just one point:
> > > Have you considered the option to add this property per (TBT?) device?
> >
> > No. ;-)
> >
> > You mean that one device uses security levels and another IOMMU? I don't
> > think it is possible without having some sort of table in the IOMMU
> > driver telling which devices it needs identity map and which not. Also
> > not sure what would be the benefit?
> 
> For performance, of course. If some devices are considered safe (maybe a list
> communicated by platform firmware), the kernel may decide to configure them to
> passthrough the IOMMU (I think I remember there is such an option, but maybe I'm
> wrong.)

At least I'm not aware of such an option. Windows for example enables
IOMMU for everything and I think macOS does the same. In Linux (with
these patches) we put all internal devices already passthrough mode so
things like internal graphics should not be affected. eGPUs are
different thing, though.

> > > If the kernel may decide to enable/disable the IOMMU or AST per device, maybe
> > > it should be on this level.
> > > Or maybe the IOMMU decision isn't going to change (it's system-wide) and the AST
> > > decision will be communicated per device by a new sysfs attribute anyway, if
> > > needed?
> >
> > Not sure what you mean by "AST"? The IOMMU decision is pretty much
> > system-wide.
> 
> Sorry, I meant ATS, Address Translation Service, mentioned in patch 3 in this
> series, and possibly be enabled for some devices for performance, as mentioned
> there.

Thanks for clarifying :)

> So if needed, this will be another attribute, and definitely
> per-device, isn't it?

Yes, we may want to add a way enable ATS for external devices (perhaps
global option or per-device attribute) if it turns out to cause
performance issues. However, I think it can be done later if needed. I
have not seen a single device actually supporting ATS (with the
exception of the "hacked" one in the linked thesis of patch 3/4 ;-))

  reply	other threads:[~2018-11-13 11:40 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12 16:06 [PATCH 0/4] PCI / iommu / thunderbolt: IOMMU based DMA protection Mika Westerberg
2018-11-12 16:06 ` [PATCH 1/4] PCI / ACPI: Identify external PCI devices Mika Westerberg
2018-11-12 18:02   ` Lukas Wunner
2018-11-13 10:56     ` Lorenzo Pieralisi
2018-11-13 11:27       ` Mika Westerberg
2018-11-13 11:45         ` Lorenzo Pieralisi
2018-11-15 10:22           ` Mika Westerberg
2018-11-15 11:13             ` Lorenzo Pieralisi
2018-11-15 11:37               ` Mika Westerberg
2018-11-15 12:07                 ` Lukas Wunner
2018-11-15 12:16                   ` Mika Westerberg
2018-11-15 17:46                     ` Lorenzo Pieralisi
2018-11-15 17:58                       ` Yehezkel Bernat
2018-11-15 19:10                         ` Mika Westerberg
2018-11-15 19:27                           ` Lukas Wunner
2018-11-15 19:32                             ` Mika Westerberg
2018-11-16  9:18                           ` Christoph Hellwig
2018-11-16  9:32                             ` Mika Westerberg
2018-11-22 10:48                               ` Mika Westerberg
2018-11-22 10:59                                 ` Christoph Hellwig
2018-11-15 19:00                       ` Mika Westerberg
2018-11-15 19:33                         ` Mario.Limonciello
2018-11-16 10:57                           ` Lorenzo Pieralisi
2018-11-20 21:43                             ` Rafael J. Wysocki
2018-11-21 12:40                               ` Lorenzo Pieralisi
2018-11-16  7:01                         ` Mika Westerberg
2018-11-12 16:06 ` [PATCH 2/4] iommu/vt-d: Force IOMMU on for platform opt in hint Mika Westerberg
2018-11-12 17:49   ` Raj, Ashok
2018-11-12 18:09   ` Alex Williamson
2018-11-12 19:51     ` Raj, Ashok
2018-11-12 16:06 ` [PATCH 3/4] iommu/vt-d: Do not enable ATS for external devices Mika Westerberg
2018-11-12 17:53   ` Raj, Ashok
2018-11-12 16:06 ` [PATCH 4/4] thunderbolt: Export IOMMU based DMA protection support to userspace Mika Westerberg
2018-11-12 16:22   ` Mario.Limonciello
2018-11-13 10:36     ` Mika Westerberg
2018-11-12 16:59   ` Yehezkel Bernat
2018-11-13 10:55     ` Mika Westerberg
2018-11-13 11:13       ` Yehezkel Bernat
2018-11-13 11:40         ` Mika Westerberg [this message]
2018-11-13 14:42           ` Yehezkel Bernat
     [not found]             ` <20181113152038.GD2500@lahna.fi.intel.com>
2018-11-13 15:38               ` Yehezkel Bernat
2018-11-13 16:12                 ` Mika Westerberg
2018-11-12 18:12 ` [PATCH 0/4] PCI / iommu / thunderbolt: IOMMU based DMA protection Lukas Wunner
2018-11-12 19:04   ` Yehezkel Bernat
2018-11-13 11:13   ` Mika Westerberg
2018-11-13  8:54 ` Joerg Roedel
2018-11-13 11:32   ` Mika Westerberg

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=20181113114020.GV2500@lahna.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=Mario.Limonciello@dell.com \
    --cc=andreas.noever@gmail.com \
    --cc=anthony.wong@canonical.com \
    --cc=ashok.raj@intel.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=ckellner@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jacob.jun.pan@intel.com \
    --cc=joro@8bytes.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=michael.jamet@intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=yehezkelshb@gmail.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;
as well as URLs for NNTP newsgroup(s).