[PATCH v3 07/13] loader: Don't clobber existing memory mappings when reserving addresses.

Alexandre Julliard julliard at winehq.org
Wed Jan 26 03:06:22 CST 2022


Jinoh Kang <jinoh.kang.kr at gmail.com> writes:

> On 1/26/22 00:48, Alexandre Julliard wrote:
>> Jinoh Kang <jinoh.kang.kr at gmail.com> writes:
>> 
>>> Today, the preloader makes no attempt to avoid unmapping existing
>>> memory mappings except the initial stack.  This results in irrevocably
>>> unmapping some useful preallocated memory areas, such as vDSO.
>>>
>>> Fix this by reading /proc/self/maps for existing VMAs, and splitting
>>> mmap() calls to avoid erasing existing memory mappings.
>> 
>> That defeats the purpose of using the preloader.
>
> The intention was to *incrementally* scrape memory areas for the reserved ranges,
> relocating any critical areas (vDSO, stack, ...) along the way.
>
> It's also why this change is useless without the subsequent patches,
> which calls map_reserve_preload_ranges again to actually fill out all
> the gaps previously occupied by vDSO/stack.

I don't see the point. If you want to remap vDSO you can do that first,
and then reserve the full range. You don't need all that complexity.

And as general advice for your patches, please try to avoid changing
things that don't need changing, or adding infrastructure that isn't
needed. It will make it easier to see the actual changes.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list