Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1628795

[PATCH v3 4/4] x86/mm: Fix flush_tlb_page() on Xen

From Andy Lutomirski <luto@kernel.org>
Newsgroups linux.kernel
Subject [PATCH v3 4/4] x86/mm: Fix flush_tlb_page() on Xen
Date 2017-04-22 09:10 +0200
Message-ID <tyXl8-8cH-5@gated-at.bofh.it> (permalink)
References <tyXl7-8cH-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


flush_tlb_page() passes a bogus range to flush_tlb_others() and
expects the latter to fix it up.  native_flush_tlb_others() has the
fixup but Xen's version doesn't.  Move the fixup to
flush_tlb_others().

AFAICS the only real effect is that, without this fix, Xen would
flush everything instead of just the one page on remote vCPUs in
when flush_tlb_page() was called.

Cc: Rik van Riel <riel@redhat.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Nadav Amit <namit@vmware.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Juergen Gross <jgross@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Fixes: e7b52ffd45a6 ("x86/flush_tlb: try flush_tlb_single one by one in flush_tlb_range")
Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 arch/x86/mm/tlb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 9db9260a5e9f..6e7bedf69af7 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -263,8 +263,6 @@ void native_flush_tlb_others(const struct cpumask *cpumask,
 {
 	struct flush_tlb_info info;
 
-	if (end == 0)
-		end = start + PAGE_SIZE;
 	info.flush_mm = mm;
 	info.flush_start = start;
 	info.flush_end = end;
@@ -378,7 +376,7 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long start)
 	}
 
 	if (cpumask_any_but(mm_cpumask(mm), smp_processor_id()) < nr_cpu_ids)
-		flush_tlb_others(mm_cpumask(mm), mm, start, 0UL);
+		flush_tlb_others(mm_cpumask(mm), mm, start, start + PAGE_SIZE);
 
 	preempt_enable();
 }
-- 
2.9.3

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/4] x86/mm: Straightforward TLB flush fixes/cleanups Andy Lutomirski <luto@kernel.org> - 2017-04-22 09:10 +0200
  [PATCH v3 4/4] x86/mm: Fix flush_tlb_page() on Xen Andy Lutomirski <luto@kernel.org> - 2017-04-22 09:10 +0200
  [PATCH v3 2/4] x86/mm: Remove flush_tlb() and flush_tlb_current_task() Andy Lutomirski <luto@kernel.org> - 2017-04-22 09:10 +0200
  [PATCH v3 3/4] x86/mm: Make flush_tlb_mm_range() more predictable Andy Lutomirski <luto@kernel.org> - 2017-04-22 09:10 +0200
  [PATCH v3 1/4] x86/vm86/32: Switch to flush_tlb_mm_range() in mark_screen_rdonly() Andy Lutomirski <luto@kernel.org> - 2017-04-22 09:10 +0200

csiph-web