Re: [PATCH 3/5] MIPS: Only change $28 to thread_info if coming from user mode

2016-12-05 Thread Maciej W. Rozycki
On Mon, 5 Dec 2016, Paul Burton wrote: > Agreed we ought to use .set reorder (or rather, not use .set noreorder) > wherever possible but FYI one thing I've only noticed recently is that we > don't actually get any reordering anyway, presumably because we don't provide > any -O flags when

Re: [PATCH 3/5] MIPS: Only change $28 to thread_info if coming from user mode

2016-12-05 Thread Maciej W. Rozycki
On Mon, 5 Dec 2016, Paul Burton wrote: > Agreed we ought to use .set reorder (or rather, not use .set noreorder) > wherever possible but FYI one thing I've only noticed recently is that we > don't actually get any reordering anyway, presumably because we don't provide > any -O flags when

Re: [PATCH 3/5] MIPS: Only change $28 to thread_info if coming from user mode

2016-12-05 Thread Paul Burton
Hi Maciej, > Overall I think all code should be using the (default) > `.set reorder' mode, perhaps forced explicitly in case these macros are > pasted into `.set noreorder' code, to make it easier to avoid subtle data > dependency bugs, and also to make R6 porting easier. Except maybe for the

Re: [PATCH 3/5] MIPS: Only change $28 to thread_info if coming from user mode

2016-12-05 Thread Paul Burton
Hi Maciej, > Overall I think all code should be using the (default) > `.set reorder' mode, perhaps forced explicitly in case these macros are > pasted into `.set noreorder' code, to make it easier to avoid subtle data > dependency bugs, and also to make R6 porting easier. Except maybe for the

Re: [PATCH 3/5] MIPS: Only change $28 to thread_info if coming from user mode

2016-12-05 Thread Maciej W. Rozycki
On Mon, 5 Dec 2016, Matt Redfearn wrote: > Ah yes, I missed the .set reorder above the EVA ifdef and just included the > .set reorder as the similar snippet here: > http://lxr.free-electrons.com/source/arch/mips/include/asm/stackframe.h#L149 That's a global `.set reorder' for the whole of

Re: [PATCH 3/5] MIPS: Only change $28 to thread_info if coming from user mode

2016-12-05 Thread Maciej W. Rozycki
On Mon, 5 Dec 2016, Matt Redfearn wrote: > Ah yes, I missed the .set reorder above the EVA ifdef and just included the > .set reorder as the similar snippet here: > http://lxr.free-electrons.com/source/arch/mips/include/asm/stackframe.h#L149 That's a global `.set reorder' for the whole of

Re: [PATCH 3/5] MIPS: Only change $28 to thread_info if coming from user mode

2016-12-05 Thread Matt Redfearn
Hi Maciej, On 05/12/16 16:20, Maciej W. Rozycki wrote: On Fri, 2 Dec 2016, Matt Redfearn wrote: diff --git a/arch/mips/include/asm/stackframe.h b/arch/mips/include/asm/stackframe.h index eebf39549606..5782fa3d63be 100644 --- a/arch/mips/include/asm/stackframe.h +++

Re: [PATCH 3/5] MIPS: Only change $28 to thread_info if coming from user mode

2016-12-05 Thread Matt Redfearn
Hi Maciej, On 05/12/16 16:20, Maciej W. Rozycki wrote: On Fri, 2 Dec 2016, Matt Redfearn wrote: diff --git a/arch/mips/include/asm/stackframe.h b/arch/mips/include/asm/stackframe.h index eebf39549606..5782fa3d63be 100644 --- a/arch/mips/include/asm/stackframe.h +++

Re: [PATCH 3/5] MIPS: Only change $28 to thread_info if coming from user mode

2016-12-05 Thread Maciej W. Rozycki
On Fri, 2 Dec 2016, Matt Redfearn wrote: > diff --git a/arch/mips/include/asm/stackframe.h > b/arch/mips/include/asm/stackframe.h > index eebf39549606..5782fa3d63be 100644 > --- a/arch/mips/include/asm/stackframe.h > +++ b/arch/mips/include/asm/stackframe.h > @@ -216,12 +216,22 @@ >

Re: [PATCH 3/5] MIPS: Only change $28 to thread_info if coming from user mode

2016-12-05 Thread Maciej W. Rozycki
On Fri, 2 Dec 2016, Matt Redfearn wrote: > diff --git a/arch/mips/include/asm/stackframe.h > b/arch/mips/include/asm/stackframe.h > index eebf39549606..5782fa3d63be 100644 > --- a/arch/mips/include/asm/stackframe.h > +++ b/arch/mips/include/asm/stackframe.h > @@ -216,12 +216,22 @@ >

[PATCH 3/5] MIPS: Only change $28 to thread_info if coming from user mode

2016-12-02 Thread Matt Redfearn
The SAVE_SOME macro is used to save the execution context on all exceptions. If an exception occurs while executing user code, the stack is switched to the kernel's stack for the current task, and register $28 is switched to point to the current_thread_info, which is at the bottom of the stack

[PATCH 3/5] MIPS: Only change $28 to thread_info if coming from user mode

2016-12-02 Thread Matt Redfearn
The SAVE_SOME macro is used to save the execution context on all exceptions. If an exception occurs while executing user code, the stack is switched to the kernel's stack for the current task, and register $28 is switched to point to the current_thread_info, which is at the bottom of the stack