* alpha 4K mmap offsets and em86
@ 2001-09-23 11:30 James McKenzie
2001-09-23 12:55 ` Eric W. Biederman
2001-09-24 23:52 ` Richard Henderson
0 siblings, 2 replies; 3+ messages in thread
From: James McKenzie @ 2001-09-23 11:30 UTC (permalink / raw)
To: linux-kernel
Hi,
very sorry if this has been discussed before I couldn't
find any references in the archive. There is a program
on the alpha architecture which can (with a little help
from the kernel) execute ia32 linux binaries it's useful
if you need to run badly written 32 bit code.
The emulator needs to mmap elf binaries in, and
offsets in ia32 elf files are 4k aligned for a 4k
pagesize. On 2.2 on an alpha you could do
mmap(NULL,3176, ... , fd, 0x1000);
but now in 2.4 but in 2.4 it returns EINVAL.
The code in mm/mmap.c and vm_area_struct seem to
now count the offset in pages rather than bytes,
which would make fixing this ugly [maybe an element
in the structure to store 'slop' ?]
I can fix static binaries by patching an ia32 ld
to generate 8k alignments and running ld on the
binary - but I suspect this problem will surface
again once ia64 takes off.
Any ideas or pointers very welcome,
Thanks,
James.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: alpha 4K mmap offsets and em86
2001-09-23 11:30 alpha 4K mmap offsets and em86 James McKenzie
@ 2001-09-23 12:55 ` Eric W. Biederman
2001-09-24 23:52 ` Richard Henderson
1 sibling, 0 replies; 3+ messages in thread
From: Eric W. Biederman @ 2001-09-23 12:55 UTC (permalink / raw)
To: James McKenzie; +Cc: linux-kernel
James McKenzie <kernel@ostrich.dhs.org> writes:
> Hi,
>
> very sorry if this has been discussed before I couldn't
> find any references in the archive. There is a program
> on the alpha architecture which can (with a little help
> from the kernel) execute ia32 linux binaries it's useful
> if you need to run badly written 32 bit code.
>
> The emulator needs to mmap elf binaries in, and
> offsets in ia32 elf files are 4k aligned for a 4k
> pagesize. On 2.2 on an alpha you could do
> mmap(NULL,3176, ... , fd, 0x1000);
> but now in 2.4 but in 2.4 it returns EINVAL.
>
> The code in mm/mmap.c and vm_area_struct seem to
> now count the offset in pages rather than bytes,
> which would make fixing this ugly [maybe an element
> in the structure to store 'slop' ?]
Nope. This change was rather important to simplifying
the page cache, so having slop is not really what we want. Having
slop is actually a coherency nightmare.
You can do: mmap(/dev/zero, size) read(binary) if you
really nead that functionality. Unless you are running
many instances of a program it really shouldn't matter.
Also you can't emulate full x86 semantics whatever you do because you
don't have 4K granularity.
There are actually processors where it is worse, and you need
something like 64K alignment despite the fact they have 4K pages.
That is needed to avoid conflicts in virtually indexed L1 caches.
Eric
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: alpha 4K mmap offsets and em86
2001-09-23 11:30 alpha 4K mmap offsets and em86 James McKenzie
2001-09-23 12:55 ` Eric W. Biederman
@ 2001-09-24 23:52 ` Richard Henderson
1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2001-09-24 23:52 UTC (permalink / raw)
To: James McKenzie; +Cc: linux-kernel
On Sun, Sep 23, 2001 at 12:30:42PM +0100, James McKenzie wrote:
> On 2.2 on an alpha you could do
> mmap(NULL,3176, ... , fd, 0x1000);
> but now in 2.4 but in 2.4 it returns EINVAL.
There is code elsewhere in em86 to fake 4k mappings.
You should be able to reuse that.
r~
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-09-24 23:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-23 11:30 alpha 4K mmap offsets and em86 James McKenzie
2001-09-23 12:55 ` Eric W. Biederman
2001-09-24 23:52 ` Richard Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox