Re: [PATCH 2/3] MIPS: Setup an instruction emulation in VDSO protected page instead of user stack

2014-10-06 Thread Leonid Yegoshin
On 10/06/2014 05:29 AM, Paul Burton wrote: First some general questions: is there any reason to need the page used to be at the same virtual address for each thread? I can't think of one, and if that's the case then why not simply allocate a series of pages per-thread via mmap_region or similar

Re: [PATCH 2/3] MIPS: Setup an instruction emulation in VDSO protected page instead of user stack

2014-10-06 Thread Leonid Yegoshin
On 10/06/2014 11:05 AM, David Daney wrote: On 10/03/2014 08:17 PM, Leonid Yegoshin wrote: Historically, during FPU emulation MIPS runs live BD-slot instruction in stack. This is needed because it was the only way to correctly handle branch exceptions with unknown COP2 instructions in BD-slot. N

Re: [PATCH 2/3] MIPS: Setup an instruction emulation in VDSO protected page instead of user stack

2014-10-06 Thread David Daney
On 10/03/2014 08:17 PM, Leonid Yegoshin wrote: Historically, during FPU emulation MIPS runs live BD-slot instruction in stack. This is needed because it was the only way to correctly handle branch exceptions with unknown COP2 instructions in BD-slot. Now there is an eXecuteInhibit feature and it

Re: [PATCH 2/3] MIPS: Setup an instruction emulation in VDSO protected page instead of user stack

2014-10-06 Thread Paul Burton
On Fri, Oct 03, 2014 at 08:17:30PM -0700, Leonid Yegoshin wrote: > Historically, during FPU emulation MIPS runs live BD-slot instruction in > stack. > This is needed because it was the only way to correctly handle branch > exceptions with unknown COP2 instructions in BD-slot. Now there is > an eXe

RE: [PATCH 2/3] MIPS: Setup an instruction emulation in VDSO protected page instead of user stack

2014-10-04 Thread Leonid Yegoshin
From: Peter Zijlstra [pet...@infradead.org]: >On Fri, Oct 03, 2014 at 08:17:30PM -0700, Leonid Yegoshin wrote: >> --- a/arch/mips/include/asm/switch_to.h > >+++ b/arch/mips/include/asm/switch_to.h >Why raw_smp_processor_id() and why evaluate it 3 times, sure compilers >can be expected to do some

Re: [PATCH 2/3] MIPS: Setup an instruction emulation in VDSO protected page instead of user stack

2014-10-04 Thread Peter Zijlstra
On Fri, Oct 03, 2014 at 08:17:30PM -0700, Leonid Yegoshin wrote: > --- a/arch/mips/include/asm/switch_to.h > +++ b/arch/mips/include/asm/switch_to.h > @@ -17,6 +17,7 @@ > #include > #include > #include > +#include > > struct task_struct; > > @@ -104,6 +105,16 @@ do {

[PATCH 2/3] MIPS: Setup an instruction emulation in VDSO protected page instead of user stack

2014-10-03 Thread Leonid Yegoshin
Historically, during FPU emulation MIPS runs live BD-slot instruction in stack. This is needed because it was the only way to correctly handle branch exceptions with unknown COP2 instructions in BD-slot. Now there is an eXecuteInhibit feature and it is desirable to protect stack from execution for