[LTP] [PATCH] Fix mmap01 testcase on hppa architecture

Helge Deller deller@gmx.de
Fri Jun 16 15:55:23 CEST 2017


On 13.06.2017 13:18, Jan Stancek wrote:
>> The mmap() syscall to map a file at any given page-aligned address (via the
>> MAP_FIXED flag) can fail on the hppa architecture due to cache colouring
>> requirements of the architecture.
>>
>> This patch drops the MAP_FIXED flag and thus maps the file instead at
>> some convenient address based on the hint as given by the addr
>> parameter.
> 
> It looks like we don't need addr at all. Test is remapping part
> of heap with MAP_FIXED, which looks risky. I'd drop that page
> initialisation inside heap too. Now, without MAP_FIXED, it's
> just completely unrelated page. What do you think?

Yes, that's probably the best choice.
The original code tries to initialize the area where the file is going
to be mapped with non-zero values to be able to check if after the mapping
the memory area beyond the EOF was zero-initialized by the kernel.
This part of the check was already changed by my initial patch, with
your suggestion we would now drop the initialization completely.
I think your suggestion is fair.

New patch is attached.

Helge

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mmap01.patch
Type: text/x-diff
Size: 2087 bytes
Desc: not available
URL: <http://lists.linux.it/pipermail/ltp/attachments/20170616/201330d6/attachment.patch>


More information about the ltp mailing list