Pull request linux-user 20220812
-----BEGIN PGP SIGNATURE----- iQJGBAABCAAwFiEEzS913cjjpNwuT1Fz8ww4vT8vvjwFAmL2LIUSHGxhdXJlbnRA dml2aWVyLmV1AAoJEPMMOL0/L748L8QP/iHtv9fsHZe7ANCMd2UjpPo5CZTJxMEa T8muaNasIJPoZbQR5WJRsCT8j5lNriWYA/xEBYGYlzvn/ZBK+NnUlBYrRFUX3LwQ Oim9gBYReW7nkv2m1Vr5mYXeC1bth4GMqycHSjwJtosYJsp/oTpcQE22/iG3MFBW azu+yM/QV7yuoi6EFyuUq5hefQE139W333x01c3qsekVY4cr4Bc81cpsQhWw/4Y4 e32byrT39vtBvRlC/CuikZXyMqbD+nK+hESkJ9oqI73raC4PaCg10WNHMr1m/pw1 ITPeH6iphVmyOckidHsbBLDkC4FQEVNo9R4j13Nk2gqU3VyLk73Say2GGvXrUEBJ a50XvV897N1M8ZiRUifYnNgawtO7sIOuQViofQtCcIfal9h2AV5Zjnm/5tJXGpnB F0U7hi5bootHtJFMLCBOWLhWVT7SNrzi1ijCFs2irj6grSyvJ9LU7yRHj0pOVC43 WopdzPuxBWye8jRo2YgDQx5BZkBtlmWJgfbhYL3QVFX5wp8vqAgdXl0dXqdid5RN 5RCdBj9HAFwEUqL8n4LVI0EbrjI/IQlVwhZmBjQx3lBh4o08d7AUGUSQnZHDcy3C W6dTkfqPleqdOw5xS9Rw3rHJPHcuGWQNA4MMyvztbMivU/TYN7fwBdXouI9KeeBk wfYTi+n/bkeR =4v8b -----END PGP SIGNATURE----- Merge tag 'linux-user-for-7.1-pull-request' of https://gitlab.com/laurent_vivier/qemu into staging Pull request linux-user 20220812 # -----BEGIN PGP SIGNATURE----- # # iQJGBAABCAAwFiEEzS913cjjpNwuT1Fz8ww4vT8vvjwFAmL2LIUSHGxhdXJlbnRA # dml2aWVyLmV1AAoJEPMMOL0/L748L8QP/iHtv9fsHZe7ANCMd2UjpPo5CZTJxMEa # T8muaNasIJPoZbQR5WJRsCT8j5lNriWYA/xEBYGYlzvn/ZBK+NnUlBYrRFUX3LwQ # Oim9gBYReW7nkv2m1Vr5mYXeC1bth4GMqycHSjwJtosYJsp/oTpcQE22/iG3MFBW # azu+yM/QV7yuoi6EFyuUq5hefQE139W333x01c3qsekVY4cr4Bc81cpsQhWw/4Y4 # e32byrT39vtBvRlC/CuikZXyMqbD+nK+hESkJ9oqI73raC4PaCg10WNHMr1m/pw1 # ITPeH6iphVmyOckidHsbBLDkC4FQEVNo9R4j13Nk2gqU3VyLk73Say2GGvXrUEBJ # a50XvV897N1M8ZiRUifYnNgawtO7sIOuQViofQtCcIfal9h2AV5Zjnm/5tJXGpnB # F0U7hi5bootHtJFMLCBOWLhWVT7SNrzi1ijCFs2irj6grSyvJ9LU7yRHj0pOVC43 # WopdzPuxBWye8jRo2YgDQx5BZkBtlmWJgfbhYL3QVFX5wp8vqAgdXl0dXqdid5RN # 5RCdBj9HAFwEUqL8n4LVI0EbrjI/IQlVwhZmBjQx3lBh4o08d7AUGUSQnZHDcy3C # W6dTkfqPleqdOw5xS9Rw3rHJPHcuGWQNA4MMyvztbMivU/TYN7fwBdXouI9KeeBk # wfYTi+n/bkeR # =4v8b # -----END PGP SIGNATURE----- # gpg: Signature made Fri 12 Aug 2022 03:33:41 AM PDT # gpg: using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C # gpg: issuer "laurent@vivier.eu" # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [undefined] # gpg: aka "Laurent Vivier <laurent@vivier.eu>" [undefined] # gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [undefined] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C * tag 'linux-user-for-7.1-pull-request' of https://gitlab.com/laurent_vivier/qemu: linux-user/aarch64: Reset target data on MADV_DONTNEED Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
commit
6add03bec0
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
/**
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user