diff options
author | Vitaly Buka <vitalybuka@google.com> | 2022-07-11 15:00:28 -0700 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2022-08-11 11:34:17 +0200 |
commit | dbbf89751b14aa5d281bad3af273e9ffaae82262 (patch) | |
tree | 79285544e4a484e0631a97263a6d7bf5caa37790 /linux-user | |
parent | a6b1c53e79d08a99a28cc3e67a3e1a7c34102d6b (diff) |
linux-user/aarch64: Reset target data on MADV_DONTNEED
aarch64 stores MTE tags in target_date, and they should be reset by
MADV_DONTNEED.
Signed-off-by: Vitaly Buka <vitalybuka@google.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220711220028.2467290-1-vitalybuka@google.com>
[lv: fix code style issues]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/mmap.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/linux-user/mmap.c b/linux-user/mmap.c index edceaca4a8..048c4135af 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -894,6 +894,9 @@ abi_long target_madvise(abi_ulong start, abi_ulong len_in, int advice) if (advice == MADV_DONTNEED && can_passthrough_madv_dontneed(start, end)) { ret = get_errno(madvise(g2h_untagged(start), len, MADV_DONTNEED)); + if (ret == 0) { + page_reset_target_data(start, start + len); + } } mmap_unlock(); |