[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210112161240.2024684-40-Liam.Howlett@Oracle.com>
Date: Tue, 12 Jan 2021 11:12:09 -0500
From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
To: maple-tree@...ts.infradead.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Cc: Andrew Morton <akpm@...gle.com>, Song Liu <songliubraving@...com>,
Davidlohr Bueso <dave@...olabs.net>,
"Paul E . McKenney" <paulmck@...nel.org>,
Matthew Wilcox <willy@...radead.org>,
Jerome Glisse <jglisse@...hat.com>,
David Rientjes <rientjes@...gle.com>,
Axel Rasmussen <axelrasmussen@...gle.com>,
Suren Baghdasaryan <surenb@...gle.com>,
Vlastimil Babka <vbabka@...e.cz>,
Rik van Riel <riel@...riel.com>,
Peter Zijlstra <peterz@...radead.org>
Subject: [PATCH v2 39/70] drivers/tee/optee: Use maple tree iterators for __check_mem_type()
Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.com>
---
drivers/tee/optee/call.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/tee/optee/call.c b/drivers/tee/optee/call.c
index c981757ba0d40..94acf379eaeeb 100644
--- a/drivers/tee/optee/call.c
+++ b/drivers/tee/optee/call.c
@@ -545,12 +545,17 @@ static bool is_normal_memory(pgprot_t p)
static int __check_mem_type(struct vm_area_struct *vma, unsigned long end)
{
- while (vma && is_normal_memory(vma->vm_page_prot)) {
- if (vma->vm_end >= end)
- return 0;
- vma = vma->vm_next;
+ MA_STATE(mas, &vma->vm_mm->mm_mt, vma->vm_start, vma->vm_start);
+
+
+ mas_for_each(&mas, vma, end) {
+ if (!is_normal_memory(vma->vm_page_prot))
+ break;
}
+ if (!vma)
+ return 0;
+
return -EINVAL;
}
--
2.28.0
Powered by blists - more mailing lists