Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4854494rdh; Wed, 29 Nov 2023 12:37:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IEtaq6AdCXEvSKCsjL7YPf6xU7qPR1DqgaGms2QfcL7pNfw2OSMdN5JR0j0KGwM09dGdv53 X-Received: by 2002:a17:90b:1c09:b0:285:a3f5:e258 with SMTP id oc9-20020a17090b1c0900b00285a3f5e258mr21536038pjb.22.1701290220209; Wed, 29 Nov 2023 12:37:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701290220; cv=none; d=google.com; s=arc-20160816; b=jYH7hSYd9RSGtuVd7dPgTgerJ7iV7f+HijPUAOW2+VX96PE+QeWDPAAtxuMxQfqf45 Etc7/zi4PqF7WZwyqt4pUHkOmvuFxNPF8rB/tXy+LRAZP8p1dHHwN7K4t4d4SZult59a hHRcv4srUvuvorLrDX1PN/D4Nl2nWcSkaWrYsyr9nCrEYaQIhxDlSHYXD8UArMzTCSbM 7sDJnm/7MuQe532Fi67miw3sogWgMFPFwY4eejQgebALa2cXd0aP1Hr88YA57S19IY++ 37azsie13GTm93pwV3LxHDKGD3RXvtku1jKXPl5SPJLxLbNE75PKFMwD6q+T8ZFZJYma wKxw== 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=SEEWYYfbaxLfYva0ae/C7ZnG1wW28/cSiuyFpLC5DM4=; fh=6tWgUIFJ7duv5X0bhqu3rfGsa66d7jCAOHHHXIXCUCc=; b=sBMH3SCElth5KFePD9h/f2uJyfbPJ8F7eieoGf6SqJr0I/liDfWkrTB6bFYmXqpUeK ssz1bTyoqQPU6l6JL8J392H3pzzya5HIie01iXhvYfjKZFH7ZHjsyzZ3zAfpNKUlWOiR fH7wMt7xu6UP2BnRxg3kDkAoem2X9IoFJn1MoghXzXj0uKIyXjneFR0hyN/PwoWX0FLg iZDXsTpcAwoU+a9ze3oVbQ9OThodGQkSlMidGA5ESWLBhZateujknUM2NxfAbDGDvj6E TNrV5JZahiCfuflr6HpuLcnAT3n9JFPJEAVDkKVUwpK2gxhiIZ41lfm9eH7I+uw61VMC JIWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=bzTFhvsx; 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 nu14-20020a17090b1b0e00b002859a10051fsi2074096pjb.136.2023.11.29.12.36.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 12:37:00 -0800 (PST) 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=@ziepe.ca header.s=google header.b=bzTFhvsx; 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 91F0D80B8F08; Wed, 29 Nov 2023 12:36:57 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234061AbjK2Ugk (ORCPT + 99 others); Wed, 29 Nov 2023 15:36:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233967AbjK2Ugi (ORCPT ); Wed, 29 Nov 2023 15:36:38 -0500 Received: from mail-oo1-xc2f.google.com (mail-oo1-xc2f.google.com [IPv6:2607:f8b0:4864:20::c2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72FAB10CE for ; Wed, 29 Nov 2023 12:36:44 -0800 (PST) Received: by mail-oo1-xc2f.google.com with SMTP id 006d021491bc7-58dc434442dso604393eaf.0 for ; Wed, 29 Nov 2023 12:36:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1701290204; x=1701895004; 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=SEEWYYfbaxLfYva0ae/C7ZnG1wW28/cSiuyFpLC5DM4=; b=bzTFhvsx7tgX8irz4bWPK02IEj84iIYed4ZhSta9GVEBkEXbfjM3fo795qNaVP85sp KZT+GDrHkxbEDOek2xxef8dQxSUdyZQYwV+lO4Ayqq9OE+ubjQXyt1+irJWIx8YvDXOW uIKBi5NC8OsSltJIrqqRi4Sc+/Gvh4QyuEVazrSly3/pAoyTDBeOtx2h+6fknd5BzBqc +RpsqNT08Zm+s1Wt3VYPb0+huS7q+FUQrbmTXhbqVVh8sXTD+9mPc47Qjqmim6V17Gl3 8i75eH0TiS2E5Mwb4Y65OdwP1hWT/ylM8y4LR5Jch1TrqV+iHJrIfWSCiTJCgXHUoSek CyWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701290204; x=1701895004; 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=SEEWYYfbaxLfYva0ae/C7ZnG1wW28/cSiuyFpLC5DM4=; b=J5GyV/iUX7vIjkr53MYQhxoIkLtrBupQMisoehQg8ABavb8eV5aYenYCFPLE++OPnC seFwnh6CGuyHtnCSshTM2L7OIxkpwNOde+6ID84lT6NcBDDpjb1zwXuFe5H6hOEd7icm 1+ukvOrmKCdaV4pXQMB44MQ0NRrfJB/UKQrn8NhA2NhAn9057a8sv9fpDtDvFv6JVITD cB6glZjbNxtxdrIw6IUB1heBb5+jx63VdBVmV81rRAiT+OdeTLFJcNv9J9zpXMPRMstm eeYuwU1CXZmdMSVkUSCAbFfrNuizGk74OaPTeKHzAhkThmkkhCgyY+gA3F0aqRYYq3dV cYfA== X-Gm-Message-State: AOJu0YxcY/ErejuwM2q+t47eUKrt9cIrJFsGD6P5W39ZBxVMzVNlq+ab orGPxuuTfcUyp57ARO/cCWkVLQ== X-Received: by 2002:a05:6871:3322:b0:1fa:29b7:f2a0 with SMTP id nf34-20020a056871332200b001fa29b7f2a0mr7173525oac.23.1701290203779; Wed, 29 Nov 2023 12:36:43 -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 z19-20020a056870515300b001efce0658e6sm3567983oak.39.2023.11.29.12.36.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 12:36:43 -0800 (PST) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1r8RIY-005pe4-9r; Wed, 29 Nov 2023 16:36:42 -0400 Date: Wed, 29 Nov 2023 16:36:42 -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 0/7] dma-mapping: Clean up arch_setup_dma_ops() Message-ID: <20231129203642.GO1312390@ziepe.ca> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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]); Wed, 29 Nov 2023 12:36:57 -0800 (PST) On Wed, Nov 29, 2023 at 05:42:57PM +0000, Robin Murphy wrote: > Hi all, > > Prompted by Jason's proposal[1], here's a first step towards truly > unpicking the dma_configure vs. IOMMU mess. As I commented before, we > have an awful lot of accumulated cruft and technical debt here making > things more complicated than they need to be, and we already have hacks > on top of hacks trying to work around it, so polishing those hacks even > further is really not a desirable direction of travel. And I do know > they're hacks, because I wrote most of them and still remember enough of > the context of the time ;) I quite like this, I was also looking at getting rid of those other parameters. I wanted to take smaller steps because it is all pretty hairy. One thing that still concerns me is if the FW data restricts the valid IOVA window that really should be reflected into the reserved ranges and not just dumped into the struct device for use by the DMA API. Or, perhaps, viof/iommufd should be using the struct device data to generate some additional reserved ranges? Either way, I would like to see the dma_iommu and the rest of the subsystem agree on what the valid IOVA ranges actually are. Jason