Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp224611pxv; Thu, 24 Jun 2021 06:39:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzN9rIx13BTcqyYSFVX69lYfVE6R898ek8GnOGEds6y/xoKw8F+l9RwLfiaxDrfu2TNYX2V X-Received: by 2002:a92:7d07:: with SMTP id y7mr3692110ilc.68.1624541952665; Thu, 24 Jun 2021 06:39:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624541952; cv=none; d=google.com; s=arc-20160816; b=lUZuH0Li8wcbvpHf9Bdu8ZRH5DebBasqLELo1MeURfdL7rkVzq/kQBA82nY/SSx8aJ rOCXw7Lrs/iEzSethStFX+sQ1ac5rgyAm6qoA/y1EF6TUb5Nx6Cpmm9pqtPt6NAYy8B+ rweC2l9ozvF6VNxE8JavA/d7J0ni/UuIrjUZNbOl+J6/iwOZCrtXl2CUZJGZS6qHGTU4 efQLtHe4l4JhdRtN54i1ob7YdlAb4qlmg+sFrWmWqbiBmhhEgxt/NLlWKy75UGwyfexU P4JtHhd2Sk0n0JPNi+QupAjcxlTCHBKjAU3g+Ut8DHuhtpiGOS0EbRIY8emtf8FTmx9b 7CQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ROuP9hrjamk7QbikENi+4AopPCg66+Z7xIipVuxlP2M=; b=CxoHs6MOA2LQfTuF6TTIQs4ujjSnzASOVwOUa9INF4yQcdVfifo38YsIu+raQou3HI CfobQnczbaWuLlpcgvPAf7Q7n7pVn30/+Robf+IXsQYfCcMJ0pGIrIVpcJwMUZ5Z2sQG Gi7mTz3V6LhfJF1t72cqrg0WyeXfaflLBtcpLht03eFfz8dyyZ6otSoeEwRSoPxKR8T/ Xj4gt6uXIyoaqfcZSB9beGqypgIV+ZkNLs9avr9fySIFcwngSZNTDZ04nmBnJ9umNFYf 2diUb+NlmQAToIlfz3kDZylGQuyva6IAeYC5ozkkKhf9blQvgGDuuFuMgCg4DwdjXu5v cZWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Zgrt8sAO; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z12si2896571iow.31.2021.06.24.06.38.58; Thu, 24 Jun 2021 06:39:12 -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=@linuxfoundation.org header.s=korg header.b=Zgrt8sAO; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231179AbhFXNkl (ORCPT + 99 others); Thu, 24 Jun 2021 09:40:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:59912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229878AbhFXNkk (ORCPT ); Thu, 24 Jun 2021 09:40:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3923361002; Thu, 24 Jun 2021 13:38:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624541900; bh=+IAFywe/fQNi3yGadTzdfNAMDo97W+pVUgJlXiEOuT8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Zgrt8sAOUKv4aq0TAmi/6ugV5pAIMt9nN5X2GqMqbVzBs0rIDqvfl9v3Rw1sNMKsl cRDDLduiEb/vFKo2y+shFY6Vy4cmO6ixmrSknVR0tUeE958MWQGMl6xMx87iTN1jxp Om9wOnn1JosUsE5Xd3Ttb53ewALmoSYK+bzQ7qmc= Date: Thu, 24 Jun 2021 15:38:18 +0200 From: Greg KH To: Douglas Anderson Cc: rafael@kernel.org, rafael.j.wysocki@intel.com, will@kernel.org, robin.murphy@arm.com, joro@8bytes.org, bjorn.andersson@linaro.org, ulf.hansson@linaro.org, adrian.hunter@intel.com, bhelgaas@google.com, robdclark@chromium.org, linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, quic_c_gdjako@quicinc.com, iommu@lists.linux-foundation.org, sonnyrao@chromium.org, saiprakash.ranjan@codeaurora.org, linux-mmc@vger.kernel.org, vbadigan@codeaurora.org, rajatja@google.com, saravanak@google.com, joel@joelfernandes.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/6] PCI: Indicate that we want to force strict DMA for untrusted devices Message-ID: References: <20210621235248.2521620-1-dianders@chromium.org> <20210621165230.3.I7accc008905590bb2b46f40f91a4aeda5b378007@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210621165230.3.I7accc008905590bb2b46f40f91a4aeda5b378007@changeid> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 21, 2021 at 04:52:45PM -0700, Douglas Anderson wrote: > At the moment the generic IOMMU framework reaches into the PCIe device > to check the "untrusted" state and uses this information to figure out > if it should be running the IOMMU in strict or non-strict mode. Let's > instead set the new boolean in "struct device" to indicate when we > want forced strictness. > > NOTE: we still continue to set the "untrusted" bit in PCIe since that > apparently is used for more than just IOMMU strictness. It probably > makes sense for a later patchset to clarify all of the other needs we > have for "untrusted" PCIe devices (perhaps add more booleans into the > "struct device") so we can fully eliminate the need for the IOMMU > framework to reach into a PCIe device. It feels like the iommu code should not be messing with pci devices at all, please don't do this. Why does this matter? Why wouldn't a pci device use "strict" iommu at all times? What happens if it does not? Why are PCI devices special? greg k-h