Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5223225imu; Tue, 13 Nov 2018 03:15:10 -0800 (PST) X-Google-Smtp-Source: AJdET5c47ZBbDEcFnuJkVz4K5yPQhygySFGtklrn87p/9foYjofnEKaf7Tdl+uObuvKU4p+6Fkje X-Received: by 2002:a62:a48:: with SMTP id s69mr4910588pfi.136.1542107710252; Tue, 13 Nov 2018 03:15:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542107710; cv=none; d=google.com; s=arc-20160816; b=MEZy0WQAOP1lGG8mV06GVU0rf6X+FtcIx9QF7/UunzItpvGGfhb52M9UZB5oZer6Ln nRb6/oAMDr/qPWf4E0lk0Sub9rSGIc83IZaHk6WYUQRqb7ukqHDtgXSnp3PdClB8X6Jf a+Smej6ujigFwODMdvfBC/QS1D8zEIer227yyooMsld+kvYhlKMXaOnsqgMBu27Jphim vgkBwhNDTD2ft+N0sPhugp25kgOEGfufhoVzVxocNIi4Qm+fvMU2V8lCbw5hYPv6ckU/ wn/tDM+GDYQ7f+8cSa+Lf+DrFPoUoZBxnnTCKC46zOKsYxZJLyohJ59buAgtM20M/lRv eXsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=7X9I+sSEW/L31dgqKLbg9fJS+e2MQS48lc0SXoFlrZs=; b=UVlsU34/bvSWlgzDI5Rsadpz1oB2MJAL/YflmCMRTwuVGc7TzWwo29YRyQ/PeJ2r8f GFII2g0Cer1nhhfjdaaPyljcqJm/QaCBbY9fKjnSe12nUvl1sGcQKcBtfuXtv4BkNkDy mMHQpak0+Bo7lz4HxuwO/tpQkt1NMFl7WHJCRUlEYfCKA9zU5PflEadKv6AkA8hgBPXo fz96uSMe9LkvtL6bZCF6OUYKq9BoGsAa1V+A2QKCnmiSL0489PLS7h7EKWr1Y//FocPA vOdbLBfMDqKJAZMhk6138oO1N1D4PMQIy+oFn+cLgPhzOFuCMdJDBTHvrheUYqsZQiLC 9L4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YttAFmvh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4-v6si22199238pfb.43.2018.11.13.03.14.54; Tue, 13 Nov 2018 03:15:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YttAFmvh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732472AbeKMVL1 (ORCPT + 99 others); Tue, 13 Nov 2018 16:11:27 -0500 Received: from mail-io1-f66.google.com ([209.85.166.66]:43114 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726581AbeKMVL0 (ORCPT ); Tue, 13 Nov 2018 16:11:26 -0500 Received: by mail-io1-f66.google.com with SMTP id t81-v6so8569929iod.10; Tue, 13 Nov 2018 03:13:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7X9I+sSEW/L31dgqKLbg9fJS+e2MQS48lc0SXoFlrZs=; b=YttAFmvhDwEhPhlBgprFwtEPieO9LQ1g9PBEPfLWcI2/d0Cv5aI9486gk5tEpSLOwY i42paPIb7HRGhgx7eeAyRHZlvxaBIWcB8Or2LmXQQTzlD++aYAJMbPxxfJUJNgTkblVK aDtLmto4wSm/Gqqq7ugKc4X1drerFnfZFCZU7aB0o4F0brBtqsaDoF2j0Wp6KiFEVjwJ FF8iksUKLPemzNzSh+XHa8UNY4VCm/nCtHIKOUCAAq+7HD7F+KPGS3tLfYzrjsM7xiQI qlYP4BH1uuHwW8kzjR6x9LmCwb/CXvfSAPN7COh/lafS9PepJGgYXT18mAYoguBahmKM ZZFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7X9I+sSEW/L31dgqKLbg9fJS+e2MQS48lc0SXoFlrZs=; b=tgdMymJ942Itzq9cESHvQnZCRTmGdUkJ/OubW1wNCyBrpsFWyLhDk57blAW2oeq9dI 3H2I68qqmW8m9dNzzwRgQoA0JVhKJT7tcQhro79goVx2yYhZjznNnjFCeZ7HzCEkQ8dL Kd290oXDn7K5/05+cMgELj3TZoa5xeBDIE5zysQmYpqv1YHxqJCtbwu6fITlpOoNV65x wPLn/NaCglM8FwA/pxmeF37AM55lXfMJBG/huAmLTQ4QZhCqsOhI1pkI+/uxPBBsWa8D QB0BZLRSdtawqchaHfj8tCnOt2V26iSKn8JW4AEXOdthPGyAgM3QgmDuM9jdTSfjwkjh I0Iw== X-Gm-Message-State: AGRZ1gKd1n9VWdpypSU3V+K/E5XTWt/Y3VyAjQhTY2Ir6O1Eq8DpCdXl QzytWWNwLD1a5rqWNxtVD1lM5ZX8Ka9WS+GBm8A= X-Received: by 2002:a6b:d117:: with SMTP id l23-v6mr3636812iob.146.1542107628357; Tue, 13 Nov 2018 03:13:48 -0800 (PST) MIME-Version: 1.0 References: <20181112160628.86620-1-mika.westerberg@linux.intel.com> <20181112160628.86620-5-mika.westerberg@linux.intel.com> <20181113105558.GR2500@lahna.fi.intel.com> In-Reply-To: <20181113105558.GR2500@lahna.fi.intel.com> From: Yehezkel Bernat Date: Tue, 13 Nov 2018 13:13:31 +0200 Message-ID: Subject: Re: [PATCH 4/4] thunderbolt: Export IOMMU based DMA protection support to userspace To: Mika Westerberg Cc: iommu@lists.linux-foundation.org, joro@8bytes.org, David Woodhouse , baolu.lu@linux.intel.com, ashok.raj@intel.com, Bjorn Helgaas , rjw@rjwysocki.net, jacob.jun.pan@intel.com, Andreas Noever , michael.jamet@intel.com, lukas@wunner.de, Christian Kellner , Mario Limonciello , Anthony Wong , linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 13, 2018 at 12:56 PM Mika Westerberg 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.) > > 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. So if needed, this will be another attribute, and definitely per-device, isn't it?