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=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 F305DC4338F for ; Mon, 9 Aug 2021 12:51:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 8D0FE60E93 for ; Mon, 9 Aug 2021 12:51:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8D0FE60E93 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pSgHtkYlWq4t6nwrIZU5tbk61yyhXdqMC6u2DTUbfvc=; b=zu+WUJxaJ8FvdY Rpq5gTkHn8lhuweH1JSmSPKfnDwLsEa0f5W35dEacw7WwHdiCzg2Rx36oHeEcz4fOohMgdnCm4Wr2 FV/SmZz/OQU8GU39BEexX9eTFsHG0g1TcwtGg24Isve1pBV/oEei/tdXQ4ABL6N2kIp6gvCit+cch yp2lIBuzsYpp0v2u30eo2ULl0XIHKotk6hILRjSJ0RfODWLL/w5bbtngJpHXgmHvuIoCXJD3aCMM3 tvSbc7g7jDwZPXTfyaa1BRzKklPHW84/zNm572EfO6xJ91vnS0Ks1OA7zkHZ7o/tOnO9sb8c8ZrU+ XUlwleSUhvgxhfCBS6uw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mD4iw-000d9x-Iy; Mon, 09 Aug 2021 12:49:46 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mD4io-000d8M-5T for linux-arm-kernel@lists.infradead.org; Mon, 09 Aug 2021 12:49:39 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6B53160FE3; Mon, 9 Aug 2021 12:49:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628513377; bh=DuWuffUzHWTlh5RyIppkfZJMBWUzwes3xWNKxmTLe/0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jk+7pKgZ+88oYQV9NkXW4+7DYuSYjjTwrgQJpOrttxXIl5tKNVCJEgrkyQdFPhMBz f+hMsHunXnbXXesw+l55zR366ZFmUEFCU46XuqwsX9p51Orqm4/orNB9V6uk/Qf427 M8lkagHV1KbxaWYI5iHUprg2PxaP5mEWPsbx4edZ51DKNkwnlvb24ksb39kRyXaIUh R4mSwsA0e80ppbX3SHwNrX0m85MhDas0fjY1UT3lTv39wJhvOa8g5cqTbMM2vtoEbn CNkDkUHMlk+b6ei3yicYLMvxr7anZ9IQoNRNMXm/AvyXMBtyTtb5tMvU3WkqdmVQv3 Yh+XgBvSP2Q1A== Date: Mon, 9 Aug 2021 13:49:32 +0100 From: Will Deacon To: Robin Murphy Cc: joro@8bytes.org, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, suravee.suthikulpanit@amd.com, baolu.lu@linux.intel.com, john.garry@huawei.com, dianders@chromium.org, rajatja@google.com, chenxiang66@hisilicon.com, Sai Praneeth Prakhya Subject: Re: [PATCH v3 25/25] iommu: Allow enabling non-strict mode dynamically Message-ID: <20210809124931.GA1097@willie-the-truck> References: <22b044263f69e2bfe404c4379a435005ea58b3e2.1628094601.git.robin.murphy@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <22b044263f69e2bfe404c4379a435005ea58b3e2.1628094601.git.robin.murphy@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210809_054938_280160_78D21CF4 X-CRM114-Status: GOOD ( 18.45 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Aug 04, 2021 at 06:15:53PM +0100, Robin Murphy wrote: > Allocating and enabling a flush queue is in fact something we can > reasonably do while a DMA domain is active, without having to rebuild it > from scratch. Thus we can allow a strict -> non-strict transition from > sysfs without requiring to unbind the device's driver, which is of > particular interest to users who want to make selective relaxations to > critical devices like the one serving their root filesystem. > > Disabling and draining a queue also seems technically possible to > achieve without rebuilding the whole domain, but would certainly be more > involved. Furthermore there's not such a clear use-case for tightening > up security *after* the device may already have done whatever it is that > you don't trust it not to do, so we only consider the relaxation case. > > CC: Sai Praneeth Prakhya > Signed-off-by: Robin Murphy > > --- > > v3: Actually think about concurrency, rework most of the fq data > accesses to be (hopefully) safe and comment it all > --- > drivers/iommu/dma-iommu.c | 25 ++++++++++++++++++------- > drivers/iommu/iommu.c | 16 ++++++++++++---- > drivers/iommu/iova.c | 9 ++++++--- > 3 files changed, 36 insertions(+), 14 deletions(-) I failed to break this, so hopefully you've caught everything now. Only thing I wasn't sure of is why we still need the smp_wmb() in init_iova_flush_queue(). Can we remove it now that we have one before assigning into the cookie? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel