Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp267487pxb; Mon, 16 Aug 2021 05:11:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyndgqAvHTwyQ+ZLqnLbNtnwDh/gM86WMxUniXdb9IBf4+Wg55B6gQkwW3wC2R0cuDX9tvJ X-Received: by 2002:a17:906:95c9:: with SMTP id n9mr5869758ejy.178.1629115871077; Mon, 16 Aug 2021 05:11:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629115871; cv=none; d=google.com; s=arc-20160816; b=JVl/nKACjp5abG+YhTlyWfez/HB1zpCpPDzWDT3EjBkGzDMpIjvqE+otuXbtiTu3u8 Ud2rFL6ZNgb5D2YigqeG+34yYf4+oHc7/B2500YJCHBAszoR8ONxeOslRQmIrxCDcBuM 5heLrIpkjGCAc40gzBw8I9WOUh4eOsuwHQUvR1tJgQKD54o0sDMPJgiE2QeR6p+ogZ0g ODGwJIvSs+p9x4TVHxbezkIfJm9QRo0O02k+v20aO7IKB0hlS0+cF1RIiDsgkt7iAWYY lpxqE5FRZqfZxXs3Q93UyHDVmbjeKe7SISACrdZwLZnoKinaYWAi2LblBoKbig0pijM6 UknA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=mVIG8+W4k0ETeKyaUd45jYIBKiaDupSKyE0n7WzO47g=; b=tWaujmPq0nNUD163JDzMJbcllsGyKB/xS+JSXt/lqb90+w4XgUD43SaKXcKfftGFV8 UFizmFKUObfsbRgf9eprCAPcvi1YEitqmAhnbQktoLfcz2yAEKXVueYokTETM9Q/kDgI GKSJkBZ1IUl0qIkxF1vGoJAfS4J2vvekhtsnxzLagtNjrQLANobtdoRCktMe1nRvRQfp KL90fUPKVANc+9tBbII+OBvQ23iIXKthUWrfBOJhtn7YP6/FL09Y2NDe/wGI1PqnAEAE zShq+nEpKyYrNw/HvV7Ab4bKKlAaLo6y8Lua01n/k1/jqItsyTaClNSJsrgeS6PlT2HL AB5w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b6si11380960edu.126.2021.08.16.05.10.47; Mon, 16 Aug 2021 05:11:11 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233499AbhHPMJK (ORCPT + 99 others); Mon, 16 Aug 2021 08:09:10 -0400 Received: from verein.lst.de ([213.95.11.211]:54155 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230216AbhHPMJJ (ORCPT ); Mon, 16 Aug 2021 08:09:09 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 979966736F; Mon, 16 Aug 2021 14:08:36 +0200 (CEST) Date: Mon, 16 Aug 2021 14:08:36 +0200 From: Christoph Hellwig To: David Stevens Cc: Robin Murphy , Christoph Hellwig , Joerg Roedel , Will Deacon , Lu Baolu , Tom Murphy , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 5/7] dma-iommu: Check CONFIG_SWIOTLB more broadly Message-ID: <20210816120836.GD15860@lst.de> References: <20210816025755.2906695-1-stevensd@google.com> <20210816025755.2906695-6-stevensd@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210816025755.2906695-6-stevensd@google.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > - if (IS_ENABLED(CONFIG_SWIOTLB) && dev_is_untrusted(dev) && > + if (IS_ENABLED(CONFIG_SWIOTLB) && dev_use_swiotlb(dev) && > iova_offset(iovad, phys | size)) { This can drop the explicit CONFIG_SWIOTLB check now (and make the remaining conditional fit onto a single line).