|
From: Tom H. <to...@co...> - 2005-09-30 08:11:48
|
In message <200...@ac...>
Julian Seward <js...@ac...> wrote:
>> On x86 and ppc32 the offset argument to mmap2 is specified in pages
>> not bytes. This is a horrible kludge of a fix and it should probably
>> be fixed properly with a separate sys_mmap for amd64.
>
>> + OffT offset;
>
> Nice but .. there's kind of an awkward hole here. On x86, OffT is
> 32 bits and so if ARG6 >= 2^20 then offset is going to be wrong.
> Implication is that all mmap offsets should be represented in 64
> bits regardless of the platform. (sigh)
Well maybe OffT should always be 64 bits - even 32 bit platforms
support large files and can have 64 bit offsets.
>> +#if defined(VGP_x86_linux) || defined(VGP_ppc32_linux)
>> + offset = ARG6 * VKI_PAGE_SIZE;
>
> Also .. utterly illogically .. on ppc32 multiplying by page size
> causes everything to crash horribly. So on ppc32 I guess it's
> byte-indexed; but the implication is you can't do offsets of
> more than 4G on ppc32. /me mystified.
I had checked the kernel, and noted that ppc32 was passing the offset
to mmap2 as pages which is why I did what I did.
It turns out however that we were trying to use the sys_mmap2 handler
for both mmap and mmap2 on ppc32 which is wrong - they both pass the
arguments in the normal way (unlike x86) but one passes the offset in
bytes and one in pages.
I have attempted to rationalise all this and have committed a fix...
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|