Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-06 Thread Christophe LEROY
Le 06/06/2017 à 13:00, Michael Ellerman a écrit : christophe leroy writes: Le 05/06/2017 à 12:45, Michael Ellerman a écrit : Christophe LEROY writes: Le 02/06/2017 à 11:26, Michael Ellerman a écrit : Christophe Leroy

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-06 Thread Christophe LEROY
Le 06/06/2017 à 13:00, Michael Ellerman a écrit : christophe leroy writes: Le 05/06/2017 à 12:45, Michael Ellerman a écrit : Christophe LEROY writes: Le 02/06/2017 à 11:26, Michael Ellerman a écrit : Christophe Leroy writes: Only the get_user() in store_updates_sp() has to be done

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-06 Thread Michael Ellerman
christophe leroy writes: > Le 05/06/2017 à 12:45, Michael Ellerman a écrit : >> Christophe LEROY writes: >> >>> Le 02/06/2017 à 11:26, Michael Ellerman a écrit : Christophe Leroy writes: > Only the

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-06 Thread Michael Ellerman
christophe leroy writes: > Le 05/06/2017 à 12:45, Michael Ellerman a écrit : >> Christophe LEROY writes: >> >>> Le 02/06/2017 à 11:26, Michael Ellerman a écrit : Christophe Leroy writes: > Only the get_user() in store_updates_sp() has to be done outside > the mm semaphore.

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-05 Thread christophe leroy
Le 05/06/2017 à 12:45, Michael Ellerman a écrit : Christophe LEROY writes: Le 02/06/2017 à 11:26, Michael Ellerman a écrit : Christophe Leroy writes: Only the get_user() in store_updates_sp() has to be done outside the mm semaphore. All

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-05 Thread christophe leroy
Le 05/06/2017 à 12:45, Michael Ellerman a écrit : Christophe LEROY writes: Le 02/06/2017 à 11:26, Michael Ellerman a écrit : Christophe Leroy writes: Only the get_user() in store_updates_sp() has to be done outside the mm semaphore. All the comparison can be done within the semaphore,

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-05 Thread Michael Ellerman
Christophe LEROY writes: > Le 02/06/2017 à 14:11, Benjamin Herrenschmidt a écrit : >> On Fri, 2017-06-02 at 11:39 +0200, Christophe LEROY wrote: >>> The difference between get_user() and __get_user() is that get_user() >>> performs an access_ok() in addition. >>> >>>

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-05 Thread Michael Ellerman
Christophe LEROY writes: > Le 02/06/2017 à 14:11, Benjamin Herrenschmidt a écrit : >> On Fri, 2017-06-02 at 11:39 +0200, Christophe LEROY wrote: >>> The difference between get_user() and __get_user() is that get_user() >>> performs an access_ok() in addition. >>> >>> Doesn't access_ok() only

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-05 Thread Michael Ellerman
Christophe LEROY writes: > Le 02/06/2017 à 11:26, Michael Ellerman a écrit : >> Christophe Leroy writes: >> >>> Only the get_user() in store_updates_sp() has to be done outside >>> the mm semaphore. All the comparison can be done within the

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-05 Thread Michael Ellerman
Christophe LEROY writes: > Le 02/06/2017 à 11:26, Michael Ellerman a écrit : >> Christophe Leroy writes: >> >>> Only the get_user() in store_updates_sp() has to be done outside >>> the mm semaphore. All the comparison can be done within the semaphore, >>> so only when really needed. >>> >>> As

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-02 Thread Christophe LEROY
Le 02/06/2017 à 14:11, Benjamin Herrenschmidt a écrit : On Fri, 2017-06-02 at 11:39 +0200, Christophe LEROY wrote: The difference between get_user() and __get_user() is that get_user() performs an access_ok() in addition. Doesn't access_ok() only checks whether addr is below TASK_SIZE to

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-02 Thread Christophe LEROY
Le 02/06/2017 à 14:11, Benjamin Herrenschmidt a écrit : On Fri, 2017-06-02 at 11:39 +0200, Christophe LEROY wrote: The difference between get_user() and __get_user() is that get_user() performs an access_ok() in addition. Doesn't access_ok() only checks whether addr is below TASK_SIZE to

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-02 Thread Benjamin Herrenschmidt
On Fri, 2017-06-02 at 11:39 +0200, Christophe LEROY wrote: > The difference between get_user() and __get_user() is that get_user() > performs an access_ok() in addition. > > Doesn't access_ok() only checks whether addr is below TASK_SIZE to > ensure it is a valid user address ? Do you have a

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-02 Thread Benjamin Herrenschmidt
On Fri, 2017-06-02 at 11:39 +0200, Christophe LEROY wrote: > The difference between get_user() and __get_user() is that get_user() > performs an access_ok() in addition. > > Doesn't access_ok() only checks whether addr is below TASK_SIZE to > ensure it is a valid user address ? Do you have a

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-02 Thread Christophe LEROY
Le 02/06/2017 à 11:26, Michael Ellerman a écrit : Christophe Leroy writes: Only the get_user() in store_updates_sp() has to be done outside the mm semaphore. All the comparison can be done within the semaphore, so only when really needed. As we got a DSI exception,

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-02 Thread Christophe LEROY
Le 02/06/2017 à 11:26, Michael Ellerman a écrit : Christophe Leroy writes: Only the get_user() in store_updates_sp() has to be done outside the mm semaphore. All the comparison can be done within the semaphore, so only when really needed. As we got a DSI exception, the address pointed by

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-02 Thread Michael Ellerman
Christophe Leroy writes: > Only the get_user() in store_updates_sp() has to be done outside > the mm semaphore. All the comparison can be done within the semaphore, > so only when really needed. > > As we got a DSI exception, the address pointed by regs->nip is >

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-02 Thread Michael Ellerman
Christophe Leroy writes: > Only the get_user() in store_updates_sp() has to be done outside > the mm semaphore. All the comparison can be done within the semaphore, > so only when really needed. > > As we got a DSI exception, the address pointed by regs->nip is > obviously valid, otherwise we

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-04-24 Thread Aneesh Kumar K.V
Christophe Leroy writes: > Only the get_user() in store_updates_sp() has to be done outside > the mm semaphore. All the comparison can be done within the semaphore, > so only when really needed. > > As we got a DSI exception, the address pointed by regs->nip is >

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-04-24 Thread Aneesh Kumar K.V
Christophe Leroy writes: > Only the get_user() in store_updates_sp() has to be done outside > the mm semaphore. All the comparison can be done within the semaphore, > so only when really needed. > > As we got a DSI exception, the address pointed by regs->nip is > obviously valid, otherwise we

[PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-04-19 Thread Christophe Leroy
Only the get_user() in store_updates_sp() has to be done outside the mm semaphore. All the comparison can be done within the semaphore, so only when really needed. As we got a DSI exception, the address pointed by regs->nip is obviously valid, otherwise we would have had a instruction exception.

[PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-04-19 Thread Christophe Leroy
Only the get_user() in store_updates_sp() has to be done outside the mm semaphore. All the comparison can be done within the semaphore, so only when really needed. As we got a DSI exception, the address pointed by regs->nip is obviously valid, otherwise we would have had a instruction exception.