lkml.org 
[lkml]   [2019]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 5/9] iommu/amd: Implement .flush_np_cache
Date
Implement flush_np_cache for the AMD iommu driver. This allows the amd
iommu non present cache to be flushed if amd_iommu_np_cache is set.

Signed-off-by: Tom Murphy <tmurphy@arista.com>
---
drivers/iommu/amd_iommu.c | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index b319e51c379b..2d4ee10626b4 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -1319,6 +1319,18 @@ static void domain_flush_devices(struct protection_domain *domain)
device_flush_dte(dev_data);
}

+static void amd_iommu_flush_np_cache(struct iommu_domain *domain,
+ unsigned long iova, size_t size)
+{
+ struct protection_domain *dom = to_pdomain(domain);
+
+ if (unlikely(amd_iommu_np_cache)) {
+ domain_flush_pages(dom, iova, size);
+ domain_flush_complete(dom);
+ }
+}
+
+
/****************************************************************************
*
* The functions below are used the create the page table mappings for
@@ -3263,6 +3275,7 @@ const struct iommu_ops amd_iommu_ops = {
.flush_iotlb_all = amd_iommu_flush_iotlb_all,
.iotlb_range_add = amd_iommu_iotlb_range_add,
.iotlb_sync = amd_iommu_flush_iotlb_all,
+ .flush_np_cache = amd_iommu_flush_np_cache,
};

/*****************************************************************************
--
2.17.1
\
 
 \ /
  Last update: 2019-04-11 20:50    [W:0.165 / U:2.644 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site