Re: [PATCH v3 01/11] x86/mm: Don't reenter flush_tlb_func_common()

2017-06-22 Thread Ingo Molnar
* Andy Lutomirski wrote: > On Wed, Jun 21, 2017 at 4:26 PM, Nadav Amit wrote: > > Andy Lutomirski wrote: > > > >> index 2a5e851f2035..f06239c6919f 100644 > >> --- a/arch/x86/mm/tlb.c > >> +++ b/arch/x86/mm/tlb.c > >> @@ -208,6 +208,9 @@

Re: [PATCH v3 01/11] x86/mm: Don't reenter flush_tlb_func_common()

2017-06-22 Thread Ingo Molnar
* Andy Lutomirski wrote: > On Wed, Jun 21, 2017 at 4:26 PM, Nadav Amit wrote: > > Andy Lutomirski wrote: > > > >> index 2a5e851f2035..f06239c6919f 100644 > >> --- a/arch/x86/mm/tlb.c > >> +++ b/arch/x86/mm/tlb.c > >> @@ -208,6 +208,9 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct

Re: [PATCH v3 01/11] x86/mm: Don't reenter flush_tlb_func_common()

2017-06-21 Thread Andy Lutomirski
On Wed, Jun 21, 2017 at 4:26 PM, Nadav Amit wrote: > Andy Lutomirski wrote: > >> index 2a5e851f2035..f06239c6919f 100644 >> --- a/arch/x86/mm/tlb.c >> +++ b/arch/x86/mm/tlb.c >> @@ -208,6 +208,9 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct >>

Re: [PATCH v3 01/11] x86/mm: Don't reenter flush_tlb_func_common()

2017-06-21 Thread Andy Lutomirski
On Wed, Jun 21, 2017 at 4:26 PM, Nadav Amit wrote: > Andy Lutomirski wrote: > >> index 2a5e851f2035..f06239c6919f 100644 >> --- a/arch/x86/mm/tlb.c >> +++ b/arch/x86/mm/tlb.c >> @@ -208,6 +208,9 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct >> mm_struct *next, >> static void

Re: [PATCH v3 01/11] x86/mm: Don't reenter flush_tlb_func_common()

2017-06-21 Thread Nadav Amit
Andy Lutomirski wrote: > index 2a5e851f2035..f06239c6919f 100644 > --- a/arch/x86/mm/tlb.c > +++ b/arch/x86/mm/tlb.c > @@ -208,6 +208,9 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct > mm_struct *next, > static void flush_tlb_func_common(const struct flush_tlb_info

Re: [PATCH v3 01/11] x86/mm: Don't reenter flush_tlb_func_common()

2017-06-21 Thread Nadav Amit
Andy Lutomirski wrote: > index 2a5e851f2035..f06239c6919f 100644 > --- a/arch/x86/mm/tlb.c > +++ b/arch/x86/mm/tlb.c > @@ -208,6 +208,9 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct > mm_struct *next, > static void flush_tlb_func_common(const struct flush_tlb_info *f, >

Re: [PATCH v3 01/11] x86/mm: Don't reenter flush_tlb_func_common()

2017-06-21 Thread Andy Lutomirski
On Wed, Jun 21, 2017 at 1:49 AM, Borislav Petkov wrote: > On Tue, Jun 20, 2017 at 10:22:07PM -0700, Andy Lutomirski wrote: >> It was historically possible to have two concurrent TLB flushes >> targetting the same CPU: one initiated locally and one initiated >> remotely. This can

Re: [PATCH v3 01/11] x86/mm: Don't reenter flush_tlb_func_common()

2017-06-21 Thread Andy Lutomirski
On Wed, Jun 21, 2017 at 1:49 AM, Borislav Petkov wrote: > On Tue, Jun 20, 2017 at 10:22:07PM -0700, Andy Lutomirski wrote: >> It was historically possible to have two concurrent TLB flushes >> targetting the same CPU: one initiated locally and one initiated >> remotely. This can now cause an

Re: [PATCH v3 01/11] x86/mm: Don't reenter flush_tlb_func_common()

2017-06-21 Thread Borislav Petkov
On Tue, Jun 20, 2017 at 10:22:07PM -0700, Andy Lutomirski wrote: > It was historically possible to have two concurrent TLB flushes > targetting the same CPU: one initiated locally and one initiated > remotely. This can now cause an OOPS in leave_mm() at > arch/x86/mm/tlb.c:47: > > if

Re: [PATCH v3 01/11] x86/mm: Don't reenter flush_tlb_func_common()

2017-06-21 Thread Borislav Petkov
On Tue, Jun 20, 2017 at 10:22:07PM -0700, Andy Lutomirski wrote: > It was historically possible to have two concurrent TLB flushes > targetting the same CPU: one initiated locally and one initiated > remotely. This can now cause an OOPS in leave_mm() at > arch/x86/mm/tlb.c:47: > > if

Re: [PATCH v3 01/11] x86/mm: Don't reenter flush_tlb_func_common()

2017-06-21 Thread Thomas Gleixner
On Tue, 20 Jun 2017, Andy Lutomirski wrote: > Nadav noticed the reentrancy issue in a different context, but > neither of us realized that it caused a problem yet. > > Cc: Nadav Amit > Cc: Dave Hansen > Reported-by: "Levin, Alexander (Sasha Levin)"

Re: [PATCH v3 01/11] x86/mm: Don't reenter flush_tlb_func_common()

2017-06-21 Thread Thomas Gleixner
On Tue, 20 Jun 2017, Andy Lutomirski wrote: > Nadav noticed the reentrancy issue in a different context, but > neither of us realized that it caused a problem yet. > > Cc: Nadav Amit > Cc: Dave Hansen > Reported-by: "Levin, Alexander (Sasha Levin)" > Fixes: 3d28ebceaffa ("x86/mm: Rework lazy

[PATCH v3 01/11] x86/mm: Don't reenter flush_tlb_func_common()

2017-06-20 Thread Andy Lutomirski
It was historically possible to have two concurrent TLB flushes targetting the same CPU: one initiated locally and one initiated remotely. This can now cause an OOPS in leave_mm() at arch/x86/mm/tlb.c:47: if (this_cpu_read(cpu_tlbstate.state) == TLBSTATE_OK) BUG(); with

[PATCH v3 01/11] x86/mm: Don't reenter flush_tlb_func_common()

2017-06-20 Thread Andy Lutomirski
It was historically possible to have two concurrent TLB flushes targetting the same CPU: one initiated locally and one initiated remotely. This can now cause an OOPS in leave_mm() at arch/x86/mm/tlb.c:47: if (this_cpu_read(cpu_tlbstate.state) == TLBSTATE_OK) BUG(); with