* [PULL 0/1] Linux user for 7.1 patches @ 2022-08-12 10:33 Laurent Vivier 2022-08-12 10:33 ` [PULL 1/1] linux-user/aarch64: Reset target data on MADV_DONTNEED Laurent Vivier 2022-08-12 17:45 ` [PULL 0/1] Linux user for 7.1 patches Richard Henderson 0 siblings, 2 replies; 5+ messages in thread From: Laurent Vivier @ 2022-08-12 10:33 UTC (permalink / raw) To: qemu-devel; +Cc: Laurent Vivier The following changes since commit a6b1c53e79d08a99a28cc3e67a3e1a7c34102d6b: Merge tag 'linux-user-for-7.1-pull-request' of https://gitlab.com/laurent_vivier/qemu into staging (2022-08-10 10:26:57 -0700) are available in the Git repository at: https://gitlab.com/laurent_vivier/qemu.git tags/linux-user-for-7.1-pull-request for you to fetch changes up to dbbf89751b14aa5d281bad3af273e9ffaae82262: linux-user/aarch64: Reset target data on MADV_DONTNEED (2022-08-11 11:34:17 +0200) ---------------------------------------------------------------- Pull request linux-user 20220812 ---------------------------------------------------------------- Vitaly Buka (1): linux-user/aarch64: Reset target data on MADV_DONTNEED accel/tcg/translate-all.c | 26 ++++++++++++++++++++++++++ include/exec/cpu-all.h | 1 + linux-user/mmap.c | 3 +++ 3 files changed, 30 insertions(+) -- 2.37.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PULL 1/1] linux-user/aarch64: Reset target data on MADV_DONTNEED 2022-08-12 10:33 [PULL 0/1] Linux user for 7.1 patches Laurent Vivier @ 2022-08-12 10:33 ` Laurent Vivier 2022-08-12 17:45 ` [PULL 0/1] Linux user for 7.1 patches Richard Henderson 1 sibling, 0 replies; 5+ messages in thread From: Laurent Vivier @ 2022-08-12 10:33 UTC (permalink / raw) To: qemu-devel; +Cc: Vitaly Buka, Richard Henderson, Laurent Vivier From: Vitaly Buka <vitalybuka@google.com> 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> --- accel/tcg/translate-all.c | 26 ++++++++++++++++++++++++++ include/exec/cpu-all.h | 1 + linux-user/mmap.c | 3 +++ 3 files changed, 30 insertions(+) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index ef62a199c7db..b83161a08190 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -2314,6 +2314,32 @@ void page_set_flags(target_ulong start, target_ulong end, int flags) } } +void page_reset_target_data(target_ulong start, target_ulong end) +{ + target_ulong addr, len; + + /* + * This function should never be called with addresses outside the + * guest address space. If this assert fires, it probably indicates + * a missing call to h2g_valid. + */ + assert(end - 1 <= GUEST_ADDR_MAX); + assert(start < end); + assert_memory_lock(); + + start = start & TARGET_PAGE_MASK; + end = TARGET_PAGE_ALIGN(end); + + for (addr = start, len = end - start; + len != 0; + len -= TARGET_PAGE_SIZE, addr += TARGET_PAGE_SIZE) { + PageDesc *p = page_find_alloc(addr >> TARGET_PAGE_BITS, 1); + + g_free(p->target_data); + p->target_data = NULL; + } +} + void *page_get_target_data(target_ulong address) { PageDesc *p = page_find(address >> TARGET_PAGE_BITS); diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index f5bda2c3caa7..491629b9ba7a 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -271,6 +271,7 @@ int walk_memory_regions(void *, walk_memory_regions_fn); int page_get_flags(target_ulong address); void page_set_flags(target_ulong start, target_ulong end, int flags); +void page_reset_target_data(target_ulong start, target_ulong end); int page_check_range(target_ulong start, target_ulong len, int flags); /** diff --git a/linux-user/mmap.c b/linux-user/mmap.c index edceaca4a8e1..048c4135af14 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(); -- 2.37.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PULL 0/1] Linux user for 7.1 patches 2022-08-12 10:33 [PULL 0/1] Linux user for 7.1 patches Laurent Vivier 2022-08-12 10:33 ` [PULL 1/1] linux-user/aarch64: Reset target data on MADV_DONTNEED Laurent Vivier @ 2022-08-12 17:45 ` Richard Henderson 1 sibling, 0 replies; 5+ messages in thread From: Richard Henderson @ 2022-08-12 17:45 UTC (permalink / raw) To: Laurent Vivier, qemu-devel On 8/12/22 03:33, Laurent Vivier wrote: > The following changes since commit a6b1c53e79d08a99a28cc3e67a3e1a7c34102d6b: > > Merge tag 'linux-user-for-7.1-pull-request' of https://gitlab.com/laurent_vivier/qemu into staging (2022-08-10 10:26:57 -0700) > > are available in the Git repository at: > > https://gitlab.com/laurent_vivier/qemu.git tags/linux-user-for-7.1-pull-request > > for you to fetch changes up to dbbf89751b14aa5d281bad3af273e9ffaae82262: > > linux-user/aarch64: Reset target data on MADV_DONTNEED (2022-08-11 11:34:17 +0200) > > ---------------------------------------------------------------- > Pull request linux-user 20220812 Applied, thanks. Please update https://wiki.qemu.org/ChangeLog/7.1 as appropriate. r~ > > ---------------------------------------------------------------- > > Vitaly Buka (1): > linux-user/aarch64: Reset target data on MADV_DONTNEED > > accel/tcg/translate-all.c | 26 ++++++++++++++++++++++++++ > include/exec/cpu-all.h | 1 + > linux-user/mmap.c | 3 +++ > 3 files changed, 30 insertions(+) > ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PULL 0/1] Linux user for 7.1 patches @ 2022-08-10 16:50 Laurent Vivier 2022-08-10 19:14 ` Richard Henderson 0 siblings, 1 reply; 5+ messages in thread From: Laurent Vivier @ 2022-08-10 16:50 UTC (permalink / raw) To: qemu-devel; +Cc: Laurent Vivier The following changes since commit 61b6e67171c602cf6451e4928c9cdcc24c57a485: Update version for v7.1.0-rc2 release (2022-08-09 19:25:15 -0700) are available in the Git repository at: https://gitlab.com/laurent_vivier/qemu.git tags/linux-user-for-7.1-pull-request for you to fetch changes up to 3cd3df2a9584e6f753bb62a0028bd67124ab5532: linux-user: fix compat with glibc >= 2.36 sys/mount.h (2022-08-10 18:37:46 +0200) ---------------------------------------------------------------- Pull request linux-user 20220810 fix compat with glibc >= 2.36 sys/mount.h ---------------------------------------------------------------- Daniel P. Berrangé (1): linux-user: fix compat with glibc >= 2.36 sys/mount.h linux-user/syscall.c | 18 ++++++++++++++++++ meson.build | 2 ++ 2 files changed, 20 insertions(+) -- 2.37.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PULL 0/1] Linux user for 7.1 patches 2022-08-10 16:50 Laurent Vivier @ 2022-08-10 19:14 ` Richard Henderson 0 siblings, 0 replies; 5+ messages in thread From: Richard Henderson @ 2022-08-10 19:14 UTC (permalink / raw) To: Laurent Vivier, qemu-devel On 8/10/22 09:50, Laurent Vivier wrote: > The following changes since commit 61b6e67171c602cf6451e4928c9cdcc24c57a485: > > Update version for v7.1.0-rc2 release (2022-08-09 19:25:15 -0700) > > are available in the Git repository at: > > https://gitlab.com/laurent_vivier/qemu.git tags/linux-user-for-7.1-pull-request > > for you to fetch changes up to 3cd3df2a9584e6f753bb62a0028bd67124ab5532: > > linux-user: fix compat with glibc >= 2.36 sys/mount.h (2022-08-10 18:37:46 +0200) > > ---------------------------------------------------------------- > Pull request linux-user 20220810 > > fix compat with glibc >= 2.36 sys/mount.h Applied, thanks. Please update https://wiki.qemu.org/ChangeLog/7.1 as appropriate. r~ > > ---------------------------------------------------------------- > > Daniel P. Berrangé (1): > linux-user: fix compat with glibc >= 2.36 sys/mount.h > > linux-user/syscall.c | 18 ++++++++++++++++++ > meson.build | 2 ++ > 2 files changed, 20 insertions(+) > ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-08-12 17:49 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-08-12 10:33 [PULL 0/1] Linux user for 7.1 patches Laurent Vivier 2022-08-12 10:33 ` [PULL 1/1] linux-user/aarch64: Reset target data on MADV_DONTNEED Laurent Vivier 2022-08-12 17:45 ` [PULL 0/1] Linux user for 7.1 patches Richard Henderson -- strict thread matches above, loose matches on Subject: below -- 2022-08-10 16:50 Laurent Vivier 2022-08-10 19:14 ` Richard Henderson
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).