Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5361813pxv; Wed, 28 Jul 2021 09:01:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyV1wrEKWQQpUwvjCd2WnneoudVufy9Tk+JqO7/w9gFNfqGTohuX2lX5M1mT8YGwjY3SsbN X-Received: by 2002:a17:906:32cf:: with SMTP id k15mr224365ejk.68.1627488071361; Wed, 28 Jul 2021 09:01:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627488071; cv=none; d=google.com; s=arc-20160816; b=UM1yw5t7wRElryal32DeSCqT/7IeG9mcxbrvtmdGkNAUxsA13yMBQXTMQpR8VdfVex 3ZY4tffPXgvUdgCyijlNLW5UK3rrQA1n9NrjxtT25qltjG1E8TLP5rIgcItGzvCfYWH+ fmV80deeM2jgjQcy3jCdGRgOAUUjBgH18Ykl/j44eAmJJuXdDDIpvazodMogGbDv3dmB RlgK9H1F7iNg17cGUFbGshnx9YhPTJ0shWBwlV5ohYMH2lryPM1jkLFVB3JlYFOAIuYo 6Db4dOfK+TdHgQ7mqczA2io3xsVWT0fz4n3x3pV5gJpIUmfT+dSesctxLUBYhPpxQv2k aX5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=xBKgozq2k1Az9pVZTHJAHQlNiB/m8cVJqL8WiUBGO6E=; b=zrEUbMSyZcR6sm9MZZVIDjQovGmtUc6dBZIDrE+KLQCa1gVXyK1bGRyu1Emq+JkTi0 oU7K1vXT9aKIu8lQzD7Zd1ZIjAwZWRF7YhMNVMgj5+8Zhzv6Kf3N48H0o9ls1A46WwA7 i65jxHnunrUzXobgw+73+/ePjyilKFuHGvJLm6WgDqo6LOdZ96EMZFOZ/Qhi3yAA7GFS b5HwfKfRbFDB0fXpc4DuyldigUL90YN9TW6bXumz3vQdPrqgFfa//0J0544dKtlRCpAv KwW871ntRsQJHj0N17arh1RvqGE+ZEGznQowLYG9c816n+ghO4fkP6Yn0HFHAgkxeNvy r1iA== 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 h12si205481ejy.369.2021.07.28.09.00.46; Wed, 28 Jul 2021 09:01:11 -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 S230144AbhG1P7L (ORCPT + 99 others); Wed, 28 Jul 2021 11:59:11 -0400 Received: from foss.arm.com ([217.140.110.172]:59190 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237178AbhG1P7J (ORCPT ); Wed, 28 Jul 2021 11:59:09 -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 16265106F; Wed, 28 Jul 2021 08:59:08 -0700 (PDT) Received: from 010265703453.arm.com (unknown [10.57.36.146]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 931F43F70D; Wed, 28 Jul 2021 08:59:06 -0700 (PDT) From: Robin Murphy To: joro@8bytes.org, will@kernel.org Cc: iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, suravee.suthikulpanit@amd.com, baolu.lu@linux.intel.com, john.garry@huawei.com, dianders@chromium.org Subject: [PATCH v2 02/24] iommu/amd: Drop IOVA cookie management Date: Wed, 28 Jul 2021 16:58:23 +0100 Message-Id: <00769d3a3ab5f5b5f6d9f53f3012d66cb2fae403.1627468309.git.robin.murphy@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The core code bakes its own cookies now. Signed-off-by: Robin Murphy --- drivers/iommu/amd/iommu.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index 52fe2326042a..0fd98d35d73b 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -1918,16 +1918,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 +1935,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); -- 2.25.1