Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5002678pxj; Tue, 22 Jun 2021 12:51:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEWtZDGcI8FPAhVqA13yxe7/JkJjfyGW+3SFI1jr6tJ0ynJk7SmovPQ5/V0pN8tEcYbc6v X-Received: by 2002:a02:838c:: with SMTP id z12mr5606939jag.89.1624391515218; Tue, 22 Jun 2021 12:51:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624391515; cv=none; d=google.com; s=arc-20160816; b=zLPEss99FvLhlkKRilB10r2R9QgRUcuSPu87ogehkNIZ8eeVh9Ee+kDJwLzbJTixWU moZffqVLW+vCIzN3YStoW3JiNk3NF6YViWiQU/RNFX1wMLCIQ1G8EvXaJy+BSuKc1P+P baKBkHiIqvZvGuIWkCQ+LtnOwItrV5xpQgIIrDzInuotKf0bc+WsErKvevOiCDsSzgae lZNJYg4nWpxvu7840J3ix0a8QfK/QUuSBbYOj+BEkDftbCFZj+HmmSNdugVcheWlFeab PT6g3l8LvEWbtab7EbYkIWQyuYjyOtJH6oXaiM6WaLTzFV+2oiY7LoRxLX6bUe4gEBTO qqoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=N93FQS54KNMw/RWZd3sdd1/c5zsgaKSRIH5cGtG3wLQ=; b=DAo46fu2ZPb17Wrlwak2gYGSJBUcYsSlODytWZcPNpwTMbKr3YGIAINF+WibqcP4wZ coq74q/Jhif04L8ix0LSDFlR81mBWBemv74wo+5ve8c+sD2Y/oseRlxKvA8Q0O4hmE4f f/MnqJCtxzvzOYkv0AkRLcXjn4+CQTX3ultsPwcZZBklRF+VW8YGibjo14j0IlI9WvQd 15GkblGZAQHlPBBTKiDq+TyD59mAkZSU6l4D+n5F/zs6HBqcf+8F2bR2OM+tfGcYNmlM 8sKJTqf9h3dL5sXueZKe6FzyXYPj9XVR14XAt8z7tDqhWQikHzXe4bPTjZhCd0c4la+s fXZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="nKSDq/oC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e14si332716jaq.1.2021.06.22.12.51.42; Tue, 22 Jun 2021 12:51:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="nKSDq/oC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232631AbhFVTw5 (ORCPT + 99 others); Tue, 22 Jun 2021 15:52:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232021AbhFVTw4 (ORCPT ); Tue, 22 Jun 2021 15:52:56 -0400 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C6A0C061574 for ; Tue, 22 Jun 2021 12:50:39 -0700 (PDT) Received: by mail-qk1-x733.google.com with SMTP id q64so36308775qke.7 for ; Tue, 22 Jun 2021 12:50:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=N93FQS54KNMw/RWZd3sdd1/c5zsgaKSRIH5cGtG3wLQ=; b=nKSDq/oCJcM6qZHdPsZIzNgBCyluw3srCscilwpHd/8GiydqZY43q/T3vv2Nn2jbKD jegHEFKq7oKJUZmrnbp2L6fkE3vgH2JXF/RfOrax19gy3NpN1urkxXl0RO3exPK9Eg/i cQzl2nnV7iu4Ug4cNN87vHMj6sK4LHNEdz+OI= 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=N93FQS54KNMw/RWZd3sdd1/c5zsgaKSRIH5cGtG3wLQ=; b=p7av23Xrne9X9h/8KmrNx7CpNuydMf7UJ8cMrCtZVWwmNZ85cZ1hYgNB3fVOCUReEe /Ak8fu6iM19rTxbxH3y/sPbg7Re0eUGiynlXBpXbqXQ0J+ZWKcRU5F1wsC7xfRD9s4Sa oHogcwzLvxwvGCmyGoIaIWLWJhlQoFjJ66jPF/UyjN+59oEqCcHNcb2YauNv5u+MLPdh edR59gbWt5oB4XaAXB2WzsyPcPUPZV3cTk26u8esupqVglLUOdlNcQFQSJoZuKcnRhL4 p3HV8exlYubvgUotmiSOcD08yULcB6fTyCjJi6j1bTE29wzUjOrwN+iOoZsmp83fpAgr S2Wg== X-Gm-Message-State: AOAM532aN7Z8zWyqR85ag7+Ll8yMr+F1/KMzgKPrYY0sp8CR/6IeN4i5 FBbN1GRqFnfS3wSCOaSZqzHP4PcY6UmOpA== X-Received: by 2002:a05:620a:1182:: with SMTP id b2mr6081156qkk.408.1624391438199; Tue, 22 Jun 2021 12:50:38 -0700 (PDT) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com. [209.85.222.169]) by smtp.gmail.com with ESMTPSA id c20sm2531908qtm.52.2021.06.22.12.50.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Jun 2021 12:50:37 -0700 (PDT) Received: by mail-qk1-f169.google.com with SMTP id i68so42698274qke.3 for ; Tue, 22 Jun 2021 12:50:37 -0700 (PDT) X-Received: by 2002:a25:2405:: with SMTP id k5mr6836288ybk.405.1624391426495; Tue, 22 Jun 2021 12:50:26 -0700 (PDT) MIME-Version: 1.0 References: <20210621235248.2521620-1-dianders@chromium.org> In-Reply-To: From: Doug Anderson Date: Tue, 22 Jun 2021 12:50:15 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/6] iommu: Enable devices to request non-strict DMA, starting with QCom SD/MMC To: John Garry Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , "Rafael J. Wysocki" , Will Deacon , Robin Murphy , Joerg Roedel , Bjorn Andersson , Ulf Hansson , Adrian Hunter , Bjorn Helgaas , Rob Clark , linux-arm-msm , linux-pci@vger.kernel.org, quic_c_gdjako@quicinc.com, "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , Sonny Rao , Sai Prakash Ranjan , Linux MMC List , Veerabhadrarao Badiganti , Rajat Jain , Saravana Kannan , Joel Fernandes , Andy Gross , Bartosz Golaszewski , Dan Williams , Geert Uytterhoeven , Heikki Krogerus , Randy Dunlap , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, Jun 22, 2021 at 10:46 AM John Garry wrote: > > On 22/06/2021 00:52, Douglas Anderson wrote: > > > > This patch attempts to put forward a proposal for enabling non-strict > > DMA on a device-by-device basis. The patch series requests non-strict > > DMA for the Qualcomm SDHCI controller as a first device to enable, > > getting a nice bump in performance with what's believed to be a very > > small drop in security / safety (see the patch for the full argument). > > > > As part of this patch series I am end up slightly cleaning up some of > > the interactions between the PCI subsystem and the IOMMU subsystem but > > I don't go all the way to fully remove all the tentacles. Specifically > > this patch series only concerns itself with a single aspect: strict > > vs. non-strict mode for the IOMMU. I'm hoping that this will be easier > > to talk about / reason about for more subsystems compared to overall > > deciding what it means for a device to be "external" or "untrusted". > > > > If something like this patch series ends up being landable, it will > > undoubtedly need coordination between many maintainers to land. I > > believe it's fully bisectable but later patches in the series > > definitely depend on earlier ones. Sorry for the long CC list. :( > > > > JFYI, In case to missed it, and I know it's not the same thing as you > want, above, but the following series will allow you to build the kernel > to default to lazy mode: > > https://lore.kernel.org/linux-iommu/1624016058-189713-1-git-send-email-john.garry@huawei.com/T/#m21bc07b9353b3ba85f2a40557645c2bcc13cbb3e > > So iommu.strict=0 would be no longer always required for arm64. Excellent! I'm never a fan of command line parameters as a replacement for Kconfig. They are great for debugging or for cases where the user of the kernel and the person compiling the kernel are not the same (like with off-the-shelf Linux distros) but aren't great for setting a default for embedded environments. I actually think that something like my patchset may be even more important atop yours. Do you agree? If the default is non-strict it could be extra important to be able to mark a certain device to be in "strict" mode. ...also, unfortunately I probably won't be able to use your patchest for my use case. I think we want the extra level of paranoia by default and really only want to allow non-strict mode for devices that we're really convinced are safe. -Doug