Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: David Daney <david.s.daney@gmail.com>
To: Rich Felker <dalias@libc.org>, David Daney <ddaney@caviumnetworks.com>
Cc: Andy Lutomirski <luto@amacapital.net>,
	David Daney <ddaney.cavm@gmail.com>,
	libc-alpha@sourceware.org, linux-kernel@vger.kernel.org,
	linux-mips@linux-mips.org, David Daney <david.daney@cavium.com>
Subject: Re: [PATCH resend] MIPS: Allow FPU emulator to use non-stack area.
Date: Mon, 06 Oct 2014 21:50:47 -0700	[thread overview]
Message-ID: <54337127.40806@gmail.com> (raw)
In-Reply-To: <20141007004915.GF23797@brightrain.aerifal.cx>

On 10/06/2014 05:49 PM, Rich Felker wrote:
> On Mon, Oct 06, 2014 at 05:33:18PM -0700, David Daney wrote:
[...]

>> Why not?  It will emit any instructions we care to make it emit.  If
>> we want it to emit crypto instructions with patented algorithms,
>> then it will do that.  But we would still like to use a generic
>> kernel with generic FPU support.
>>
>> The most straight forward way (and the currently implemented way) of
>> doing this is to execute the instructions in question out-of-line
>> (on the userspace stack).
>>
>> The question here is:  What is the best way to get to a
>> non-executable stack.
>>
>> The consensus among MIPS developers is that we should continue using
> My experience has been that hardware and software developers focused
> on a particular hardware target are generally unqualified to make
> decisions that affect the design and operation of libc or the kernel.
> They are not experts in these areas. It was apparent early on in this
> thread, when you mentioned the idea that "not all threads would need
> fpu support", that you were thinking from a standpoint of custom
> low-level software and not a general purpose libc that cannot read the
> application author's mind.
Not at all, I was thinking of soft-float ABIs, as they never execute FP 
instructions, and are often used on systems with no FPU.  In fact many 
non-FPU systems never execute any hard-float code.  So those system 
should not suffer large performance regressions from any change made to 
support a non-executable stack.

We use GLibC on many soft-float only systems, and I would posit that 
GLibC is a general purpose libc.

>   It seems nobody had thought of the
> impossibility of doing lazy setup (inability to handle failure) and
> the necessity of always initializing this stuff at pthread_create
> time, either. Design issues like this should be run by experts in the
> libc area early on, not as an afterthought.

I bow down to the experts, as obviously I know nothing about:

1) The Linux kernel
2) The MIPS architecture.
3) Library design.
4) C libraries and their interaction with the kernel, linker and compiler.

>
>> the out-of-line execution trick, but do it somewhere other than in
>> stack memory.
> How do you answer Andy Lutomirski's question about what happens when a
> signal handler interrupts execution while the program counter is
> pointing at this "out-of-line execution" trampoline? This seems like a
> show-stopper for using anything other than the stack.
It would be nice to support, but not doing so would not be a regression 
from current behavior.

>
>> One way of doing this is to have the kernel magically generate
>> thread local memory regions.
>>
>> Another option is to have userspace manage the out-of-line execution areas.
>>
>> As is often the case, each approach has different pluses and minuses.
> Having the kernel magically do it would be better, but I'm doubtful
> that solution works anyway due to the above signal handler/nesting
> issue.

So the perfect is the enemy of the good?  No non-executable stack for 
you, MIPS.

> Rich
>

  reply	other threads:[~2014-10-07  4:50 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-06 20:23 [PATCH resend] MIPS: Allow FPU emulator to use non-stack area David Daney
2014-10-06 20:54 ` Rich Felker
2014-10-06 21:18   ` David Daney
2014-10-06 21:18     ` David Daney
2014-10-06 21:31     ` Rich Felker
2014-10-06 21:45       ` David Daney
2014-10-06 21:45         ` David Daney
2014-10-06 21:58         ` Rich Felker
2014-10-06 22:17           ` David Daney
2014-10-06 22:17             ` David Daney
2014-10-06 23:08             ` Rich Felker
2014-10-06 23:38           ` Andy Lutomirski
2014-10-06 23:48             ` David Daney
2014-10-06 23:48               ` David Daney
2014-10-06 23:54               ` Andy Lutomirski
2014-10-07  0:05               ` Rich Felker
2014-10-07  0:11                 ` Andrew Pinski
2014-10-07  0:21                   ` Rich Felker
2014-10-07  0:28                     ` Andrew Pinski
2014-10-07  0:29                       ` Andy Lutomirski
2014-10-07  0:32                         ` David Daney
2014-10-07  0:33                 ` David Daney
2014-10-07  0:33                   ` David Daney
2014-10-07  0:48                   ` Andy Lutomirski
2014-10-07  0:49                   ` Rich Felker
2014-10-07  4:50                     ` David Daney [this message]
2014-10-07  9:13                       ` Matthew Fortune
2014-10-07  9:13                         ` Matthew Fortune
2014-10-07 10:52                         ` James Hogan
2014-10-07 11:19                         ` Rich Felker
2014-10-07 16:04                         ` David Daney
2014-10-07 18:32                         ` Leonid Yegoshin
2014-10-07 18:43                           ` David Daney
2014-10-07 19:13                             ` Leonid Yegoshin
2014-10-07 18:44                           ` Andy Lutomirski
2014-10-07 18:50                             ` David Daney
2014-10-07 19:09                             ` Rich Felker
2014-10-07 19:16                               ` Leonid Yegoshin
2014-10-07 19:21                                 ` Rich Felker
2014-10-07 19:27                                   ` Leonid Yegoshin
2014-10-07 19:28                                   ` Andy Lutomirski
2014-10-07 20:03                                     ` David Daney
2014-10-08  0:22                                       ` Andy Lutomirski
2014-10-07 19:40                             ` Matthew Fortune
2014-10-07 11:11                       ` Rich Felker
2014-10-07 16:08                         ` David Daney
2014-10-07 16:08                           ` David Daney
2014-10-07 18:16                           ` Andy Lutomirski
2014-10-07 23:20     ` Ralf Baechle
2014-10-07 23:59       ` David Daney
2014-10-07 23:59         ` David Daney
2014-10-08  0:18         ` Chuck Ebbert
2014-10-08  0:18           ` Chuck Ebbert
2014-10-08  2:37           ` Rich Felker
2014-10-08 10:31         ` Paul Burton
2014-10-08 10:31           ` Paul Burton
2014-10-07  1:02 ` Kevin D. Kissell
2014-10-07  1:38   ` Rich Felker
2014-10-07  4:32   ` David Daney
2014-10-07 11:53     ` James Hogan
2014-10-07 11:53       ` James Hogan
2014-10-07 12:22       ` James Hogan
2014-10-07 12:22         ` James Hogan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54337127.40806@gmail.com \
    --to=david.s.daney@gmail.com \
    --cc=dalias@libc.org \
    --cc=david.daney@cavium.com \
    --cc=ddaney.cavm@gmail.com \
    --cc=ddaney@caviumnetworks.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=luto@amacapital.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox