* [Qemu-devel] [PATCH 0/2] [PULL 1.1] linux-user fixes for 1.1 @ 2012-05-03 15:15 riku.voipio 2012-05-03 15:15 ` [Qemu-devel] [PATCH 1/2] linux-user: Clean up interim solution for exit syscall riku.voipio ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: riku.voipio @ 2012-05-03 15:15 UTC (permalink / raw) To: qemu-devel; +Cc: Riku Voipio From: Riku Voipio <riku.voipio@linaro.org> The following fixes since commit f05ae5379e40f81a6c8526d891693af8bf6e62da: Bail out if CONFIG_TCG_PASS_AREG0 is defined (2012-05-03 15:48:49 +0400) are available in the git repository at: git://git.linaro.org/people/rikuvoipio/qemu.git linux-user-for-upstream Please pull for 1.1 Alexander Graf (1): linux-user: fix emulation of /proc/self/maps Andreas Färber (1): linux-user: Clean up interim solution for exit syscall linux-user/syscall.c | 46 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) -- 1.7.9.5 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH 1/2] linux-user: Clean up interim solution for exit syscall 2012-05-03 15:15 [Qemu-devel] [PATCH 0/2] [PULL 1.1] linux-user fixes for 1.1 riku.voipio @ 2012-05-03 15:15 ` riku.voipio 2012-05-03 15:15 ` [Qemu-devel] [PATCH 2/2] linux-user: fix emulation of /proc/self/maps riku.voipio 2012-05-08 16:11 ` [Qemu-devel] [PATCH 0/2] [PULL 1.1] linux-user fixes for 1.1 Anthony Liguori 2 siblings, 0 replies; 4+ messages in thread From: riku.voipio @ 2012-05-03 15:15 UTC (permalink / raw) To: qemu-devel; +Cc: Andreas Färber From: Andreas Färber <afaerber@suse.de> After all target CPUs have been QOM'ified, we no longer need an #ifdef to switch between object_delete() and g_free() in NPTL thread exit. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org> --- linux-user/syscall.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 7128618..801b8ed 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5045,11 +5045,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, NULL, NULL, 0); } thread_env = NULL; -#ifdef ENV_GET_CPU object_delete(OBJECT(ENV_GET_CPU(cpu_env))); -#else - g_free(cpu_env); -#endif g_free(ts); pthread_exit(NULL); } -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH 2/2] linux-user: fix emulation of /proc/self/maps 2012-05-03 15:15 [Qemu-devel] [PATCH 0/2] [PULL 1.1] linux-user fixes for 1.1 riku.voipio 2012-05-03 15:15 ` [Qemu-devel] [PATCH 1/2] linux-user: Clean up interim solution for exit syscall riku.voipio @ 2012-05-03 15:15 ` riku.voipio 2012-05-08 16:11 ` [Qemu-devel] [PATCH 0/2] [PULL 1.1] linux-user fixes for 1.1 Anthony Liguori 2 siblings, 0 replies; 4+ messages in thread From: riku.voipio @ 2012-05-03 15:15 UTC (permalink / raw) To: qemu-devel; +Cc: Alexander Graf From: Alexander Graf <agraf@suse.de> Improve the emulation of /proc/self/maps by reading the underlying host maps file and passing lines through with addresses adjusted to be guest addresses. This is necessary to avoid false triggers of the glibc check that a format string containing '%n' is not in writable memory. (For an example see the bug reported in https://bugs.launchpad.net/qemu-linaro/+bug/947888 where gpg aborts.) Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org> --- linux-user/syscall.c | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 801b8ed..20d2a74 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4866,13 +4866,53 @@ int get_osversion(void) static int open_self_maps(void *cpu_env, int fd) { +#if defined(TARGET_ARM) || defined(TARGET_M68K) || defined(TARGET_UNICORE32) TaskState *ts = ((CPUArchState *)cpu_env)->opaque; +#endif + FILE *fp; + char *line = NULL; + size_t len = 0; + ssize_t read; + + fp = fopen("/proc/self/maps", "r"); + if (fp == NULL) { + return -EACCES; + } + while ((read = getline(&line, &len, fp)) != -1) { + int fields, dev_maj, dev_min, inode; + uint64_t min, max, offset; + char flag_r, flag_w, flag_x, flag_p; + char path[512] = ""; + fields = sscanf(line, "%"PRIx64"-%"PRIx64" %c%c%c%c %"PRIx64" %x:%x %d" + " %512s", &min, &max, &flag_r, &flag_w, &flag_x, + &flag_p, &offset, &dev_maj, &dev_min, &inode, path); + + if ((fields < 10) || (fields > 11)) { + continue; + } + if (!strncmp(path, "[stack]", 7)) { + continue; + } + if (h2g_valid(min) && h2g_valid(max)) { + dprintf(fd, TARGET_ABI_FMT_lx "-" TARGET_ABI_FMT_lx + " %c%c%c%c %08" PRIx64 " %02x:%02x %d%s%s\n", + h2g(min), h2g(max), flag_r, flag_w, + flag_x, flag_p, offset, dev_maj, dev_min, inode, + path[0] ? " " : "", path); + } + } + + free(line); + fclose(fp); + +#if defined(TARGET_ARM) || defined(TARGET_M68K) || defined(TARGET_UNICORE32) dprintf(fd, "%08llx-%08llx rw-p %08llx 00:00 0 [stack]\n", (unsigned long long)ts->info->stack_limit, (unsigned long long)(ts->stack_base + (TARGET_PAGE_SIZE - 1)) & TARGET_PAGE_MASK, - (unsigned long long)ts->stack_base); + (unsigned long long)0); +#endif return 0; } -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 0/2] [PULL 1.1] linux-user fixes for 1.1 2012-05-03 15:15 [Qemu-devel] [PATCH 0/2] [PULL 1.1] linux-user fixes for 1.1 riku.voipio 2012-05-03 15:15 ` [Qemu-devel] [PATCH 1/2] linux-user: Clean up interim solution for exit syscall riku.voipio 2012-05-03 15:15 ` [Qemu-devel] [PATCH 2/2] linux-user: fix emulation of /proc/self/maps riku.voipio @ 2012-05-08 16:11 ` Anthony Liguori 2 siblings, 0 replies; 4+ messages in thread From: Anthony Liguori @ 2012-05-08 16:11 UTC (permalink / raw) To: riku.voipio; +Cc: qemu-devel On 05/03/2012 10:15 AM, riku.voipio@linaro.org wrote: > From: Riku Voipio<riku.voipio@linaro.org> > > The following fixes since commit f05ae5379e40f81a6c8526d891693af8bf6e62da: > > Bail out if CONFIG_TCG_PASS_AREG0 is defined (2012-05-03 15:48:49 +0400) > > are available in the git repository at: > > git://git.linaro.org/people/rikuvoipio/qemu.git linux-user-for-upstream Pulled. Thanks. Regards, Anthony Liguori > > Please pull for 1.1 > > Alexander Graf (1): > linux-user: fix emulation of /proc/self/maps > > Andreas Färber (1): > linux-user: Clean up interim solution for exit syscall > > linux-user/syscall.c | 46 +++++++++++++++++++++++++++++++++++++++++----- > 1 file changed, 41 insertions(+), 5 deletions(-) > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-05-08 16:11 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-05-03 15:15 [Qemu-devel] [PATCH 0/2] [PULL 1.1] linux-user fixes for 1.1 riku.voipio 2012-05-03 15:15 ` [Qemu-devel] [PATCH 1/2] linux-user: Clean up interim solution for exit syscall riku.voipio 2012-05-03 15:15 ` [Qemu-devel] [PATCH 2/2] linux-user: fix emulation of /proc/self/maps riku.voipio 2012-05-08 16:11 ` [Qemu-devel] [PATCH 0/2] [PULL 1.1] linux-user fixes for 1.1 Anthony Liguori
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).