Re: cxl: fix setting of _PAGE_USER bit when handling page faults

2016-04-12 Thread Michael Ellerman
On Mon, 2016-04-11 at 19:12 +0530, Aneesh Kumar K.V wrote: > Michael Ellerman writes: > > > > In this case it *looks* like we have a giant hole in the mm handling for > > CAPI > > contexts, which would let userspace create mappings of kernel memory with > > _PAGE_USER set. I think I agree with I

Re: cxl: fix setting of _PAGE_USER bit when handling page faults

2016-04-11 Thread Aneesh Kumar K.V
Michael Ellerman writes: > On Mon, 2016-04-11 at 10:01 +0530, Aneesh Kumar K.V wrote: >> Michael Ellerman writes: >> > On Mon, 2016-04-11 at 14:10 +1000, Andrew Donnellan wrote: >> > > On 29/03/16 00:42, Aneesh Kumar K.V wrote: >> > > > I noticed this when doing radix support and have a variant

Re: cxl: fix setting of _PAGE_USER bit when handling page faults

2016-04-11 Thread Michael Ellerman
On Mon, 2016-04-11 at 10:01 +0530, Aneesh Kumar K.V wrote: > Michael Ellerman writes: > > On Mon, 2016-04-11 at 14:10 +1000, Andrew Donnellan wrote: > > > On 29/03/16 00:42, Aneesh Kumar K.V wrote: > > > > I noticed this when doing radix support and have a variant posted at > > > > > > > > https:

Re: cxl: fix setting of _PAGE_USER bit when handling page faults

2016-04-10 Thread Aneesh Kumar K.V
Michael Ellerman writes: > On Mon, 2016-04-11 at 14:10 +1000, Andrew Donnellan wrote: >> On 29/03/16 00:42, Aneesh Kumar K.V wrote: >> > I noticed this when doing radix support and have a variant posted at >> > >> > https://lists.ozlabs.org/pipermail/linuxppc-dev/2016-March/141036.html >> >> I'

Re: cxl: fix setting of _PAGE_USER bit when handling page faults

2016-04-10 Thread Michael Ellerman
On Mon, 2016-04-11 at 14:10 +1000, Andrew Donnellan wrote: > On 29/03/16 00:42, Aneesh Kumar K.V wrote: > > I noticed this when doing radix support and have a variant posted at > > > > https://lists.ozlabs.org/pipermail/linuxppc-dev/2016-March/141036.html > > I'm happy for this to be fixed in you

Re: cxl: fix setting of _PAGE_USER bit when handling page faults

2016-04-10 Thread Andrew Donnellan
On 29/03/16 00:42, Aneesh Kumar K.V wrote: I noticed this when doing radix support and have a variant posted at https://lists.ozlabs.org/pipermail/linuxppc-dev/2016-March/141036.html I'm happy for this to be fixed in your radix series. -- Andrew Donnellan OzLabs, ADL Canberra and

Re: [PATCH] cxl: fix setting of _PAGE_USER bit when handling page faults

2016-03-29 Thread Matthew R. Ochs
> On Mar 17, 2016, at 11:01 PM, Andrew Donnellan > wrote: > > When handling page faults, cxl_handle_page_fault() checks whether the page > should be accessible by userspace and have its _PAGE_USER access bit set. > _PAGE_USER should be set if the context's kernel flag isn't set, or if the > page

Re: cxl: fix setting of _PAGE_USER bit when handling page faults

2016-03-28 Thread Aneesh Kumar K.V
"Aneesh Kumar K.V" writes: > [ text/plain ] > Michael Ellerman writes: > >> [ text/plain ] >> On Fri, 2016-18-03 at 04:01:21 UTC, Andrew Donnellan wrote: >>> When handling page faults, cxl_handle_page_fault() checks whether the page >>> should be accessible by userspace and have its _PAGE_USER a

Re: cxl: fix setting of _PAGE_USER bit when handling page faults

2016-03-28 Thread Aneesh Kumar K.V
Michael Ellerman writes: > [ text/plain ] > On Fri, 2016-18-03 at 04:01:21 UTC, Andrew Donnellan wrote: >> When handling page faults, cxl_handle_page_fault() checks whether the page >> should be accessible by userspace and have its _PAGE_USER access bit set. >> _PAGE_USER should be set if the con

Re: cxl: fix setting of _PAGE_USER bit when handling page faults

2016-03-25 Thread Ian Munsie
Excerpts from Michael Ellerman's message of 2016-03-25 05:01:38 -0500: > I think you can (should) use is_kernel_addr() for the DAR check. > > I'm also slightly worried by that logic in the case of a non-kernel context. > > ie. if ctx->kernel is false, we get: > > if (true || !is_kernel_addr(

Re: cxl: fix setting of _PAGE_USER bit when handling page faults

2016-03-25 Thread Michael Ellerman
On Fri, 2016-18-03 at 04:01:21 UTC, Andrew Donnellan wrote: > When handling page faults, cxl_handle_page_fault() checks whether the page > should be accessible by userspace and have its _PAGE_USER access bit set. > _PAGE_USER should be set if the context's kernel flag isn't set, or if the > page fa

Re: [PATCH] cxl: fix setting of _PAGE_USER bit when handling page faults

2016-03-20 Thread Andrew Donnellan
On 18/03/16 17:30, Ian Munsie wrote: Excerpts from andrew.donnellan's message of 2016-03-18 15:01:21 +1100: Fixes: f204e0b8cedd ("cxl: Driver code for powernv PCIe based cards for userspace access") It doesn't fix that since there was no cxl kernel API support at the time, so this wasn't a reg

Re: [PATCH] cxl: fix setting of _PAGE_USER bit when handling page faults

2016-03-20 Thread Ian Munsie
Excerpts from andrew.donnellan's message of 2016-03-18 15:01:21 +1100: > Fixes: f204e0b8cedd ("cxl: Driver code for powernv PCIe based cards for > userspace access") It doesn't fix that since there was no cxl kernel API support at the time, so this wasn't a regression - just something we missed wh

[PATCH] cxl: fix setting of _PAGE_USER bit when handling page faults

2016-03-19 Thread Andrew Donnellan
When handling page faults, cxl_handle_page_fault() checks whether the page should be accessible by userspace and have its _PAGE_USER access bit set. _PAGE_USER should be set if the context's kernel flag isn't set, or if the page falls outside of kernel memory. However, the check currently uses the