public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Cary Coutant <cary@cup.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [RFC] Endianness and signals
Date: Tue, 21 Oct 2003 20:37:00 +0000	[thread overview]
Message-ID: <marc-linux-ia64-106676921219872@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-106669369711349@msgid-missing>

> I don't think the psABI requires twiddling the PSR.be bit on signal
> delivery (though it probably also does not disallow it).  The thing
> is, if you have an applications that's completely big-endian, you'd
> probably NOT want to clear PSR.be on a signal.  On the other hand, if
> you just have one or two routines which turn on PSR.be, then clearing
> the bit is clearly advantageous (e.g., would avoid sigprocmask()
> calls).  But given that the current kernel behavior has existed for a
> long time, I'm not sure it's a good idea to change the behavior now
> (it's not like you _can't_ have big-endian code at the moment).

The psABI doesn't really admit to the existence of mixed-endian 
processes.

I think the right thing to do is set the PSR.be bit on delivery of a 
signal to match (elf_header.e_flags & EF_IA_64_BE). If the process is 
primarily little-endian with an occasional excursion into big-endian 
mode, one would expect (and reasonably require) the application's 
signal handlers to run in little-endian mode. If you've got a 
big-endian process that switches into little-endian mode only to make 
system calls, one would expect its signal handlers to run in big-endian 
mode.

I'm not sure I buy the argument that you shouldn't change the behavior 
now because it's been that way for a long time. What you have now is 
unpredictable, so the only ways a signal handler could work in an 
application that switches the PSR.be bit on a regular basis are: (1) it 
just gets lucky, and never gets an interrupt while in the wrong state, 
(2) the application blocks signals while in the opposite state, or (3) 
the signal handler forces the PSR.be to what it wants. In any of these 
cases, the proposed behavior will work.

-cary


  parent reply	other threads:[~2003-10-21 20:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-20 23:42 [RFC] Endianness and signals R. Lake
2003-10-21  0:10 ` David Mosberger
2003-10-21 20:37 ` Cary Coutant [this message]
2003-10-21 20:56 ` David Mosberger
2003-10-21 21:57 ` Cary Coutant
2003-10-21 22:24 ` David Mosberger

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=marc-linux-ia64-106676921219872@msgid-missing \
    --to=cary@cup.hp.com \
    --cc=linux-ia64@vger.kernel.org \
    /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