From: Wei Liu <wei.liu@kernel.org>
To: Linux on Hyper-V List <linux-hyperv@vger.kernel.org>
Cc: Wei Liu <wei.liu@kernel.org>,
pasha.tatashin@soleen.com, Will Deacon <will@kernel.org>,
kumarpraveen@linux.microsoft.com,
David Woodhouse <dwmw2@infradead.org>,
Linux Kernel List <linux-kernel@vger.kernel.org>,
Michael Kelley <mikelley@microsoft.com>,
"open list:INTEL IOMMU VT-d" <iommu@lists.linux-foundation.org>,
Nuno Das Neves <nunodasneves@linux.microsoft.com>,
Sunil Muthuswamy <sunilmut@microsoft.com>,
virtualization@lists.linux-foundation.org,
Vineeth Pillai <viremana@linux.microsoft.com>
Subject: [RFC v1 4/8] intel/vt-d: export intel_iommu_get_resv_regions
Date: Fri, 9 Jul 2021 11:43:35 +0000 [thread overview]
Message-ID: <20210709114339.3467637-5-wei.liu@kernel.org> (raw)
In-Reply-To: <20210709114339.3467637-1-wei.liu@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 <wei.liu@kernel.org>
---
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
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
next prev parent reply other threads:[~2021-07-09 11:43 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210709114339.3467637-1-wei.liu@kernel.org>
2021-07-09 11:43 ` [RFC v1 3/8] intel/vt-d: make DMAR table parsing code more flexible Wei Liu
2021-07-09 12:56 ` Robin Murphy
2021-07-09 13:42 ` Wei Liu
2021-07-09 11:43 ` Wei Liu [this message]
2021-07-09 14:17 ` [RFC v1 4/8] intel/vt-d: export intel_iommu_get_resv_regions Lu Baolu
2021-07-09 14:21 ` Wei Liu
2021-07-09 11:43 ` [RFC v1 5/8] mshv: add paravirtualized IOMMU support Wei Liu
2021-08-03 18:40 ` Praveen Kumar
2021-08-03 21:47 ` Wei Liu
2021-08-04 6:43 ` Praveen Kumar
2021-08-10 10:46 ` Wei Liu
2021-07-09 11:43 ` [RFC v1 6/8] mshv: command line option to skip devices in PV-IOMMU Wei Liu
2021-07-09 12:46 ` Robin Murphy
2021-07-09 13:34 ` Wei Liu
2021-08-03 18:50 ` Praveen Kumar
2021-08-03 21:56 ` Wei Liu
2021-08-04 7:03 ` Praveen Kumar
2021-08-10 10:04 ` Wei Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210709114339.3467637-5-wei.liu@kernel.org \
--to=wei.liu@kernel.org \
--cc=dwmw2@infradead.org \
--cc=iommu@lists.linux-foundation.org \
--cc=kumarpraveen@linux.microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikelley@microsoft.com \
--cc=nunodasneves@linux.microsoft.com \
--cc=pasha.tatashin@soleen.com \
--cc=sunilmut@microsoft.com \
--cc=viremana@linux.microsoft.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox