Re: [RFC][PATCH 5/8] x86/mm: fix exception table comments

2018-09-10 Thread Sean Christopherson
On Fri, 2018-09-07 at 14:51 -0700, Dave Hansen wrote: > > > > > > > > +  * Only do the expensive exception table search when we might be at > > > +  * risk of a deadlock: > > > +  * 1. We failed to acquire mmap_sem, and > > > +  * 2. The access was an explicit kernel-mode access > > > +  *

Re: [RFC][PATCH 5/8] x86/mm: fix exception table comments

2018-09-10 Thread Sean Christopherson
On Fri, 2018-09-07 at 14:51 -0700, Dave Hansen wrote: > > > > > > > > +  * Only do the expensive exception table search when we might be at > > > +  * risk of a deadlock: > > > +  * 1. We failed to acquire mmap_sem, and > > > +  * 2. The access was an explicit kernel-mode access > > > +  *

Re: [RFC][PATCH 5/8] x86/mm: fix exception table comments

2018-09-07 Thread Jann Horn
On Sat, Sep 8, 2018 at 2:22 AM Dave Hansen wrote: > +* Kernel-mode access to the user address space should only occur > +* inside well-defined areas of code listed in the exception Actually, not areas, but single whitelisted instructions. It would probably be nice to say that

Re: [RFC][PATCH 5/8] x86/mm: fix exception table comments

2018-09-07 Thread Jann Horn
On Sat, Sep 8, 2018 at 2:22 AM Dave Hansen wrote: > +* Kernel-mode access to the user address space should only occur > +* inside well-defined areas of code listed in the exception Actually, not areas, but single whitelisted instructions. It would probably be nice to say that

Re: [RFC][PATCH 5/8] x86/mm: fix exception table comments

2018-09-07 Thread Dave Hansen
>> + * Only do the expensive exception table search when we might be at >> + * risk of a deadlock: >> + * 1. We failed to acquire mmap_sem, and >> + * 2. The access was an explicit kernel-mode access >> + *(X86_PF_USER=0). > > Might be worth reminding the reader that

Re: [RFC][PATCH 5/8] x86/mm: fix exception table comments

2018-09-07 Thread Dave Hansen
>> + * Only do the expensive exception table search when we might be at >> + * risk of a deadlock: >> + * 1. We failed to acquire mmap_sem, and >> + * 2. The access was an explicit kernel-mode access >> + *(X86_PF_USER=0). > > Might be worth reminding the reader that

Re: [RFC][PATCH 5/8] x86/mm: fix exception table comments

2018-09-07 Thread Sean Christopherson
On Fri, 2018-09-07 at 12:49 -0700, Dave Hansen wrote: > From: Dave Hansen > > The comments here are wrong.  They are too absolute about where > faults can occur when running in the kernel.  The comments are > also a bit hard to match up with the code. > > Trim down the comments, and make them

Re: [RFC][PATCH 5/8] x86/mm: fix exception table comments

2018-09-07 Thread Sean Christopherson
On Fri, 2018-09-07 at 12:49 -0700, Dave Hansen wrote: > From: Dave Hansen > > The comments here are wrong.  They are too absolute about where > faults can occur when running in the kernel.  The comments are > also a bit hard to match up with the code. > > Trim down the comments, and make them

[RFC][PATCH 5/8] x86/mm: fix exception table comments

2018-09-07 Thread Dave Hansen
From: Dave Hansen The comments here are wrong. They are too absolute about where faults can occur when running in the kernel. The comments are also a bit hard to match up with the code. Trim down the comments, and make them more precise. Also add a comment explaining why we are doing the

[RFC][PATCH 5/8] x86/mm: fix exception table comments

2018-09-07 Thread Dave Hansen
From: Dave Hansen The comments here are wrong. They are too absolute about where faults can occur when running in the kernel. The comments are also a bit hard to match up with the code. Trim down the comments, and make them more precise. Also add a comment explaining why we are doing the