Skip to content

Commit dbd68d8

Browse files
amlutoIngo Molnar
authored andcommitted
x86/mm: Fix flush_tlb_page() on Xen
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. Signed-off-by: Andy Lutomirski <[email protected]> Reviewed-by: Boris Ostrovsky <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Brian Gerst <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Juergen Gross <[email protected]> Cc: Konrad Rzeszutek Wilk <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Nadav Amit <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Thomas Gleixner <[email protected]> Fixes: e7b52ff ("x86/flush_tlb: try flush_tlb_single one by one in flush_tlb_range") Link: http://lkml.kernel.org/r/10ed0e4dfea64daef10b87fb85df1746999b4dba.1492844372.git.luto@kernel.org Signed-off-by: Ingo Molnar <[email protected]>
1 parent ce27374 commit dbd68d8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

arch/x86/mm/tlb.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,6 @@ void native_flush_tlb_others(const struct cpumask *cpumask,
263263
{
264264
struct flush_tlb_info info;
265265

266-
if (end == 0)
267-
end = start + PAGE_SIZE;
268266
info.flush_mm = mm;
269267
info.flush_start = start;
270268
info.flush_end = end;
@@ -378,7 +376,7 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long start)
378376
}
379377

380378
if (cpumask_any_but(mm_cpumask(mm), smp_processor_id()) < nr_cpu_ids)
381-
flush_tlb_others(mm_cpumask(mm), mm, start, 0UL);
379+
flush_tlb_others(mm_cpumask(mm), mm, start, start + PAGE_SIZE);
382380

383381
preempt_enable();
384382
}

0 commit comments

Comments
 (0)