Skip to content

Commit 5d650fc

Browse files
amlutogregkh
authored andcommitted
x86/mm: Fix flush_tlb_page() on Xen
commit dbd68d8e84c606673ebbcf15862f8c155fa92326 upstream. 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 <luto@kernel.org> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Juergen Gross <jgross@suse.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Michal Hocko <mhocko@suse.com> Cc: Nadav Amit <namit@vmware.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rik van Riel <riel@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> 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 <mingo@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6fb3b32 commit 5d650fc

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

arch/x86/mm/tlb.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ void native_flush_tlb_others(const struct cpumask *cpumask,
134134
{
135135
struct flush_tlb_info info;
136136

137-
if (end == 0)
138-
end = start + PAGE_SIZE;
139137
info.flush_mm = mm;
140138
info.flush_start = start;
141139
info.flush_end = end;
@@ -264,7 +262,7 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long start)
264262
}
265263

266264
if (cpumask_any_but(mm_cpumask(mm), smp_processor_id()) < nr_cpu_ids)
267-
flush_tlb_others(mm_cpumask(mm), mm, start, 0UL);
265+
flush_tlb_others(mm_cpumask(mm), mm, start, start + PAGE_SIZE);
268266

269267
preempt_enable();
270268
}

0 commit comments

Comments
 (0)