* [PATCH 0/3] IOMMU: Some more IOVA code tidy-up
@ 2020-12-09 15:50 John Garry
2020-12-09 15:50 ` [PATCH 1/3] iova: Make has_iova_flush_queue() private John Garry
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: John Garry @ 2020-12-09 15:50 UTC (permalink / raw)
To: joro, will; +Cc: iommu, linux-kernel, linuxarm, robin.murphy, John Garry
Based on arm64 for-next/iommu/core
I'll try to bunch this sort of stuff more in future, Thanks
John Garry (3):
iova: Make has_iova_flush_queue() private
iova: Delete copy_reserved_iova()
iova: Stop exporting some more functions
drivers/iommu/iova.c | 36 +-----------------------------------
include/linux/iova.h | 12 ------------
2 files changed, 1 insertion(+), 47 deletions(-)
--
2.26.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] iova: Make has_iova_flush_queue() private
2020-12-09 15:50 [PATCH 0/3] IOMMU: Some more IOVA code tidy-up John Garry
@ 2020-12-09 15:50 ` John Garry
2020-12-09 15:50 ` [PATCH 2/3] iova: Delete copy_reserved_iova() John Garry
2020-12-09 15:50 ` [PATCH 3/3] iova: Stop exporting some more functions John Garry
2 siblings, 0 replies; 4+ messages in thread
From: John Garry @ 2020-12-09 15:50 UTC (permalink / raw)
To: joro, will; +Cc: iommu, linux-kernel, linuxarm, robin.murphy, John Garry
Function has_iova_flush_queue() has no users outside iova.c, so make it
private.
Signed-off-by: John Garry <john.garry@huawei.com>
---
drivers/iommu/iova.c | 2 +-
include/linux/iova.h | 6 ------
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c
index 4bb3293ae4d7..0a758ec2a1c4 100644
--- a/drivers/iommu/iova.c
+++ b/drivers/iommu/iova.c
@@ -55,7 +55,7 @@ init_iova_domain(struct iova_domain *iovad, unsigned long granule,
}
EXPORT_SYMBOL_GPL(init_iova_domain);
-bool has_iova_flush_queue(struct iova_domain *iovad)
+static bool has_iova_flush_queue(struct iova_domain *iovad)
{
return !!iovad->fq;
}
diff --git a/include/linux/iova.h b/include/linux/iova.h
index 76e16ae20729..2b76e0be1c5b 100644
--- a/include/linux/iova.h
+++ b/include/linux/iova.h
@@ -153,7 +153,6 @@ struct iova *reserve_iova(struct iova_domain *iovad, unsigned long pfn_lo,
void copy_reserved_iova(struct iova_domain *from, struct iova_domain *to);
void init_iova_domain(struct iova_domain *iovad, unsigned long granule,
unsigned long start_pfn);
-bool has_iova_flush_queue(struct iova_domain *iovad);
int init_iova_flush_queue(struct iova_domain *iovad,
iova_flush_cb flush_cb, iova_entry_dtor entry_dtor);
struct iova *find_iova(struct iova_domain *iovad, unsigned long pfn);
@@ -223,11 +222,6 @@ static inline void init_iova_domain(struct iova_domain *iovad,
{
}
-static inline bool has_iova_flush_queue(struct iova_domain *iovad)
-{
- return false;
-}
-
static inline int init_iova_flush_queue(struct iova_domain *iovad,
iova_flush_cb flush_cb,
iova_entry_dtor entry_dtor)
--
2.26.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] iova: Delete copy_reserved_iova()
2020-12-09 15:50 [PATCH 0/3] IOMMU: Some more IOVA code tidy-up John Garry
2020-12-09 15:50 ` [PATCH 1/3] iova: Make has_iova_flush_queue() private John Garry
@ 2020-12-09 15:50 ` John Garry
2020-12-09 15:50 ` [PATCH 3/3] iova: Stop exporting some more functions John Garry
2 siblings, 0 replies; 4+ messages in thread
From: John Garry @ 2020-12-09 15:50 UTC (permalink / raw)
To: joro, will; +Cc: iommu, linux-kernel, linuxarm, robin.murphy, John Garry
Since commit c588072bba6b ("iommu/vt-d: Convert intel iommu driver to the
iommu ops"), function copy_reserved_iova() is not referenced, so delete
it.
Signed-off-by: John Garry <john.garry@huawei.com>
---
drivers/iommu/iova.c | 30 ------------------------------
include/linux/iova.h | 6 ------
2 files changed, 36 deletions(-)
diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c
index 0a758ec2a1c4..04f0a3ae1c63 100644
--- a/drivers/iommu/iova.c
+++ b/drivers/iommu/iova.c
@@ -710,36 +710,6 @@ reserve_iova(struct iova_domain *iovad,
}
EXPORT_SYMBOL_GPL(reserve_iova);
-/**
- * copy_reserved_iova - copies the reserved between domains
- * @from: - source doamin from where to copy
- * @to: - destination domin where to copy
- * This function copies reserved iova's from one doamin to
- * other.
- */
-void
-copy_reserved_iova(struct iova_domain *from, struct iova_domain *to)
-{
- unsigned long flags;
- struct rb_node *node;
-
- spin_lock_irqsave(&from->iova_rbtree_lock, flags);
- for (node = rb_first(&from->rbroot); node; node = rb_next(node)) {
- struct iova *iova = rb_entry(node, struct iova, node);
- struct iova *new_iova;
-
- if (iova->pfn_lo == IOVA_ANCHOR)
- continue;
-
- new_iova = reserve_iova(to, iova->pfn_lo, iova->pfn_hi);
- if (!new_iova)
- pr_err("Reserve iova range %lx@%lx failed\n",
- iova->pfn_lo, iova->pfn_lo);
- }
- spin_unlock_irqrestore(&from->iova_rbtree_lock, flags);
-}
-EXPORT_SYMBOL_GPL(copy_reserved_iova);
-
/*
* Magazine caches for IOVA ranges. For an introduction to magazines,
* see the USENIX 2001 paper "Magazines and Vmem: Extending the Slab
diff --git a/include/linux/iova.h b/include/linux/iova.h
index 2b76e0be1c5b..c834c01c0a5b 100644
--- a/include/linux/iova.h
+++ b/include/linux/iova.h
@@ -150,7 +150,6 @@ unsigned long alloc_iova_fast(struct iova_domain *iovad, unsigned long size,
unsigned long limit_pfn, bool flush_rcache);
struct iova *reserve_iova(struct iova_domain *iovad, unsigned long pfn_lo,
unsigned long pfn_hi);
-void copy_reserved_iova(struct iova_domain *from, struct iova_domain *to);
void init_iova_domain(struct iova_domain *iovad, unsigned long granule,
unsigned long start_pfn);
int init_iova_flush_queue(struct iova_domain *iovad,
@@ -211,11 +210,6 @@ static inline struct iova *reserve_iova(struct iova_domain *iovad,
return NULL;
}
-static inline void copy_reserved_iova(struct iova_domain *from,
- struct iova_domain *to)
-{
-}
-
static inline void init_iova_domain(struct iova_domain *iovad,
unsigned long granule,
unsigned long start_pfn)
--
2.26.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] iova: Stop exporting some more functions
2020-12-09 15:50 [PATCH 0/3] IOMMU: Some more IOVA code tidy-up John Garry
2020-12-09 15:50 ` [PATCH 1/3] iova: Make has_iova_flush_queue() private John Garry
2020-12-09 15:50 ` [PATCH 2/3] iova: Delete copy_reserved_iova() John Garry
@ 2020-12-09 15:50 ` John Garry
2 siblings, 0 replies; 4+ messages in thread
From: John Garry @ 2020-12-09 15:50 UTC (permalink / raw)
To: joro, will; +Cc: iommu, linux-kernel, linuxarm, robin.murphy, John Garry
The following functions are not referenced outside dma-iommu.c (apart
from iova.c), which can only be built-in:
- init_iova_flush_queue()
- free_iova_fast()
- queue_iova()
- alloc_iova_fast()
So stop exporting them.
Signed-off-by: John Garry <john.garry@huawei.com>
---
drivers/iommu/iova.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c
index 04f0a3ae1c63..f9c35852018d 100644
--- a/drivers/iommu/iova.c
+++ b/drivers/iommu/iova.c
@@ -112,7 +112,6 @@ int init_iova_flush_queue(struct iova_domain *iovad,
return 0;
}
-EXPORT_SYMBOL_GPL(init_iova_flush_queue);
static struct rb_node *
__get_cached_rbnode(struct iova_domain *iovad, unsigned long limit_pfn)
@@ -451,7 +450,6 @@ alloc_iova_fast(struct iova_domain *iovad, unsigned long size,
return new_iova->pfn_lo;
}
-EXPORT_SYMBOL_GPL(alloc_iova_fast);
/**
* free_iova_fast - free iova pfn range into rcache
@@ -469,7 +467,6 @@ free_iova_fast(struct iova_domain *iovad, unsigned long pfn, unsigned long size)
free_iova(iovad, pfn);
}
-EXPORT_SYMBOL_GPL(free_iova_fast);
#define fq_ring_for_each(i, fq) \
for ((i) = (fq)->head; (i) != (fq)->tail; (i) = ((i) + 1) % IOVA_FQ_SIZE)
@@ -598,7 +595,6 @@ void queue_iova(struct iova_domain *iovad,
mod_timer(&iovad->fq_timer,
jiffies + msecs_to_jiffies(IOVA_FQ_TIMEOUT));
}
-EXPORT_SYMBOL_GPL(queue_iova);
/**
* put_iova_domain - destroys the iova doamin
--
2.26.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-12-09 15:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-09 15:50 [PATCH 0/3] IOMMU: Some more IOVA code tidy-up John Garry
2020-12-09 15:50 ` [PATCH 1/3] iova: Make has_iova_flush_queue() private John Garry
2020-12-09 15:50 ` [PATCH 2/3] iova: Delete copy_reserved_iova() John Garry
2020-12-09 15:50 ` [PATCH 3/3] iova: Stop exporting some more functions John Garry
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).