* PAGE_SIZE and native vs. emulated 32-bit SPARC ABI
@ 2004-12-30 11:07 William Lee Irwin III
2004-12-30 11:50 ` C.Newport
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: William Lee Irwin III @ 2004-12-30 11:07 UTC (permalink / raw)
To: sparclinux
It seems that most/all 32-bit SPARC programs are written and compiled
for emulated 32-bit on sun4u, which has an 8KB PAGE_SIZE, and returns
8KB for getpagesize(). This is unfortunately causing spectacular
failures on some of my favorite regression tests for memory management,
which are interpreters using memory protection-based garbage collectors.
In particular, with a simple LD_PRELOAD to return a falsified 8KB
PAGE_SIZE, sbcl (a Common Lisp interpreter and compiler) may be made to
run, where it can't without such. The installation procedure runs the
interpreter, which is basically the extent of what I do with the ones
that run themselves during the installation procedure. For others just
starting up the interpreter serves as a simple testcase.
So, the question arises as to what to do about these ABI breakages.
It's unclear that changing the page size to 8192 unconditionally will
work, as there are suspected breakages in the other direction, as
another of those interpreters with protection-based GC that is strongly
suspected of being hardwired to a 4KB PAGE_SIZE.
Any ideas?
-- wli
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PAGE_SIZE and native vs. emulated 32-bit SPARC ABI
2004-12-30 11:07 PAGE_SIZE and native vs. emulated 32-bit SPARC ABI William Lee Irwin III
@ 2004-12-30 11:50 ` C.Newport
2004-12-30 12:13 ` William Lee Irwin III
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: C.Newport @ 2004-12-30 11:50 UTC (permalink / raw)
To: sparclinux
On Thursday 30 December 2004 11:07 am, William Lee Irwin III wrote:
> It seems that most/all 32-bit SPARC programs are written and compiled
> for emulated 32-bit on sun4u, which has an 8KB PAGE_SIZE, and returns
> 8KB for getpagesize(). This is unfortunately causing spectacular
> failures
This sounds like a bug to me.
A 32 bit program should see the same kernel environment on 32 and 64 bit
machines. There may be a case for saying that the compiler should also
be aware of such issues when building a 32 bit model.
Also see the kernel config stuff - the page size for ramdisks defaults to
4096.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PAGE_SIZE and native vs. emulated 32-bit SPARC ABI
2004-12-30 11:07 PAGE_SIZE and native vs. emulated 32-bit SPARC ABI William Lee Irwin III
2004-12-30 11:50 ` C.Newport
@ 2004-12-30 12:13 ` William Lee Irwin III
2005-01-04 18:46 ` David S. Miller
2005-01-04 18:54 ` William Lee Irwin III
3 siblings, 0 replies; 5+ messages in thread
From: William Lee Irwin III @ 2004-12-30 12:13 UTC (permalink / raw)
To: sparclinux
On Thursday 30 December 2004 11:07 am, William Lee Irwin III wrote:
>> It seems that most/all 32-bit SPARC programs are written and compiled
>> for emulated 32-bit on sun4u, which has an 8KB PAGE_SIZE, and returns
>> 8KB for getpagesize(). This is unfortunately causing spectacular
>> failures
On Thu, Dec 30, 2004 at 11:50:28AM +0000, C.Newport wrote:
> This sounds like a bug to me.
> A 32 bit program should see the same kernel environment on 32 and 64 bit
> machines. There may be a case for saying that the compiler should also
> be aware of such issues when building a 32 bit model.
> Also see the kernel config stuff - the page size for ramdisks defaults to
> 4096.
IMHO this is ABI emulation QOI. I personally just use the things for
ABI torture tests, and affected programs are somewhat uncommon. I think
dealing with this would involve personality handling in sparc32, since
it by and large is stuck bearing the burden of being compatible with
common usage on more modern 32-bit environments and not vice-versa,
which may very well be impossible.
-- wli
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PAGE_SIZE and native vs. emulated 32-bit SPARC ABI
2004-12-30 11:07 PAGE_SIZE and native vs. emulated 32-bit SPARC ABI William Lee Irwin III
2004-12-30 11:50 ` C.Newport
2004-12-30 12:13 ` William Lee Irwin III
@ 2005-01-04 18:46 ` David S. Miller
2005-01-04 18:54 ` William Lee Irwin III
3 siblings, 0 replies; 5+ messages in thread
From: David S. Miller @ 2005-01-04 18:46 UTC (permalink / raw)
To: sparclinux
On Thu, 30 Dec 2004 03:07:07 -0800
William Lee Irwin III <wli@holomorphy.com> wrote:
> It seems that most/all 32-bit SPARC programs are written and compiled
> for emulated 32-bit on sun4u, which has an 8KB PAGE_SIZE, and returns
> 8KB for getpagesize(). This is unfortunately causing spectacular
> failures on some of my favorite regression tests for memory management,
> which are interpreters using memory protection-based garbage collectors.
The Sparc ABI states that one may make no assumptions about
the PAGE_SIZE in any way. That's why 32-bit Sparc ELF binaries
compiled before sun4u even existed can execute properly on 8KB
PAGE_SIZE systems.
Not using getpagesize() is a pretty serious programming error.
There are even facilities in the Sparc ELF specification that allow
the binaries to work just fine for up to a 64KB page size. A long
time ago, Kanoj Sarcar played around with changing the default PAGE_SIZE
of sparc64 to be 64K and all 32-bit binaries worked just fine.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PAGE_SIZE and native vs. emulated 32-bit SPARC ABI
2004-12-30 11:07 PAGE_SIZE and native vs. emulated 32-bit SPARC ABI William Lee Irwin III
` (2 preceding siblings ...)
2005-01-04 18:46 ` David S. Miller
@ 2005-01-04 18:54 ` William Lee Irwin III
3 siblings, 0 replies; 5+ messages in thread
From: William Lee Irwin III @ 2005-01-04 18:54 UTC (permalink / raw)
To: sparclinux
On Tue, Jan 04, 2005 at 10:46:56AM -0800, David S. Miller wrote:
> The Sparc ABI states that one may make no assumptions about
> the PAGE_SIZE in any way. That's why 32-bit Sparc ELF binaries
> compiled before sun4u even existed can execute properly on 8KB
> PAGE_SIZE systems.
> Not using getpagesize() is a pretty serious programming error.
> There are even facilities in the Sparc ELF specification that allow
> the binaries to work just fine for up to a 64KB page size. A long
> time ago, Kanoj Sarcar played around with changing the default PAGE_SIZE
> of sparc64 to be 64K and all 32-bit binaries worked just fine.
I'll have to reiterate the hard answer I told the maintainers of one of
these cases. One of the other cases hasn't been diagnosed or resolved
yet but they are more willing/able to fix it in userspace.
-- wli
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-01-04 18:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-30 11:07 PAGE_SIZE and native vs. emulated 32-bit SPARC ABI William Lee Irwin III
2004-12-30 11:50 ` C.Newport
2004-12-30 12:13 ` William Lee Irwin III
2005-01-04 18:46 ` David S. Miller
2005-01-04 18:54 ` William Lee Irwin III
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.