Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4857224rdh; Wed, 29 Nov 2023 12:43:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IEiUY2VA3ihGNVdWo+ecaq/AB8/1fg/YzQJQkeNXpTwGbeHPhUl/TbgIpljCYOVFxiwCFfJ X-Received: by 2002:a05:6a00:2d86:b0:6cd:daa5:138e with SMTP id fb6-20020a056a002d8600b006cddaa5138emr3172638pfb.3.1701290610304; Wed, 29 Nov 2023 12:43:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701290610; cv=none; d=google.com; s=arc-20160816; b=KiERHJrso01uIvmZ1W8cQCbVUGXmLDgVYzufUWD8EDuIRkEHSeJ+sU/8NV6skbFnsy tTiZ2mY/CdL/Vpch+cVVdvDVy0tgp2rPcq5Q4j8wWsMasx4HNxuLtvP/MrXAbPhLvIzG evYdXJy7LUnfh4vMDZvOcLmAuPQu4HLKxO8FH7LwAvr0qnSCNyNmopm3P4tt6CMZDYd8 J20sGeM5h8su9s8QL28yyjELr2zf37OuqJwLtQUpKwnW91u3WQNS8kDLWGo4Kb8CE8gU vCXkEacCcKxEXoGyPIXLpQtLhn1V+O2W7G4oax3JPhVOygw8bAhHPDZq28dshlaNW/OW 6YWg== 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=VQkQZtrQbpqMHU38TIDcUDo5JEq87aQQf1MaJK/f8fE=; fh=6tWgUIFJ7duv5X0bhqu3rfGsa66d7jCAOHHHXIXCUCc=; b=zHwEeIDr4mNErYC5PueDIRW57USX4fzxxKiVxPw+IYv/eM3ZGR10HXMzCzVTa+Oq8W E1kxyrAY7Bx0gvAKpjXiIaimWO1q0MrlNnjUDIiHEmFPL+/57LgIrKpzCYz1w3j0TWeT deYnCtFwBvhybaBd8lS50J2O48FSMODIYMfW9WuwFa26Q9akjRVOHc6XANVL5qZzBdPf IY9k9SmECOh383TsuD2W+IpXd4qi2ybDlcgHclRRIeBH/xYR7sBlYeXyqOzwoEFziEQO ZRJDXVXjun7VmtZJWNoJu4MZBAN01gOu6EVAlOJgHU0BJ7oJLlDzNN/O1FvaQd14E8ho +10A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=ltifotaq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id z62-20020a636541000000b005b9b68add9asi11953507pgb.255.2023.11.29.12.43.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 12:43:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=ltifotaq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 1B3818084627; Wed, 29 Nov 2023 12:43:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234017AbjK2UnO (ORCPT + 99 others); Wed, 29 Nov 2023 15:43:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231549AbjK2UnM (ORCPT ); Wed, 29 Nov 2023 15:43:12 -0500 Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D44ADD69 for ; Wed, 29 Nov 2023 12:43:18 -0800 (PST) Received: by mail-oi1-x232.google.com with SMTP id 5614622812f47-3b863ec1732so612778b6e.0 for ; Wed, 29 Nov 2023 12:43:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1701290598; x=1701895398; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=VQkQZtrQbpqMHU38TIDcUDo5JEq87aQQf1MaJK/f8fE=; b=ltifotaqj3/qFSSn/66l9ZkFHFqhkX08GSxbRrcI48S2PHdWUJbMfSf0gP/VArX6Of 7uOwFjZPGVkdbMgzmqWdvNEFl2u94GDlaphr6YropQ+uAU3bu5h5Y4qrlWbwi6gAAyE1 Ct2P3T87QM76nx+3djrsF0nrht0kKQCN6vmUzjosiGaWfjrPm5o3hcwGhdH3Penmb1wo JyY/sLWAgn5pxuuLL4nimT8jl7vqN7J7gSVGiuMSjocusTrWiYuAiCuw1ytfhrBqX/ZI 4LkBv5yhoAXQlHOpZfGkDo2XkbxW+bIBwNCOwoSuKFGbd7DLM/zgXDvP0ZulnDTGo6Ox CYyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701290598; x=1701895398; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=VQkQZtrQbpqMHU38TIDcUDo5JEq87aQQf1MaJK/f8fE=; b=VzfEN7Eute6PlpAuNravhsVhChiRGz057uRSR3NPRLhvO981YIminGa+jnD51t6UeG 9FE3pxObhjsUk8XTCfClGRCn4FH63FuKzi9fDkvRWL2yH3LUBEuE4V6qdSV+IOQ6mhLg sJzDdaA9DXWRTRJ2iCe2KsdFP0SZn1rT2//rin2D8dauS2QhJQ0OA3tdcIeuqD2ADSxC v5JYggdAXQxIeQNd9B1St6OSCbpefhVDQLwAWy8d6MjfPsvw6iKCf3oSKolTOkGqY/a2 tSs9RqT6hHIu0KnAxOWieFhgeLD1vh6ZNr1QoPX2DKjmtJQZDPwuQSUiztuq1TD04Njs 1ekg== X-Gm-Message-State: AOJu0YxZzFAQ7+0Yvs2Ob/+UOj6fCtNmNtN1v2R8QJKST92swrf060Xu +H232uzRveWgxAVLA6Ftqq6H7w== X-Received: by 2002:a05:6808:152b:b0:3b8:3399:84bf with SMTP id u43-20020a056808152b00b003b8339984bfmr11564700oiw.15.1701290598186; Wed, 29 Nov 2023 12:43:18 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-134-23-187.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.134.23.187]) by smtp.gmail.com with ESMTPSA id bd33-20020a056808222100b003af644e6e81sm1782211oib.45.2023.11.29.12.43.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 12:43:17 -0800 (PST) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1r8ROv-005pgb-4k; Wed, 29 Nov 2023 16:43:17 -0400 Date: Wed, 29 Nov 2023 16:43:17 -0400 From: Jason Gunthorpe To: Robin Murphy Cc: Joerg Roedel , Christoph Hellwig , Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Paul Walmsley , Palmer Dabbelt , Albert Ou , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Suravee Suthikulpanit , David Woodhouse , Lu Baolu , Niklas Schnelle , Matthew Rosato , Gerald Schaefer , Jean-Philippe Brucker , Rob Herring , Frank Rowand , Marek Szyprowski , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org Subject: Re: [PATCH 5/7] iommu/dma: Make limit checks self-contained Message-ID: <20231129204317.GQ1312390@ziepe.ca> References: <951f52b59b401418a7ccc00beed15632d1aabd7a.1701268753.git.robin.murphy@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <951f52b59b401418a7ccc00beed15632d1aabd7a.1701268753.git.robin.murphy@arm.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 29 Nov 2023 12:43:28 -0800 (PST) On Wed, Nov 29, 2023 at 05:43:02PM +0000, Robin Murphy wrote: > It's now easy to retrieve the device's DMA limits if we want to check > them against the domain aperture, so do that ourselves instead of > relying on them being passed through the callchain. > > Signed-off-by: Robin Murphy > --- > drivers/iommu/dma-iommu.c | 18 ++++++++---------- > 1 file changed, 8 insertions(+), 10 deletions(-) When I spent some time noodling on this a few weeks ago I was looking at putting the dma_range_map_min() effectively as a new reserved region in the common reserved region code so it naturally flows out to all the right places. But this is no worse in that regard than what we have right now: Reviewed-by: Jason Gunthorpe > /* Check the domain allows at least some access to the device... */ > - if (domain->geometry.force_aperture) { > + if (map) { Oh, I've been sitting on a patch to delete force_aperture now too.. Jason