Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4187470rdh; Tue, 28 Nov 2023 14:34:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IGRuoAQcsI5Pj/nPE/nn/VHeHzy68z2SQjPgobir516Ni587puchJ1ItICrw79QClU6YESx X-Received: by 2002:a05:6a20:9385:b0:18c:19ab:d2e5 with SMTP id x5-20020a056a20938500b0018c19abd2e5mr15967206pzh.33.1701210858379; Tue, 28 Nov 2023 14:34:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701210858; cv=none; d=google.com; s=arc-20160816; b=wonGgrK3M0nX8A39KR9ge5p5fgSHR1GXbUW0wzZV6GnaldNirfR7REIHbtOsP8REtz lwuTmBYAmNYnc2woX/b8PHB94g/rO6iAtOUCGWAR+/S2v4EDpDbUjrgfmGEQxQ9xc9vW 6Q3SIOpojz7cG9cJ1GSZRbIEBJl6x31KksUAD9cozB43a/GgGAZso76iAo3c/0M/lLC+ yLQrln9U7bMl4eg0RqgJVI1LV+ZYln4rAaYBpjGUx+sZUezvELcBIAog8u6hAxqbJ3u1 9pNMrib/OwTod4SMxTNnK8coyzq2FUg1YIbPfFHGppyiu1LsyXXLJqjItZ/hZpZyOocy T8Hw== 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 :content-language:references:to:subject:user-agent:mime-version:date :message-id; bh=05MQrSEiJJ4PwIrUIYIoHAAbIyjUh5yerDu/CuNJjIM=; fh=JhH8qmlLmIRuoHxvxnNPs57gQG85foZWfXtCPHbVvj4=; b=XsJqK+F4/T7OsCAP7Z3kLfLiLeGWb6uGBS7IKK/DdUxpJFRa/tumpv5U8b9U0CBkJm vozW7kCL4izmCluJuakPv6NFadNabNLd+seq540rPN3r9AmjBEIMPUAZZ24Oc7eC5f6k Ah/vOmFbDsAXfV+dUxxVLODf6GYP52reHW1HcUsRmT37TiVh7HxzucUTRSLYTu3MWNTU /JhZN4gRXtLy3x8J1RbXVHtJWoJ6kZmJEmxOd3Xx7WW3fsvTnDCRUKjj1cilnG9u2wkq iWYISzI6Cwj1NT4ud8g8h4lSxY7IbH6qIERogDzXf6AzeO80FlXXn1BvgfAlhqnUuSn2 asmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id h13-20020a63df4d000000b005777bea0b6asi13330869pgj.859.2023.11.28.14.34.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 14:34:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7EE6280BD27B; Tue, 28 Nov 2023 14:34:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229656AbjK1Wd5 (ORCPT + 99 others); Tue, 28 Nov 2023 17:33:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229670AbjK1Wd4 (ORCPT ); Tue, 28 Nov 2023 17:33:56 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BFEF219A4; Tue, 28 Nov 2023 14:34:01 -0800 (PST) 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 B808B1FB; Tue, 28 Nov 2023 14:34:48 -0800 (PST) Received: from [10.57.71.132] (unknown [10.57.71.132]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E2B473F6C4; Tue, 28 Nov 2023 14:33:44 -0800 (PST) Message-ID: Date: Tue, 28 Nov 2023 22:33:42 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 06/16] iommu/dma: use page allocation function provided by iommu-pages.h To: Pasha Tatashin , akpm@linux-foundation.org, alex.williamson@redhat.com, alim.akhtar@samsung.com, alyssa@rosenzweig.io, asahi@lists.linux.dev, baolu.lu@linux.intel.com, bhelgaas@google.com, cgroups@vger.kernel.org, corbet@lwn.net, david@redhat.com, dwmw2@infradead.org, hannes@cmpxchg.org, heiko@sntech.de, iommu@lists.linux.dev, jasowang@redhat.com, jernej.skrabec@gmail.com, jgg@ziepe.ca, jonathanh@nvidia.com, joro@8bytes.org, kevin.tian@intel.com, krzysztof.kozlowski@linaro.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, lizefan.x@bytedance.com, marcan@marcan.st, mhiramat@kernel.org, mst@redhat.com, m.szyprowski@samsung.com, netdev@vger.kernel.org, paulmck@kernel.org, rdunlap@infradead.org, samuel@sholland.org, suravee.suthikulpanit@amd.com, sven@svenpeter.dev, thierry.reding@gmail.com, tj@kernel.org, tomas.mudrunka@gmail.com, vdumpa@nvidia.com, virtualization@lists.linux.dev, wens@csie.org, will@kernel.org, yu-cheng.yu@intel.com References: <20231128204938.1453583-1-pasha.tatashin@soleen.com> <20231128204938.1453583-7-pasha.tatashin@soleen.com> Content-Language: en-GB From: Robin Murphy In-Reply-To: <20231128204938.1453583-7-pasha.tatashin@soleen.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 28 Nov 2023 14:34:16 -0800 (PST) On 2023-11-28 8:49 pm, Pasha Tatashin wrote: > Convert iommu/dma-iommu.c to use the new page allocation functions > provided in iommu-pages.h. These have nothing to do with IOMMU pagetables, they are DMA buffers and they belong to whoever called the corresponding dma_alloc_* function. Thanks, Robin. > Signed-off-by: Pasha Tatashin > --- > drivers/iommu/dma-iommu.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c > index 85163a83df2f..822adad464c2 100644 > --- a/drivers/iommu/dma-iommu.c > +++ b/drivers/iommu/dma-iommu.c > @@ -31,6 +31,7 @@ > #include > > #include "dma-iommu.h" > +#include "iommu-pages.h" > > struct iommu_dma_msi_page { > struct list_head list; > @@ -874,7 +875,7 @@ static dma_addr_t __iommu_dma_map(struct device *dev, phys_addr_t phys, > static void __iommu_dma_free_pages(struct page **pages, int count) > { > while (count--) > - __free_page(pages[count]); > + __iommu_free_page(pages[count]); > kvfree(pages); > } > > @@ -912,7 +913,8 @@ static struct page **__iommu_dma_alloc_pages(struct device *dev, > order_size = 1U << order; > if (order_mask > order_size) > alloc_flags |= __GFP_NORETRY; > - page = alloc_pages_node(nid, alloc_flags, order); > + page = __iommu_alloc_pages_node(nid, alloc_flags, > + order); > if (!page) > continue; > if (order) > @@ -1572,7 +1574,7 @@ static void *iommu_dma_alloc_pages(struct device *dev, size_t size, > > page = dma_alloc_contiguous(dev, alloc_size, gfp); > if (!page) > - page = alloc_pages_node(node, gfp, get_order(alloc_size)); > + page = __iommu_alloc_pages_node(node, gfp, get_order(alloc_size)); > if (!page) > return NULL; >