[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 25/31] linux-user/elfload: add extra logging for hole finding
From: |
Alex Bennée |
Subject: |
[PULL 25/31] linux-user/elfload: add extra logging for hole finding |
Date: |
Wed, 12 Jan 2022 11:27:16 +0000 |
The various approaches to finding memory holes are quite complicated
to follow especially at a distance. Improve the logging so we can see
exactly what method found the space for the guest memory.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20220105135009.1584676-26-alex.bennee@linaro.org>
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 329b2375ef..8ef0626eb0 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -2267,6 +2267,9 @@ static void pgb_have_guest_base(const char *image_name,
abi_ulong guest_loaddr,
if (test != addr) {
pgb_fail_in_use(image_name);
}
+ qemu_log_mask(CPU_LOG_PAGE,
+ "%s: base @ %p for " TARGET_ABI_FMT_ld " bytes\n",
+ __func__, addr, guest_hiaddr - guest_loaddr);
}
/**
@@ -2309,6 +2312,9 @@ static uintptr_t pgd_find_hole_fallback(uintptr_t
guest_size, uintptr_t brk,
if (mmap_start != MAP_FAILED) {
munmap(mmap_start, guest_size);
if (mmap_start == (void *) align_start) {
+ qemu_log_mask(CPU_LOG_PAGE,
+ "%s: base @ %p for %" PRIdPTR" bytes\n",
+ __func__, mmap_start + offset, guest_size);
return (uintptr_t) mmap_start + offset;
}
}
@@ -2388,6 +2394,12 @@ static uintptr_t pgb_find_hole(uintptr_t guest_loaddr,
uintptr_t guest_size,
}
free_self_maps(maps);
+ if (ret != -1) {
+ qemu_log_mask(CPU_LOG_PAGE, "%s: base @ %" PRIxPTR
+ " for %" PRIuPTR " bytes\n",
+ __func__, ret, guest_size);
+ }
+
return ret;
}
@@ -2439,6 +2451,9 @@ static void pgb_static(const char *image_name, abi_ulong
orig_loaddr,
}
guest_base = addr;
+
+ qemu_log_mask(CPU_LOG_PAGE, "%s: base @ %"PRIxPTR" for %" PRIuPTR"
bytes\n",
+ __func__, addr, hiaddr - loaddr);
}
static void pgb_dynamic(const char *image_name, long align)
@@ -2495,6 +2510,9 @@ static void pgb_reserved_va(const char *image_name,
abi_ulong guest_loaddr,
"using -R option)", reserved_va, test, strerror(errno));
exit(EXIT_FAILURE);
}
+
+ qemu_log_mask(CPU_LOG_PAGE, "%s: base @ %p for %lu bytes\n",
+ __func__, addr, reserved_va);
}
void probe_guest_base(const char *image_name, abi_ulong guest_loaddr,
--
2.30.2
- [PULL 04/31] ui: avoid warnings about directdb on Alpine / musl libc, (continued)
- [PULL 04/31] ui: avoid warnings about directdb on Alpine / musl libc, Alex Bennée, 2022/01/12
- [PULL 05/31] ci: explicitly skip I/O tests on alpine, Alex Bennée, 2022/01/12
- [PULL 14/31] .gitlab-ci.d/cirrus: auto-generate variables with lcitool, Alex Bennée, 2022/01/12
- [PULL 16/31] tests/docker: fix sorting of alpine image package lists, Alex Bennée, 2022/01/12
- [PULL 17/31] tests/docker: fully expand the alpine package list, Alex Bennée, 2022/01/12
- [PULL 15/31] tests/docker: updates to alpine package list, Alex Bennée, 2022/01/12
- [PULL 18/31] tests/docker: auto-generate alpine.docker with lcitool, Alex Bennée, 2022/01/12
- [PULL 21/31] hw/arm: add control knob to disable kaslr_seed via DTB, Alex Bennée, 2022/01/12
- [PULL 22/31] monitor: move x-query-profile into accel/tcg to fix build, Alex Bennée, 2022/01/12
- [PULL 23/31] docs/devel: update C standard to C11, Alex Bennée, 2022/01/12
- [PULL 25/31] linux-user/elfload: add extra logging for hole finding,
Alex Bennée <=
- [PULL 31/31] linux-user: Remove the deprecated ppc64abi32 target, Alex Bennée, 2022/01/12
- [PULL 11/31] tests/docker: auto-generate ubuntu2004.docker with lcitool, Alex Bennée, 2022/01/12
- [PULL 30/31] docker: include bison in debian-tricore-cross, Alex Bennée, 2022/01/12
- [PULL 19/31] tests/tcg: use CONFIG_LINUX_USER, not CONFIG_LINUX, Alex Bennée, 2022/01/12
- [PULL 26/31] linux-user: don't adjust base of found hole, Alex Bennée, 2022/01/12
- [PULL 29/31] FreeBSD: Upgrade to 12.3 release, Alex Bennée, 2022/01/12
- [PULL 28/31] test/tcg/ppc64le: Add float reference files, Alex Bennée, 2022/01/12
- [PULL 24/31] docs/devel: more documentation on the use of suffixes, Alex Bennée, 2022/01/12
- [PULL 27/31] tests/tcg/multiarch: Read fp flags before printf, Alex Bennée, 2022/01/12
- Re: [PULL 00/31] testing/next and other misc fixes, Peter Maydell, 2022/01/12