Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp406610pxt; Thu, 5 Aug 2021 02:39:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaXiJud64wwJAFCJikawcTxnPBHev3KiI73ZVbbheNOrsRVvvwDoEjdkYRzKvwjcXB6pIA X-Received: by 2002:a17:906:24c3:: with SMTP id f3mr3906115ejb.145.1628156395013; Thu, 05 Aug 2021 02:39:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628156395; cv=none; d=google.com; s=arc-20160816; b=j9LgyI3ZVzhS3eyfg3S9fFSt2MtV532g5JviLtr9hk+teC/+Y8laSuT2xBPUmUdqVK d0ArC+tOPSyTk/18FvNgpv+B38uzPb4ptXMW8fBh3WyfoyEPbwCQ3oCj7SqqdUa8iOY+ 3yqvMPRa7m7yKUXI1ovrM/41R1Vvj264sFGt6RnmqT5gElD5iSC1DcfnKpPlwDd1wkeH LInxZeoH6SWkJxaDSEuLI6e3Qp98EalMN1RCyqFH2o8bDEKtZ5Ht4JYdEpo4tdd+SV5w yNJGMn915QbYakZneY5x0kGJrxO4M3URbmo8yJAmyaS1fsyCQo1KgPHWDpRdBK0FTeP8 1PMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:from:subject; bh=gvzY824fChIMqNA70EDcAo9zDI/CZ1lI8zW/5BHK054=; b=ylBpWFJyH8A/IBHrq7NhaJa7JPjlx5rbcwEYVjipoAhXW12+5LqMpJM2XB3slp+KKR jkJyLhV+oXOVmyWUC/udvvqjPIgQoLmEzgCMIYdhT50+sB+3bjBZgq4omJZbQWfTvSfw hsnKwbwYiLigQpgqgaBD0Xy9Z3qgFoP9i0yhWN6TIBivxDZwqi0NpmHH37Ob/O9kHcR6 uqfkV6MrLB7QxFTno5W95wCQSsFzRQzBfC+zR7j9kaY6i6YDnGiUU0VwJfFlrldE5v9w f2jmzYxD7iHbr/xsioHUKZ5+k3om76n/GzicbH5aOk8IGoL0P4lRDzWUt+BLfsdbpndW maAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id js19si5532445ejc.163.2021.08.05.02.39.30; Thu, 05 Aug 2021 02:39:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S238685AbhHEJiV (ORCPT + 99 others); Thu, 5 Aug 2021 05:38:21 -0400 Received: from foss.arm.com ([217.140.110.172]:41792 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238146AbhHEJiT (ORCPT ); Thu, 5 Aug 2021 05:38:19 -0400 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 168B16D; Thu, 5 Aug 2021 02:38:05 -0700 (PDT) Received: from [10.57.36.146] (unknown [10.57.36.146]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DFEED3F719; Thu, 5 Aug 2021 02:38:03 -0700 (PDT) Subject: Re: [PATCH v3 02/25] iommu/amd: Drop IOVA cookie management From: Robin Murphy To: joro@8bytes.org, will@kernel.org Cc: linux-kernel@vger.kernel.org, dianders@chromium.org, iommu@lists.linux-foundation.org, rajatja@google.com, linux-arm-kernel@lists.infradead.org References: Message-ID: <44f5c699-1177-7f1d-479e-59a8a42efab6@arm.com> Date: Thu, 5 Aug 2021 10:37:58 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-08-04 18:15, Robin Murphy wrote: > The core code bakes its own cookies now. > > Signed-off-by: Robin Murphy > > --- > > v3: Also remove unneeded include > --- > drivers/iommu/amd/iommu.c | 13 ------------- > 1 file changed, 13 deletions(-) > > diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c > index 52fe2326042a..92f7cbe3d14a 100644 > --- a/drivers/iommu/amd/iommu.c > +++ b/drivers/iommu/amd/iommu.c > @@ -20,7 +20,6 @@ > #include > #include > #include > -#include Oh dear, how embarrassing... I went through all the drivers making that decision based on iommu_dma* references but totally forgot about iommu_setup_dma_ops() here. And then of course fell into the trap of "such a minor change I don't need to re-rest it" hubris... sigh, roll back to v2 for this one. Apologies, Robin. > #include > #include > #include > @@ -1918,16 +1917,7 @@ static struct iommu_domain *amd_iommu_domain_alloc(unsigned type) > domain->domain.geometry.aperture_end = ~0ULL; > domain->domain.geometry.force_aperture = true; > > - if (type == IOMMU_DOMAIN_DMA && > - iommu_get_dma_cookie(&domain->domain) == -ENOMEM) > - goto free_domain; > - > return &domain->domain; > - > -free_domain: > - protection_domain_free(domain); > - > - return NULL; > } > > static void amd_iommu_domain_free(struct iommu_domain *dom) > @@ -1944,9 +1934,6 @@ static void amd_iommu_domain_free(struct iommu_domain *dom) > if (!dom) > return; > > - if (dom->type == IOMMU_DOMAIN_DMA) > - iommu_put_dma_cookie(&domain->domain); > - > if (domain->flags & PD_IOMMUV2_MASK) > free_gcr3_table(domain); > >