Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5908862rwd; Wed, 24 May 2023 08:18:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Xv9AI/dGsDCkoxOz5Xs2YDhG3U32mcNlVaSnp4VFwUocGOLmo/AzsbuT6zTgb/EaGr1ji X-Received: by 2002:a17:903:44c:b0:1ae:56ff:758 with SMTP id iw12-20020a170903044c00b001ae56ff0758mr18150329plb.19.1684941512874; Wed, 24 May 2023 08:18:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684941512; cv=none; d=google.com; s=arc-20160816; b=sp9fsLXAH/MqXf/Vp2myEjOKBa1XT3dJ+zVbEv6HWZdYw1Gxi/Yd0byN/MwfuVdoft szZ0DJ01jehZ2mNRHLASwFtL1GW+SnZTD2oucvm9ZLZ14HLwi6o8tKf2z0DTeKfKNBHc 9KrF3GA06Y3fS4mmDS9nufk/RnA2uGHj6KU9HfZO57HLgLte/NBJeeHUu+lWO5rgATqm njt8oXVi9UYZnOGjxALzHXa0t9O9hZ+DXZhk2vH9kTsOeKuKLZM8EhABiE38WtV+hrAp VUCL4Dq7H3kkTGBvsS9eVC4asJ2Mq9tShqAOIrQ7tRBNA+N5Ta4S5zfwbN4A4pQ+5zqh syoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=TayA8WSpgVOxv4l3A39hdm81BNFWb0qgOhCyuBIHzH8=; b=PR1YyXgMbC4XeiB/4wAm/fsBJhX8qlrs3/xE7kWrQMr1taOfMbeK3Tf4m1vc8qtxVL QwSf+D6Iio3HDM7RT5ZmZXk1IAOcFLvydJ3CPLOWFaDu1DEVIdisPAu4QqpJ9dinGXqK 8+w+0RcnNg+DM1FTr6BKPuKhtpND321rrkoCkM2VLyh1iLmO7HK4sU7e7CAiuRdAj+QC aTxGewVpGDQCvFYvb0pFBIJP/YG+e1N+OxxZtwgb6f7Te2o6j2hVDD9l3HGsk3+/jVYT B9w6xHvjxygq2yHjIdtMSbXF15yyh9+jQ8Bp2sXaykHVDYbmQ6zT+w/3g23U/zRVgQ6X 3xtw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d3-20020a170902cec300b001ae4a291a3asi3403160plg.24.2023.05.24.08.18.17; Wed, 24 May 2023 08:18:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236127AbjEXO6k (ORCPT + 99 others); Wed, 24 May 2023 10:58:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232726AbjEXO6j (ORCPT ); Wed, 24 May 2023 10:58:39 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B496C1B4 for ; Wed, 24 May 2023 07:57:56 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 09C3F1042; Wed, 24 May 2023 07:57:49 -0700 (PDT) Received: from [10.1.196.40] (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 139293F762; Wed, 24 May 2023 07:57:02 -0700 (PDT) Message-ID: Date: Wed, 24 May 2023 15:56:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v4] iommu: Optimise PCI SAC address trick Content-Language: en-GB To: Joerg Roedel Cc: will@kernel.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Linus Torvalds , Jakub Kicinski , John Garry References: From: Robin Murphy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/05/2023 5:06 pm, Joerg Roedel wrote: > On Fri, Apr 14, 2023 at 06:45:57PM +0100, Robin Murphy wrote: >> Sounds good - I'm considerably more confident in this approach, but although >> it should not be able to break any scenario which wasn't already broken, it >> could potentially still make such a breakage more noticeable. Thus in all >> honesty I'd feel happiest giving it a full cycle of -next coverage as well. > > I had some second thoughts on this, wouldn't it be better to change the > allocator to allocate from lowest addresses first? Then we can just > remove the SAC trick and rely on dma-masks only. > > Thoughts? Yes, in the long term I definitely would like to have a more flexible allocator - this is more of a stop-gap measure that's an easy win with what we have now. Top-down allocation is nice in that it makes for easily recognisable DMA addresses, and does do a great job of flushing out bugs, but having the option of bottom-up allocation would definitely be useful in various cases - realistically it's pretty much a prerequisite for converting arch/arm to use iommu-dma. However, given all the other scalability issues that keep coming to light, I think that's going to be the tipping point for ripping up the existing code and giving it a major overhaul, which I would love to be able to get stuck in to, but don't have the capacity for at the moment. Thanks, Robin.