Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5444710imu; Tue, 13 Nov 2018 06:45:06 -0800 (PST) X-Google-Smtp-Source: AJdET5dpMsd7yV4VlrT7VR7P+BxYxEBqISKJ+vI3q+6jOpUNP41Daq+dozOlvlO8ryR+K6G06HQr X-Received: by 2002:a62:5793:: with SMTP id i19-v6mr5605525pfj.158.1542120306475; Tue, 13 Nov 2018 06:45:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542120306; cv=none; d=google.com; s=arc-20160816; b=CaikbQCrkRjOPO2F31pD3hcf9rm9hpqRsiL+CS2C5GRcHDKE4wzPP5F2woN08qBfPz rjsoxuhCcawHVcjIkSbUfDhio7cAQFzDd15yA3fAHBccecafhPNXOeZKfSW1I6L5ZxwV pY4PNqbSPDotgXdigwlCLOleAAG7sCC5IM51SDqnXV7ldcNxwJQzIc/ck4vbv8YNdD4i kT4QvjqAW9QCdmyEqcDti1b6tKku8umxQg2eiYihQHr1EW0GWaO4FdYjWQgHWMosOyku LUFQOO0pgDzgLs9pBOS1gDCltiQZYY4igqUq5arvNzWJh4YJo3F+vUD56BSBs+FqnSYx wIFw== 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=RV4rqa3fvX2pFeaOjQTSbx+QYwt27qebk0roPH5fBLA=; b=xDnBDcvVKoUcQcriIxdUDPzozZwbMXfyFJ41IeaCBjGW3FG5lRFHB7v+5xOOl5ZsGO vYn2duiMz0Yn8U7UwtTtR2C0Adhh/yCj7HvyvIv55B4AxreZxxsYd/V7WMqrdTXfag4m ZfR7lcK0RU9S4pGu3+Hq7JwChTEKriT4REzhdoShqXYi4Vg0Erf2K+A3BLYtGu7Yp3ZK xo22PuWS+CzXCCbEOtfIpMrHdEc160+aS03p0MO0YRMyyTvJ2BTyHm6v9Sor9ccAcrmO roiFJDJUwc1PLNurkP1YNVZmP16m1JmNJq3vzSsvMr8R3hi+Vo8JzhaWNKnd9k9/5RQy s6Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XP9jrKkJ; 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 w5-v6si23419744pfl.241.2018.11.13.06.44.43; Tue, 13 Nov 2018 06:45:06 -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=XP9jrKkJ; 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 S2387711AbeKNAlm (ORCPT + 99 others); Tue, 13 Nov 2018 19:41:42 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:51552 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732401AbeKNAlm (ORCPT ); Tue, 13 Nov 2018 19:41:42 -0500 Received: by mail-it1-f193.google.com with SMTP id m34-v6so18501887iti.1; Tue, 13 Nov 2018 06:43:15 -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=RV4rqa3fvX2pFeaOjQTSbx+QYwt27qebk0roPH5fBLA=; b=XP9jrKkJExoPBGkUSCClFsXZlBniO/+vA2A+YMPBkQ+s5pP+DtHzVZ7i60Zr2zveqq ZEaPcNCDTeXSNT6FkEy6fsbVey4bYqdfifkhldVHcEqrsARBNazDxUgHsI2GovGMTMnp JtlcxAuIPcb8u7k8mNB/x+De4PaQnclAIKNl5PGJ1bJTXRQf9K2sQVoQ49Se6h35+m+x DPmQ/TRVemtlLtbR7Tu05+MOKwRPQuiq+E5o+sEr/6B97xZItK40fbg4Jm83Vc4Qcbpr wmFP8xbux54qhyLAa2xJWY7CN/hfhV6MyYZukDb1lsyfPBtpLXcFryfBj8PmxQ2PAuR0 9tuQ== 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=RV4rqa3fvX2pFeaOjQTSbx+QYwt27qebk0roPH5fBLA=; b=YZCKFFrwyt5iOZc9Rql639fT5rfwAUaFOt+iqsKwdUKa131QGnUbuz2MQhctqHl1nJ Ov82Jw/vLrrooue3K5W7MdUGTWt6fvFnZ7kppJy8jrBuaB8P6DEp7BRdyH/man/D5nhF HT6V6GvByOPp0k2YC03tfVj8477qXTRbZKuoqEymVWxW14I9wPRHEF3yPCkbq6or1uW3 IV6/1jpQzJGSrmZ2uzsFuI/2P+amxVKcTNuQ638j8zr65999kjDJSySsI3/qpleF5Gbj HsLAEc6cKdVxwRJ7FwkJInAWbQ2BQiIVRpEtP9dhWfsnMEAZTaRv8x4ubziS46lBf6mJ i7jQ== X-Gm-Message-State: AGRZ1gIQEkinonZbl8P9GqZV+Ff+HyIVUvuK0dvfIVImTnfDOG6f5+os dABQGitSySOtq8NggV0L1vmG7bpgvqL2aQCu4fM= X-Received: by 2002:a24:a0cb:: with SMTP id o194mr3486527ite.115.1542120194996; Tue, 13 Nov 2018 06:43:14 -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> <20181113114020.GV2500@lahna.fi.intel.com> In-Reply-To: <20181113114020.GV2500@lahna.fi.intel.com> From: Yehezkel Bernat Date: Tue, 13 Nov 2018 16:42:58 +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 1:40 PM Mika Westerberg wrote: > > On Tue, Nov 13, 2018 at 01:13:31PM +0200, Yehezkel Bernat wrote: > > 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.) > > 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. So your point here is "currently we do the IOMMU decisions system-wide; we can always add a per-device attribute if needed"? Fair enough. So for this patch, Reviewed-by: Yehezkel Bernat