Re: [PATCH 1/3] perf/core: Make sure the ring-buffer is mapped in all page-tables

2018-07-21 Thread Linus Torvalds
On Fri, Jul 20, 2018 at 3:20 PM Andy Lutomirski wrote: > Thanks for digging! The problem was presumably that vmalloc_fault() will > IRET and re-enable NMIs on the way out. > But we’ve supported page faults on user memory in NMI handlers on 32-bit and > 64-bit for quite a while, and it’s fine n

Re: [PATCH 1/3] perf/core: Make sure the ring-buffer is mapped in all page-tables

2018-07-20 Thread Andy Lutomirski
> On Jul 20, 2018, at 11:37 AM, Joerg Roedel wrote: > >> On Fri, Jul 20, 2018 at 12:32:10PM -0700, Andy Lutomirski wrote: >> I'm just reading your changelog, and you said the PMDs are no longer >> shared between the page tables. So this presumably means that >> vmalloc_fault() no longer actual

Re: [PATCH 1/3] perf/core: Make sure the ring-buffer is mapped in all page-tables

2018-07-20 Thread Joerg Roedel
On Fri, Jul 20, 2018 at 12:32:10PM -0700, Andy Lutomirski wrote: > I'm just reading your changelog, and you said the PMDs are no longer > shared between the page tables. So this presumably means that > vmalloc_fault() no longer actually works correctly on PTI systems. I > didn't read the code to

Re: [PATCH 1/3] perf/core: Make sure the ring-buffer is mapped in all page-tables

2018-07-20 Thread Thomas Gleixner
On Fri, 20 Jul 2018, Thomas Gleixner wrote: > On Fri, 20 Jul 2018, Andy Lutomirski wrote: > > On Fri, Jul 20, 2018 at 12:27 PM, Thomas Gleixner > > wrote: > > > On Fri, 20 Jul 2018, Andy Lutomirski wrote: > > >> > On Jul 20, 2018, at 6:22 AM, Joerg Roedel wrote: > > >> > > > >> > From: Joerg Roe

Re: [PATCH 1/3] perf/core: Make sure the ring-buffer is mapped in all page-tables

2018-07-20 Thread Thomas Gleixner
On Fri, 20 Jul 2018, Andy Lutomirski wrote: > On Fri, Jul 20, 2018 at 12:27 PM, Thomas Gleixner wrote: > > On Fri, 20 Jul 2018, Andy Lutomirski wrote: > >> > On Jul 20, 2018, at 6:22 AM, Joerg Roedel wrote: > >> > > >> > From: Joerg Roedel > >> > > >> > The ring-buffer is accessed in the NMI han

Re: [PATCH 1/3] perf/core: Make sure the ring-buffer is mapped in all page-tables

2018-07-20 Thread Andy Lutomirski
On Fri, Jul 20, 2018 at 12:27 PM, Thomas Gleixner wrote: > On Fri, 20 Jul 2018, Andy Lutomirski wrote: >> > On Jul 20, 2018, at 6:22 AM, Joerg Roedel wrote: >> > >> > From: Joerg Roedel >> > >> > The ring-buffer is accessed in the NMI handler, so we better >> > avoid faulting on it. Sync the vma

Re: [PATCH 1/3] perf/core: Make sure the ring-buffer is mapped in all page-tables

2018-07-20 Thread Andy Lutomirski
On Fri, Jul 20, 2018 at 10:48 AM, Joerg Roedel wrote: > On Fri, Jul 20, 2018 at 10:06:54AM -0700, Andy Lutomirski wrote: >> > On Jul 20, 2018, at 6:22 AM, Joerg Roedel wrote: >> > >> > From: Joerg Roedel >> > >> > The ring-buffer is accessed in the NMI handler, so we better >> > avoid faulting o

Re: [PATCH 1/3] perf/core: Make sure the ring-buffer is mapped in all page-tables

2018-07-20 Thread Thomas Gleixner
On Fri, 20 Jul 2018, Andy Lutomirski wrote: > > On Jul 20, 2018, at 6:22 AM, Joerg Roedel wrote: > > > > From: Joerg Roedel > > > > The ring-buffer is accessed in the NMI handler, so we better > > avoid faulting on it. Sync the vmalloc range with all > > page-tables in system to make sure everyon

Re: [PATCH 1/3] perf/core: Make sure the ring-buffer is mapped in all page-tables

2018-07-20 Thread Joerg Roedel
On Fri, Jul 20, 2018 at 10:06:54AM -0700, Andy Lutomirski wrote: > > On Jul 20, 2018, at 6:22 AM, Joerg Roedel wrote: > > > > From: Joerg Roedel > > > > The ring-buffer is accessed in the NMI handler, so we better > > avoid faulting on it. Sync the vmalloc range with all > > page-tables in system

Re: [PATCH 1/3] perf/core: Make sure the ring-buffer is mapped in all page-tables

2018-07-20 Thread Andy Lutomirski
> On Jul 20, 2018, at 6:22 AM, Joerg Roedel wrote: > > From: Joerg Roedel > > The ring-buffer is accessed in the NMI handler, so we better > avoid faulting on it. Sync the vmalloc range with all > page-tables in system to make sure everyone has it mapped. > > This fixes a WARN_ON_ONCE() that can

[PATCH 1/3] perf/core: Make sure the ring-buffer is mapped in all page-tables

2018-07-20 Thread Joerg Roedel
From: Joerg Roedel The ring-buffer is accessed in the NMI handler, so we better avoid faulting on it. Sync the vmalloc range with all page-tables in system to make sure everyone has it mapped. This fixes a WARN_ON_ONCE() that can be triggered with PTI enabled on x86-32: WARNING: CPU: 4