From: John Garry <john.garry@huawei.com>
To: <joro@8bytes.org>, <will@kernel.org>
Cc: <iommu@lists.linux-foundation.org>,
<linux-kernel@vger.kernel.org>, <linuxarm@huawei.com>,
<0x7f454c46@gmail.com>, <robin.murphy@arm.com>,
"John Garry" <john.garry@huawei.com>
Subject: [PATCH 1/3] iommu: Delete split_and_remove_iova()
Date: Fri, 4 Dec 2020 02:34:50 +0800 [thread overview]
Message-ID: <1607020492-189471-2-git-send-email-john.garry@huawei.com> (raw)
In-Reply-To: <1607020492-189471-1-git-send-email-john.garry@huawei.com>
Function split_and_remove_iova() has not been referenced since commit
e70b081c6f37 ("iommu/vt-d: Remove IOVA handling code from the non-dma_ops
path"), so delete it.
Signed-off-by: John Garry <john.garry@huawei.com>
---
drivers/iommu/iova.c | 41 -----------------------------------------
include/linux/iova.h | 10 ----------
2 files changed, 51 deletions(-)
diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c
index ea04a88c673d..4803bd83447d 100644
--- a/drivers/iommu/iova.c
+++ b/drivers/iommu/iova.c
@@ -738,47 +738,6 @@ copy_reserved_iova(struct iova_domain *from, struct iova_domain *to)
}
EXPORT_SYMBOL_GPL(copy_reserved_iova);
-struct iova *
-split_and_remove_iova(struct iova_domain *iovad, struct iova *iova,
- unsigned long pfn_lo, unsigned long pfn_hi)
-{
- unsigned long flags;
- struct iova *prev = NULL, *next = NULL;
-
- spin_lock_irqsave(&iovad->iova_rbtree_lock, flags);
- if (iova->pfn_lo < pfn_lo) {
- prev = alloc_and_init_iova(iova->pfn_lo, pfn_lo - 1);
- if (prev == NULL)
- goto error;
- }
- if (iova->pfn_hi > pfn_hi) {
- next = alloc_and_init_iova(pfn_hi + 1, iova->pfn_hi);
- if (next == NULL)
- goto error;
- }
-
- __cached_rbnode_delete_update(iovad, iova);
- rb_erase(&iova->node, &iovad->rbroot);
-
- if (prev) {
- iova_insert_rbtree(&iovad->rbroot, prev, NULL);
- iova->pfn_lo = pfn_lo;
- }
- if (next) {
- iova_insert_rbtree(&iovad->rbroot, next, NULL);
- iova->pfn_hi = pfn_hi;
- }
- spin_unlock_irqrestore(&iovad->iova_rbtree_lock, flags);
-
- return iova;
-
-error:
- spin_unlock_irqrestore(&iovad->iova_rbtree_lock, flags);
- if (prev)
- free_iova_mem(prev);
- return NULL;
-}
-
/*
* 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 a0637abffee8..a77add571c50 100644
--- a/include/linux/iova.h
+++ b/include/linux/iova.h
@@ -160,8 +160,6 @@ 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);
void put_iova_domain(struct iova_domain *iovad);
-struct iova *split_and_remove_iova(struct iova_domain *iovad,
- struct iova *iova, unsigned long pfn_lo, unsigned long pfn_hi);
void free_cpu_cached_iovas(unsigned int cpu, struct iova_domain *iovad);
#else
static inline int iova_cache_get(void)
@@ -258,14 +256,6 @@ static inline void put_iova_domain(struct iova_domain *iovad)
{
}
-static inline struct iova *split_and_remove_iova(struct iova_domain *iovad,
- struct iova *iova,
- unsigned long pfn_lo,
- unsigned long pfn_hi)
-{
- return NULL;
-}
-
static inline void free_cpu_cached_iovas(unsigned int cpu,
struct iova_domain *iovad)
{
--
2.26.2
next prev parent reply other threads:[~2020-12-03 18:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-03 18:34 [PATCH 0/3] IOMMU: Some IOVA code tidy-up John Garry
2020-12-03 18:34 ` John Garry [this message]
2020-12-03 18:34 ` [PATCH 2/3] iommu: Stop exporting alloc_iova_mem() John Garry
2020-12-03 18:34 ` [PATCH 3/3] iommu: Stop exporting free_iova_mem() John Garry
2020-12-08 15:54 ` [PATCH 0/3] IOMMU: Some IOVA code tidy-up Will Deacon
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=1607020492-189471-2-git-send-email-john.garry@huawei.com \
--to=john.garry@huawei.com \
--cc=0x7f454c46@gmail.com \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=robin.murphy@arm.com \
--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
all inboxes | Powered by JetHome®