From: Segher Boessenkool <segher@kernel.crashing.org>
To: Felix Domke <tmbinc@elitedvb.net>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs.org>
Subject: Re: Saving to 32 bits of GPRs in signal context
Date: Wed, 30 May 2007 13:54:52 +0200 [thread overview]
Message-ID: <6468abfee21ce75c5d86676350b09c88@kernel.crashing.org> (raw)
In-Reply-To: <465C9F04.4070202@elitedvb.net>
>>> Just call them and trap the SEGV ;-) You can check the
>>> aux vector of course, or ask glibc -- but the SEGV way
>>> is the only really portable way. Strange world :-)
>> SIGILL you mean ? :-)
> Anyway, please don't. It is *not* portable.
It is simple and *quite* portable. "Real" applications
of course should just ask the C library about this,
somewhere deep inside a maze of #ifdefs for all the OSes
supported. A job for autoxxxx I guess.
> Or can you guarantee that no CPU ever will implement a.) only a 64bit
> subset or b.) other instructions using the same encoding as the 64bit
> insn you will use for testing?
I don't understand a); and no CPU _should_ do b), but we
all know that bad things happen sometimes.
> I still remember the pain of trying to tell that ffmpeg that my CPU
> can't do real altivec, even when it implements some parts of it without
> SIGILLing (which ffmpeg used for testing).
To be fair, ffmpeg has had this test since before there
were proper ways to detect AltiVec on Linux/glibc.
> And: What will happen if you manage to run your code under an operating
> system which doesn't even save the upper bits at all on interrupts? You
> can't check for that with SIGILL.
Sure you can, do some loop with a data-dependent branch
in there that detects corruption of that high half reg.
If you really want a SIGILL you can just generate one ;-)
A test like this is never 100% of course.
> And i'd still like to see some decent ILP32LL64 support.
GCC has supported this for a long time now, it seems the
last few pieces needed from the kernel and userland support
are falling into place now. Hurray!
> Maybe even with
> a new "native 64bit" datatype (how ugly), in order to not break the
> ABI.
> I just want to call my hand-optimized 64bit assembler code with 64bit
> arguments.
> How does OS X handle this? Don't they have the same problem there?
AFAIK Darwin saves full 64-bit GPRs on a 64-bit CPU always.
An application can ask for 64-bit signal frames by giving
the SA_64REGSET flag in sa_flags to sigaction().
Segher
next prev parent reply other threads:[~2007-05-30 11:55 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-29 7:24 Saving to 32 bits of GPRs in signal context Benjamin Herrenschmidt
2007-05-29 7:52 ` Dan Malek
2007-05-29 8:05 ` Benjamin Herrenschmidt
2007-05-29 9:26 ` Gabriel Paubert
2007-05-29 9:44 ` Benjamin Herrenschmidt
2007-05-29 13:12 ` Segher Boessenkool
2007-05-29 14:00 ` Steve Munroe
2007-05-29 14:08 ` Ulrich Weigand
2007-05-29 14:17 ` Kumar Gala
2007-05-29 14:38 ` Segher Boessenkool
2007-05-29 19:04 ` Becky Bruce
2007-05-30 10:04 ` Christoph Hellwig
2007-05-30 12:13 ` Kumar Gala
2007-05-30 12:30 ` Segher Boessenkool
2007-05-29 14:31 ` Segher Boessenkool
2007-05-29 14:51 ` Steve Munroe
2007-05-29 21:44 ` Benjamin Herrenschmidt
2007-05-29 23:16 ` Steve Munroe
2007-05-29 23:19 ` Benjamin Herrenschmidt
2007-05-30 7:34 ` Hiroyuki Machida
2007-05-30 11:40 ` Segher Boessenkool
2007-05-30 11:48 ` Benjamin Herrenschmidt
2007-05-30 3:37 ` Paul Mackerras
2007-05-30 5:32 ` Kumar Gala
2007-05-30 11:44 ` Benjamin Herrenschmidt
2007-05-30 12:15 ` Kumar Gala
2007-05-30 12:48 ` Hiroyuki Machida
2007-05-30 12:58 ` Benjamin Herrenschmidt
2007-05-30 18:09 ` Steve Munroe
2007-05-30 21:02 ` Gabriel Paubert
2007-05-30 21:41 ` Steve Munroe
2007-05-30 12:01 ` Segher Boessenkool
2007-05-30 11:59 ` Segher Boessenkool
2007-05-30 12:01 ` Benjamin Herrenschmidt
2007-05-30 12:07 ` Segher Boessenkool
2007-05-30 12:09 ` Benjamin Herrenschmidt
2007-05-30 12:36 ` Segher Boessenkool
2007-05-29 14:28 ` Segher Boessenkool
2007-05-29 21:37 ` Benjamin Herrenschmidt
2007-05-29 21:38 ` Benjamin Herrenschmidt
2007-05-29 13:04 ` Segher Boessenkool
2007-05-29 14:28 ` Arnd Bergmann
2007-05-29 14:43 ` Segher Boessenkool
2007-05-29 15:54 ` Geert Uytterhoeven
2007-05-29 18:48 ` Arnd Bergmann
2007-05-29 21:27 ` Benjamin Herrenschmidt
2007-05-29 21:45 ` Felix Domke
2007-05-30 11:23 ` Benjamin Herrenschmidt
2007-05-30 11:52 ` Felix Domke
2007-05-30 13:14 ` Segher Boessenkool
2007-05-30 11:54 ` Segher Boessenkool [this message]
2007-05-30 12:07 ` Felix Domke
2007-05-31 5:39 ` Benjamin Herrenschmidt
2007-05-29 13:10 ` Kumar Gala
2007-05-29 21:32 ` Benjamin Herrenschmidt
2007-05-29 23:46 ` Olof Johansson
2007-05-30 0:43 ` Kumar Gala
2007-05-30 2:54 ` Steve Munroe
2007-05-30 5:31 ` Kumar Gala
2007-05-30 19:47 ` Steve Munroe
2007-05-30 20:52 ` Olof Johansson
2007-05-30 21:33 ` Steve Munroe
2007-05-29 13:53 ` Ulrich Weigand
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=6468abfee21ce75c5d86676350b09c88@kernel.crashing.org \
--to=segher@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=tmbinc@elitedvb.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;
as well as URLs for NNTP newsgroup(s).