Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp960363rdh; Thu, 26 Oct 2023 23:57:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEWwWAlUALRPnVAW8Oxu9G85/MhOJ6tcvhicVjo/EsAP0Cl9nUZocNCmD58PgHy+gxZnWsn X-Received: by 2002:a05:690c:fd5:b0:5a8:1d18:a1a with SMTP id dg21-20020a05690c0fd500b005a81d180a1amr4575678ywb.4.1698389873317; Thu, 26 Oct 2023 23:57:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698389873; cv=none; d=google.com; s=arc-20160816; b=urUTF4acg6hsKB+xaaxFMIqYGXbK7fkY7Y6Urv9CfteZftvp0Z8Lvp75otIu67ABoz o+lBbX7NyOSevSfpPYdViz85ENX+OkHeE6hB/GVioSmFu0gC1QG3PLDdcCNOrqhrf7ZS MOXodvMWNe2fnjqm294d1cgebQXrMwAbHB+ZHWRHTJ5PO0CInAugilQJXpKRLtMMTRXd JCNTmUyn4VXidUeMH+RmKKnSZHgBFHF/RIO9ASCuJ1OiMTmN4LAI4ztuZKas20dN7kNh Du6XrQgxuxXF1VpbvWlDDRX6TwM+UwdNllXJW8uTYKZIYN5pAUKDXRVMizvuMXYgv6q/ 8oPA== 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=do4+Bg3OXd61EwmFjaEEIPXB9sYeY7kbp+B6x8k//r8=; fh=Bs5S3VhQ+XASZUU0FE2siKcBxWUYAJZb8qY9vNekVPg=; b=HFo4wtDZ2f7MzwT3erKah3FME8s6RKMoMEq1E1ChiZp4YAxjTl8UCvKeoccqa1e/Yi KW/khOEQkA3JLel5iGfYAWevf/Ry9dKLaktpmgMncjs5Mke548Z7s+SyQwihTAds3aqu AqXGX8avebVIey5iZCx9yxsxFVXwWrKmnc1a5lRFWrpSvWsqKKeVKV94UNtvsqjcsDux PlCN4txPRbxIE046TB7EWbz5WowZ5Kr653jfewBSZjltE8X1x9VAMdpe1gnu5wMXIwjq TWwA/G4RW9pxr5c8D+/gKqNb82UwhNfVTv+y8J7OBLOtlCpVUDzC+O7RqgO/9dKAyOKY K4UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@8bytes.org header.s=default header.b=gMHFZFCP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id z16-20020a81a250000000b005a7b918c656si1497869ywg.168.2023.10.26.23.57.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 23:57:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@8bytes.org header.s=default header.b=gMHFZFCP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id C29CF833E16A; Thu, 26 Oct 2023 23:57:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345293AbjJ0G5o (ORCPT + 99 others); Fri, 27 Oct 2023 02:57:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235015AbjJ0G5m (ORCPT ); Fri, 27 Oct 2023 02:57:42 -0400 Received: from mail.8bytes.org (mail.8bytes.org [IPv6:2a01:238:42d9:3f00:e505:6202:4f0c:f051]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 091C61BD for ; Thu, 26 Oct 2023 23:57:38 -0700 (PDT) Received: from 8bytes.org (p4ffe149c.dip0.t-ipconnect.de [79.254.20.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.8bytes.org (Postfix) with ESMTPSA id 52EF41A4E27; Fri, 27 Oct 2023 08:57:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=8bytes.org; s=default; t=1698389857; bh=tsFzkWcWhsxpfd/M+Xd0Blp+9KhEvDyR0wnVjhOfiS8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gMHFZFCPVlWNbE4xV4sa7KNNp3Ep7Fmv4vo9izUuFGJVhk4VMkS1kUsRmZW5lfan0 P3dMgTxGv77hqVscNpEwk9MueoVG8vycfFfiJmTYOImxhmjk0827UCumx6t5kRbLLF 0E4Pu4Nt9rMyNuJR5ZxOx8z7KriwteojmZc/ONE0HqC0935r6RYcHsiLRDeBrkzv44 jTvpNVWCkkx7cIk6SY/BcRk+0fSOCuhYrUq080oCzumVc9FyUG1shmAVRqU+2drqqQ iP6sYXIKKP3vG5BDIzPVR/ZI0ZBfKH0ByAblIwkZkSTSZzBvYj/R+VDLgS5yKxgGQ1 Cy1JjwCoAACwg== Date: Fri, 27 Oct 2023 08:57:36 +0200 From: Joerg Roedel To: Lu Baolu Cc: Will Deacon , Robin Murphy , Jason Gunthorpe , Kevin Tian , iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] iommu: Avoid unnecessary cache invalidations Message-ID: References: <20231026084942.17387-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231026084942.17387-1-baolu.lu@linux.intel.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 26 Oct 2023 23:57:50 -0700 (PDT) On Thu, Oct 26, 2023 at 04:49:42PM +0800, Lu Baolu wrote: > The iommu_create_device_direct_mappings() only needs to flush the caches > when the mappings are changed in the affected domain. This is not true > for non-DMA domains, or for devices attached to the domain that have no > reserved regions. To avoid unnecessary cache invalidations, add a check > before iommu_flush_iotlb_all(). > > Fixes: a48ce36e2786 ("iommu: Prevent RESV_DIRECT devices from blocking domains") > Signed-off-by: Lu Baolu > --- > drivers/iommu/iommu.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Applied, thanks.