Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp494045iob; Wed, 18 May 2022 06:45:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNz0yIQ76+kmNtrjD6e4PRtu1IfMJK2AFwJ+K54K+MpIY94AwMzmOP8a2U3NTQ1BambEAB X-Received: by 2002:a17:902:6b0b:b0:156:4ab0:3ddc with SMTP id o11-20020a1709026b0b00b001564ab03ddcmr26603801plk.22.1652881529300; Wed, 18 May 2022 06:45:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652881529; cv=none; d=google.com; s=arc-20160816; b=c5Z3dp7fqD10/mzKBxj1b+M6SlDXMGeuBa8GiT3PfGD1J9uFI3juDBml67it5iO1ar BhQ6ECvKmJ99J1VIZA+tYozM2mnb6rzoavTqccVNq0K4IhR/oiwbWZhA5i+u54OAFo0u nJgaBtgIytkWynSf1npQV/7aa7yL/avsaimqRlbe3LjRZONIsH/P88cciyOJvaQ7tWK/ IsXxF8tupdLIYAKw9liOBWtLITdbwezfoQgQoxjggpzls8NyKg6FpwGRwFqs4dhBfNSR YHpfErGJDi4bnjDIS3018CUYJWDR8LNoHnDSUZLPGnK4x6zfYa77ya78F3apkxIkvOhU bH+g== 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=pIkrB8lZAKJaX9aX3kbgGJh0CBt3S7Sv4OCx8M049yo=; b=TP58ee+lPRnbyl86y/Fan++D5O0q9hpGUY7aQf6+SesGCdlJiT5GTCX8Ws0IWWJTJf ozR7bhn0Tf6m9e/qFvv4V54vHD48rz24J/akBr7MbaqBcClf6z6xM/06hEjp93Cd5OKy obdJB3i9Ljd/6xww2cr6MuVcD4Hsjqu5K39+6YV6n3vLtexv3rS5JtpYU00wxyYj3ML2 1P9tBuFWBJXlUww4BflyJ0j6fMySKaClMdp+8oBO4+UiX5pw6CdO/LJudctCyOIfApl4 v2/YK3W4U/jr1h8CT3H365aeNqXVVLF4fmW58IC076MdjzTUZl+BihEVzV9/zumSGFlJ eQ9A== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id b7-20020a655cc7000000b003f5f2f73434si2344121pgt.550.2022.05.18.06.45.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 06:45:29 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 039BF1BF18D; Wed, 18 May 2022 06:45:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238121AbiERNpT (ORCPT + 99 others); Wed, 18 May 2022 09:45:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238076AbiERNpQ (ORCPT ); Wed, 18 May 2022 09:45:16 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 38330261D for ; Wed, 18 May 2022 06:45:15 -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 C350923A; Wed, 18 May 2022 06:45:14 -0700 (PDT) Received: from [10.57.82.55] (unknown [10.57.82.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3EB493F73D; Wed, 18 May 2022 06:45:13 -0700 (PDT) Message-ID: Date: Wed, 18 May 2022 14:45:07 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [RFC PATCH] dma-iommu: Add iommu_dma_max_mapping_size() Content-Language: en-GB To: Christoph Hellwig Cc: John Garry , joro@8bytes.org, will@kernel.org, m.szyprowski@samsung.com, chenxiang66@hisilicon.com, thunder.leizhen@huawei.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, liyihang6@hisilicon.com References: <1652706361-92557-1-git-send-email-john.garry@huawei.com> <20220518131237.GA26019@lst.de> From: Robin Murphy In-Reply-To: <20220518131237.GA26019@lst.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-05-18 14:12, Christoph Hellwig wrote: > On Tue, May 17, 2022 at 11:40:52AM +0100, Robin Murphy wrote: >> Indeed, sorry but NAK for this being nonsense. As I've said at least once >> before, if the unnecessary SAC address allocation attempt slows down your >> workload, make it not do that in the first place. If you don't like the >> existing command-line parameter then fine, there are plenty of other >> options, it just needs to be done in a way that doesn't break x86 systems >> with dodgy firmware, as my first attempt turned out to. > > What broke x86? See the thread at [1] (and in case of curiosity the other IVRS patches I refer to therein were at [2]). Basically, undescribed limitations lead to DMA address truncation once iommu-dma starts allocating from what it thinks is the full usable IOVA range. Your typical desktop PC is unlikely to have enough concurrent DMA-mapped memory to overflow the 32-bit IOVA space naturally, so this has probably been hiding an untold multitude of sins over the years. Robin. [1] https://lore.kernel.org/linux-iommu/e583fc6dd1fb4ffc90310ff4372ee776f9cc7a3c.1594207679.git.robin.murphy@arm.com/ [2] https://lore.kernel.org/linux-iommu/20200605145655.13639-1-sebott@amazon.de/