From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB413C433DB for ; Tue, 30 Mar 2021 13:21:14 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5662561994 for ; Tue, 30 Mar 2021 13:21:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5662561994 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=tExXt+TBeVBimInYnst3nqOjXnKUdLDxPPJRrwDLjiA=; b=nWNgO0eRMFta1YqnHCfVT4IO2 OSeuEELfatajITAHlrvi6kGsyf6yIjAKy+VNBmgO3AbfzT6ddVStCWun41aUOv5xQPUbWm1yp8oZE 88IGj8zulq2mHT6YH+pTkMXUtbm349DtN0GkQY+0t4FyHFHs8rTY3kzb4CHY3nWhAEann3+zQcIMb DoEEAJ0b+ycZk1IAobUpeBpMqJ3lYzUpEb6SxER6uKN5U71r8/Z66L2q7dU8b+Kg0XhO+UsQEhUbX q9f+OGbSojGpWSdR9T7CIV37O90pPkpyFrVAdPICwMA23gEHab3t0ViasmT7XZSqLAQ2P6tNf+q8K c8EAvB7qg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lREHi-003ow1-Jz; Tue, 30 Mar 2021 13:19:54 +0000 Received: from foss.arm.com ([217.140.110.172]) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lREHc-003ov4-VT for linux-arm-kernel@lists.infradead.org; Tue, 30 Mar 2021 13:19:51 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5560C31B; Tue, 30 Mar 2021 06:19:45 -0700 (PDT) Received: from [10.57.27.121] (unknown [10.57.27.121]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F11D03F694; Tue, 30 Mar 2021 06:19:42 -0700 (PDT) Subject: Re: [PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE To: Will Deacon , Christoph Hellwig Cc: Joerg Roedel , Li Yang , Michael Ellerman , David Woodhouse , Lu Baolu , linuxppc-dev@lists.ozlabs.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org References: <20210316153825.135976-1-hch@lst.de> <20210316153825.135976-17-hch@lst.de> <20210330131149.GP5908@willie-the-truck> From: Robin Murphy Message-ID: Date: Tue, 30 Mar 2021 14:19:38 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <20210330131149.GP5908@willie-the-truck> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210330_141949_394929_ABC4EE91 X-CRM114-Status: GOOD ( 22.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2021-03-30 14:11, Will Deacon wrote: > On Tue, Mar 16, 2021 at 04:38:22PM +0100, Christoph Hellwig wrote: >> From: Robin Murphy >> >> Instead make the global iommu_dma_strict paramete in iommu.c canonical by >> exporting helpers to get and set it and use those directly in the drivers. >> >> This make sure that the iommu.strict parameter also works for the AMD and >> Intel IOMMU drivers on x86. As those default to lazy flushing a new >> IOMMU_CMD_LINE_STRICT is used to turn the value into a tristate to >> represent the default if not overriden by an explicit parameter. >> >> Signed-off-by: Robin Murphy . >> [ported on top of the other iommu_attr changes and added a few small >> missing bits] >> Signed-off-by: Christoph Hellwig >> --- >> drivers/iommu/amd/iommu.c | 23 +------- >> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 50 +--------------- >> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 1 - >> drivers/iommu/arm/arm-smmu/arm-smmu.c | 27 +-------- >> drivers/iommu/dma-iommu.c | 9 +-- >> drivers/iommu/intel/iommu.c | 64 ++++----------------- >> drivers/iommu/iommu.c | 27 ++++++--- >> include/linux/iommu.h | 4 +- >> 8 files changed, 40 insertions(+), 165 deletions(-) > > I really like this cleanup, but I can't help wonder if it's going in the > wrong direction. With SoCs often having multiple IOMMU instances and a > distinction between "trusted" and "untrusted" devices, then having the > flush-queue enabled on a per-IOMMU or per-domain basis doesn't sound > unreasonable to me, but this change makes it a global property. The intent here was just to streamline the existing behaviour of stuffing a global property into a domain attribute then pulling it out again in the illusion that it was in any way per-domain. We're still checking dev_is_untrusted() before making an actual decision, and it's not like we can't add more factors at that point if we want to. > For example, see the recent patch from Lu Baolu: > > https://lore.kernel.org/r/20210225061454.2864009-1-baolu.lu@linux.intel.com Erm, this patch is based on that one, it's right there in the context :/ Thanks, Robin. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel