From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzOCk-0001bN-0c for qemu-devel@nongnu.org; Thu, 19 Nov 2015 07:20:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzOCf-0008Aq-2g for qemu-devel@nongnu.org; Thu, 19 Nov 2015 07:20:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60785) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzOCe-0008Ak-Ol for qemu-devel@nongnu.org; Thu, 19 Nov 2015 07:20:40 -0500 References: <1447884913-8011-1-git-send-email-glaubitz@physik.fu-berlin.de> <1447884913-8011-2-git-send-email-glaubitz@physik.fu-berlin.de> <564D965A.2020205@physik.fu-berlin.de> <564DA2CB.5090901@redhat.com> From: Laurent Vivier Message-ID: <564DBE95.9070807@redhat.com> Date: Thu, 19 Nov 2015 13:20:37 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] linux-user: Enable sigaltstack syscall for sh4 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Michael Karcher , QEMU Developers , John Paul Adrian Glaubitz On 19/11/2015 12:15, Peter Maydell wrote: > On 19 November 2015 at 10:22, Laurent Vivier wrote: >> Hi, >> >> On 19/11/2015 10:28, John Paul Adrian Glaubitz wrote: >>> On 11/19/2015 10:17 AM, Peter Maydell wrote: >>>> Unfortunately this isn't sufficient. You also need to add >>>> the code to the sh4-specific functions in linux-user/signal.c >>>> which honours the requested sigaltstack when taking and returning >>>> from signal handlers. >> >> it seems all needed functions for sh4 signal handling are already >> written in linux-user/signal.c, I thing about setup_frame(), >> setup_rt_frame(), do_sigreturn() and do_rt_sigreturn(). > > Other architectures have calls to do_sigaltstack or other > sigaltstack handling in their frame setup and sigreturn > functions. SH4 doesn't, which implied to me that we were > missing something beyond just enabling the call to do_sigaltstack. > Maybe that's for something else? Well, I didn't really check the code in these functions, but SH4 has the call in do_rt_sigreturn(). The only check I did is to compare setup_frame() with the one from kernel and it seems ok. But I think the patch from Adrian is just fixing a forgetting in the original SH4 patch: c3b5bc8 SH4: Signal handling for the user space emulator, by Magnus Damm. This patch uses do_sigaltstack() without enabling sigaltstack() syscall. > (Incidentally the only targets other than SH4 not listed in > this ifdef are CRIS, Microblaze, TileGX and Unicore32. > Maybe we should just go ahead and remove the ifdef entirely, > if do_sigaltstack() doesn't really have any target-specific > requirements?) I don't know if these targets have a lot of users. At least for SH4, we can enable it and see if someone is screaming (I like the "crash-test method" :) ). I think Adrian will take care of this (and I can help). Thanks, Laurent