Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp577130pxv; Fri, 9 Jul 2021 04:45:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfR5If/SDSc9e67zfPAEzjTCaO8Zoq8y8LY0cnfzh49uWEwFgFDT7kn02xYXAsO3uHI5U1 X-Received: by 2002:a17:907:988e:: with SMTP id ja14mr19379018ejc.173.1625831116424; Fri, 09 Jul 2021 04:45:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625831116; cv=none; d=google.com; s=arc-20160816; b=Sg01a9nGpwWiAEBfvnKSmGWucNbK7UTmFSZeiBnAy4LCkraSgN+903e1EvIHX3fCNN 93oWPDD57TQ4Y2MpJnu2Azykr1V7yLAr0amwF1jkPtNGhWvlaSW4sqAfZ/Uqku3rYy/c FY/k9aYJ9V62giP8/2YrHqLTyrpi6CbZzo5v55jrifgKapN9sm5DR4V/w8m/w1hh3Cr/ fN3Mrb8G/9FMV2dIg61rF1TnOmq6jFK36p6yvas2J7cLvq1GJp5Sgh3hsmEgrDA6ocqR bpjIdZkkVrLqnm4e3N0CAKSV9FgSLKynwt0mLrYFXg2yMw+3CGwUfc3bfm09SbwI8WNe bWrA== 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=T6Fu2Yt38r79jvQRn5HVAAOYCNYVH5pxX3ZmV1lqXNs=; b=qHIDg/Uoh9efTXrnxWnOcH/skYdwvMZNYzKoy7xA0LAtDU3Zl0lKFtqjFKz0nbESAx 6FIEY4UdUs10Fjsq1U8nYLeTOFNICrvuOHWGmBvo2O3Chqa1Nji8RBEUeAqhwdUVKC61 OY3Xmi60b9ow7Y0h/AWL7LTTpQu1tmj6ri/CIq4/0fCegRl/XoeeIxHzpd58Zf92u3yo 5jD8Y3FHDLKx1FWItk3vILImpVKEleZcMRopavZh/nat5/QOwAynj1QdFMiPAI8O6AfZ gOWCuGj0DyPBAONAs1NTHoGLYjnGj2LInzd+NBZQZoswtU91he2FKJjne8UFBTjDrDOD T1bA== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jy1si7095242ejc.592.2021.07.09.04.44.51; Fri, 09 Jul 2021 04:45:16 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231294AbhGILqf (ORCPT + 99 others); Fri, 9 Jul 2021 07:46:35 -0400 Received: from mail-wm1-f47.google.com ([209.85.128.47]:56176 "EHLO mail-wm1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231274AbhGILqe (ORCPT ); Fri, 9 Jul 2021 07:46:34 -0400 Received: by mail-wm1-f47.google.com with SMTP id j34so6125112wms.5; Fri, 09 Jul 2021 04:43:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T6Fu2Yt38r79jvQRn5HVAAOYCNYVH5pxX3ZmV1lqXNs=; b=WAObDDkAogK8oOE1xNvU1kKfjZ2wpzzm/uhEE0aXPIxvTichSBkr+xaf7EtmUafOA7 p6KAg2TtJNbfP/AjOuXTrb/tkaRhJyUmspnOXShkpUS2SW52TujrduIhQ7qDNPkZa+mr NzcGt+qYD7nwrG3Fj6qlrcspEFMwhsOgyNvU4UM7q/pvJt+NsOB8w2wyKOVtmhDL/ZKi ZtunBGs/TVezcXRSAuvcg7wlCTANdvLl0IhpZT8qL7U82VLnb3pWe6bNUkRZLW6bQJ2a /1HXlJRAb76nCj7qmWrDVUPP5bu1CHngGXjm6BcRA/ogroIDmiIwxUDJ9XWGT2Z+FTTD DqgA== X-Gm-Message-State: AOAM533KrjaVauLLLiWaa2C+Ip7UoTFZ6XfYjZ7uHc3SdSOpdUiIYQEU mWpiMMoQRNYxBnofguwng9HY8GlnSNw= X-Received: by 2002:a05:600c:a45:: with SMTP id c5mr11598095wmq.153.1625831028683; Fri, 09 Jul 2021 04:43:48 -0700 (PDT) Received: from liuwe-devbox-debian-v2.j3c5onc20sse1dnehy4noqpfcg.zx.internal.cloudapp.net ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id z12sm4896849wrs.39.2021.07.09.04.43.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jul 2021 04:43:48 -0700 (PDT) From: Wei Liu To: Linux on Hyper-V List Cc: virtualization@lists.linux-foundation.org, Linux Kernel List , Michael Kelley , Vineeth Pillai , Sunil Muthuswamy , Nuno Das Neves , kumarpraveen@linux.microsoft.com, pasha.tatashin@soleen.com, Wei Liu , David Woodhouse , Lu Baolu , Joerg Roedel , Will Deacon , iommu@lists.linux-foundation.org (open list:INTEL IOMMU (VT-d)) Subject: [RFC v1 4/8] intel/vt-d: export intel_iommu_get_resv_regions Date: Fri, 9 Jul 2021 11:43:35 +0000 Message-Id: <20210709114339.3467637-5-wei.liu@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210709114339.3467637-1-wei.liu@kernel.org> References: <20210709114339.3467637-1-wei.liu@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When Microsoft Hypervisor runs on Intel platforms it needs to know the reserved regions to program devices correctly. There is no reason to duplicate intel_iommu_get_resv_regions. Export it. Signed-off-by: Wei Liu --- drivers/iommu/intel/iommu.c | 5 +++-- include/linux/intel-iommu.h | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index a4294d310b93..01973bc20080 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -5176,8 +5176,8 @@ static void intel_iommu_probe_finalize(struct device *dev) set_dma_ops(dev, NULL); } -static void intel_iommu_get_resv_regions(struct device *device, - struct list_head *head) +void intel_iommu_get_resv_regions(struct device *device, + struct list_head *head) { int prot = DMA_PTE_READ | DMA_PTE_WRITE; struct iommu_resv_region *reg; @@ -5232,6 +5232,7 @@ static void intel_iommu_get_resv_regions(struct device *device, return; list_add_tail(®->list, head); } +EXPORT_SYMBOL_GPL(intel_iommu_get_resv_regions); int intel_iommu_enable_pasid(struct intel_iommu *iommu, struct device *dev) { diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index 03faf20a6817..f91869f765bc 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h @@ -814,6 +814,8 @@ extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu); extern int dmar_disabled; extern int intel_iommu_enabled; extern int intel_iommu_gfx_mapped; +extern void intel_iommu_get_resv_regions(struct device *device, + struct list_head *head); #else static inline int iommu_calculate_agaw(struct intel_iommu *iommu) { @@ -825,6 +827,8 @@ static inline int iommu_calculate_max_sagaw(struct intel_iommu *iommu) } #define dmar_disabled (1) #define intel_iommu_enabled (0) +static inline void intel_iommu_get_resv_regions(struct device *device, + struct list_head *head) {} #endif #endif -- 2.30.2