Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp601438pxb; Tue, 15 Feb 2022 23:25:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJyV8FPBi4teSQcfvNYNkF7eXVpwv/n3OA/k3YvlrHfj2Zm4estIgUGj2tkFLSnASPY97dzs X-Received: by 2002:a63:1554:0:b0:363:794c:9e31 with SMTP id 20-20020a631554000000b00363794c9e31mr1257800pgv.66.1644996315421; Tue, 15 Feb 2022 23:25:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644996315; cv=none; d=google.com; s=arc-20160816; b=DSXMGsGNIL2EjgYqALi3pexOXDyAc90lcAv27AJ+omaX3p/+xFxVT4XwPiFqNlzl4o 5GjOhS9TcKKwubdKRIshsK2gAZUT+3WVJkCfRMNbE8HyecneeU1Q6cKrrShQLgSwXF+8 l1rqKqgYFR1e8n6Fz8h7tk4yeWuXhNRfA4fzr+aw2MypjmYpDggEkD8V2pa8ObaMlR91 Cul2og8AlCLHBeHRl31jlH2uVMGIEgEgFP4X1dHnXWCrbeFR3S5yJK1EVYMg4NSIUqzm EHPWINlo0NXnv0QV4KRtlVffFsn+iUBxMGeb8vfK0N0R+qsM9WdIhdGDrXvtaBzX3OoE 8alw== 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 :dkim-signature; bh=xZqr5AIjpqhIGs03CHUC50SbxGnbTLkQlqVTs+ohixE=; b=Vuj0+zRizYY0hBl9vlIAer9yXAzl1mpzgpxJW9LlCPlM26o2vOe4vg1UMoBhON6XqN R1GhqP5UAWPtxEeFccEB38Wb1uexa5WdcB+h2P0jIvZW2yhByHds/ZUhpeZiswKnDfc5 37lCRNfqCAOGyfzvkfwyKgZhIWsRwfUnXYWx+qsPSI3adpoeldmBfwswIN2KubeQ1aJn L/E3+hVxSxrOo+KqCkR0IJyeXBtElodfBZQPSNVmaV+Qv6kiRtd5hJ5cXTMHICd9WgS4 JcX1n4bmK2GMZglVUV2mE2NdDQVyT0MLUZXRtrBUi8niiCgZqJ3PA+rjqQ+e0Gn+g3e2 8EWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cypURdax; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v12si15660287pjs.41.2022.02.15.23.25.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 23:25:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cypURdax; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 33392888CE; Tue, 15 Feb 2022 22:53:48 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343889AbiBPCzF (ORCPT + 99 others); Tue, 15 Feb 2022 21:55:05 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:52490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343866AbiBPCzD (ORCPT ); Tue, 15 Feb 2022 21:55:03 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 315C0FBF2D for ; Tue, 15 Feb 2022 18:54:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644980092; x=1676516092; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QPnDGZYqEL8lzJ/a++F6WRyRimejmxMhswRnFUkhPWs=; b=cypURdaxU5zCvbe1MzpRGfQcXPfKBj8rxEGpLnnV2mfp5iu2Aoifub3A SyOdrIbF9G8Ui6djTk5NNhfHU/zwmayZBdhRJ+oA48b+gRX/Wa8+OTsKe xUvHSyp+5u/dyU2qiM8PDE1qVY+Ri4R2XUpLih4xMxjxv2YmuaWPEO4mV y+TJf45l39+ivQMfVokFgfcnOYDq4y2dNsd2+Rs+Lpvlt67QstMxf0Hnu 1S2rO115PSUtZt027Cod5qG/af2uGltZw3lbGlFvAPg2BWjIBtysIZ+OB tALDM/Pym8VQStw7nj6W7ZYfuSPlmUiToTAVw1909sFgtt/aJhHi58e7+ Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10259"; a="336940646" X-IronPort-AV: E=Sophos;i="5.88,371,1635231600"; d="scan'208";a="336940646" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2022 18:54:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,371,1635231600"; d="scan'208";a="681312475" Received: from allen-box.sh.intel.com ([10.239.159.118]) by fmsmga001.fm.intel.com with ESMTP; 15 Feb 2022 18:54:44 -0800 From: Lu Baolu To: Joerg Roedel , Jason Gunthorpe , Christoph Hellwig , Ben Skeggs , Kevin Tian , Ashok Raj , Will Deacon , Robin Murphy Cc: Alex Williamson , Eric Auger , Liu Yi L , Jacob jun Pan , David Airlie , Daniel Vetter , Thierry Reding , Jonathan Hunter , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Lu Baolu , Christoph Hellwig Subject: [PATCH v4 5/9] iommu: Remove apply_resv_region Date: Wed, 16 Feb 2022 10:52:45 +0800 Message-Id: <20220216025249.3459465-6-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220216025249.3459465-1-baolu.lu@linux.intel.com> References: <20220216025249.3459465-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 The apply_resv_region callback in iommu_ops was introduced to reserve an IOVA range in the given DMA domain when the IOMMU driver manages the IOVA by itself. As all drivers converted to use dma-iommu in the core, there's no driver using this anymore. Remove it to avoid dead code. Suggested-by: Robin Murphy Signed-off-by: Lu Baolu Reviewed-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe --- include/linux/iommu.h | 4 ---- drivers/iommu/iommu.c | 3 --- 2 files changed, 7 deletions(-) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 9983a01373b2..9ffa2e88f3d0 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -214,7 +214,6 @@ struct iommu_iotlb_gather { * @set_pgtable_quirks: Set io page table quirks (IO_PGTABLE_QUIRK_*) * @get_resv_regions: Request list of reserved regions for a device * @put_resv_regions: Free list of reserved regions for a device - * @apply_resv_region: Temporary helper call-back for iova reserved ranges * @of_xlate: add OF master IDs to iommu grouping * @is_attach_deferred: Check if domain attach should be deferred from iommu * driver init to device driver init (default no) @@ -268,9 +267,6 @@ struct iommu_ops { /* Request/Free a list of reserved regions for a device */ void (*get_resv_regions)(struct device *dev, struct list_head *list); void (*put_resv_regions)(struct device *dev, struct list_head *list); - void (*apply_resv_region)(struct device *dev, - struct iommu_domain *domain, - struct iommu_resv_region *region); int (*of_xlate)(struct device *dev, struct of_phandle_args *args); bool (*is_attach_deferred)(struct iommu_domain *domain, struct device *dev); diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 0ebaf561a70e..7cf073c56036 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -790,9 +790,6 @@ static int iommu_create_device_direct_mappings(struct iommu_group *group, dma_addr_t start, end, addr; size_t map_size = 0; - if (domain->ops->apply_resv_region) - domain->ops->apply_resv_region(dev, domain, entry); - start = ALIGN(entry->start, pg_size); end = ALIGN(entry->start + entry->length, pg_size); -- 2.25.1