[PATCH 0/10] MR6: Avoid performance degradation due to vDSO unmapping (BZ#52313)

Jinoh Kang (@iamahuman) wine at gitlab.winehq.org
Wed Apr 27 11:55:18 CDT 2022


Commit f558741fabc116534fa598aa890ffed683a7153b removes vDSO if it
conflicts with reserved ranges:

>     Remove the AT_SYSINFO and AT_SYSINFO_EHDR values if the sysinfo page
>     is in one of our reserved ranges.

However, missing vDSO leads to performance issues on some syscalls (e.g.
clock_gettime, gettimeofday) and may even lead to crash when run with
some ancient C libraries that does not supply a custom signal restorer.

vDSO pages can clash with reserved ranges especially in a 32-bit address
space with address space layout randomization (ASLR) turned on.

Recent versions of the Linux kernel introduced support for mremap()-ping
vDSO pages, partly in an effort to support checkpoint restore in
userspace (CRIU).  Special programs that require specific memory layout
constraints (such as Wine preloader) can take advantage of this support
to modify the address space to meet its requirements.

The following test script has been used to test each changes (use with
`git rebase --exec=...`):

```sh
set -e
make -C ../wine64-build -j5
make -C ../wine32-build -j5

cd ../wine64-build
export WINEPRELOADREMAPSTACK
export WINEPRELOADREMAPVDSO
for WINEPRELOADREMAPSTACK in skip never always force auto on-demand ''
do
	for WINEPRELOADREMAPVDSO in skip never always force auto on-demand ''
	do
		./loader/wine64 wineboot
		./loader/wine wineboot
	done
done
```

-- 
https://gitlab.winehq.org/wine/wine/-/merge_requests/6



More information about the wine-devel mailing list