[PATCH 0/2] linux-user: return ENOMEM from madvise on unmapped ranges

Roi Klevansky posted 2 patches 3 weeks, 4 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260831212040.1833650-1-roiklevansky@gmail.com
Maintainers: Laurent Vivier <laurent@vivier.eu>, Helge Deller <deller@gmx.de>, Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>, "Alex Bennée" <alex.bennee@linaro.org>
linux-user/mmap.c                         |  7 +++-
tests/tcg/multiarch/linux/linux-madvise.c | 43 +++++++++++++++++++++++
2 files changed, 49 insertions(+), 1 deletion(-)
[PATCH 0/2] linux-user: return ENOMEM from madvise on unmapped ranges
Posted by Roi Klevansky 3 weeks, 4 days ago
The kernel fails madvise() with ENOMEM when it is given a partially or a
fully unmapped address range. qemu-user differed from this and returned
0 instead.

Patch 1 makes target_madvise() check the range with page_check_range()
and potentially fail with ENOMEM while still giving precedence to
advice specific errors.

Patch 2 adds test cases, calling madvise() with partially and fully
unmapped address ranges.

Roi Klevansky (2):
  linux-user: return ENOMEM from madvise on unmapped ranges
  tests/tcg: add linux-user test for madvise returning ENOMEM

 linux-user/mmap.c                         |  7 +++-
 tests/tcg/multiarch/linux/linux-madvise.c | 43 +++++++++++++++++++++++
 2 files changed, 49 insertions(+), 1 deletion(-)

-- 
2.55.0