[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-a7295fd53c39ce781a9792c9dd2c8747bf274160@git.kernel.org>
Date: Thu, 27 Sep 2018 11:53:38 -0700
From: tip-bot for Peter Zijlstra <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: peterz@...radead.org, hpa@...or.com, linux-kernel@...r.kernel.org,
dave.hansen@...el.com, tglx@...utronix.de, mingo@...nel.org,
mark.gross@...el.com, bin.yang@...el.com
Subject: [tip:x86/mm] x86/mm/cpa: Use flush_tlb_kernel_range()
Commit-ID: a7295fd53c39ce781a9792c9dd2c8747bf274160
Gitweb: https://git.kernel.org/tip/a7295fd53c39ce781a9792c9dd2c8747bf274160
Author: Peter Zijlstra <peterz@...radead.org>
AuthorDate: Wed, 19 Sep 2018 10:50:20 +0200
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Thu, 27 Sep 2018 20:39:41 +0200
x86/mm/cpa: Use flush_tlb_kernel_range()
Both cpa_flush_range() and cpa_flush_array() have a well specified
range, use that to do a range based TLB invalidate.
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Reviewed-by: Dave Hansen <dave.hansen@...el.com>
Cc: Bin Yang <bin.yang@...el.com>
Cc: Mark Gross <mark.gross@...el.com>
Link: https://lkml.kernel.org/r/20180919085947.985193217@infradead.org
---
arch/x86/mm/pageattr.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index bd9b0ac07352..02eb18403594 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -293,7 +293,7 @@ static void cpa_flush_range(unsigned long start, int numpages, int cache)
BUG_ON(irqs_disabled() && !early_boot_irqs_disabled);
WARN_ON(PAGE_ALIGN(start) != start);
- flush_tlb_all();
+ flush_tlb_kernel_range(start, start + PAGE_SIZE * numpages);
if (!cache)
return;
@@ -315,14 +315,15 @@ static void cpa_flush_range(unsigned long start, int numpages, int cache)
}
}
-static void cpa_flush_array(unsigned long *start, int numpages, int cache,
+static void cpa_flush_array(unsigned long baddr, unsigned long *start,
+ int numpages, int cache,
int in_flags, struct page **pages)
{
unsigned int i, level;
BUG_ON(irqs_disabled() && !early_boot_irqs_disabled);
- flush_tlb_all();
+ flush_tlb_kernel_range(baddr, baddr + PAGE_SIZE * numpages);
if (!cache)
return;
@@ -1757,7 +1758,7 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages,
*/
if (!ret && boot_cpu_has(X86_FEATURE_CLFLUSH)) {
if (cpa.flags & (CPA_PAGES_ARRAY | CPA_ARRAY)) {
- cpa_flush_array(addr, numpages, cache,
+ cpa_flush_array(baddr, addr, numpages, cache,
cpa.flags, pages);
} else
cpa_flush_range(baddr, numpages, cache);
Powered by blists - more mailing lists