From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60528) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJQup-0007sp-9m for qemu-devel@nongnu.org; Fri, 28 Feb 2014 12:08:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WJQuk-0007zV-Uu for qemu-devel@nongnu.org; Fri, 28 Feb 2014 12:08:03 -0500 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:38972 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJQuk-0007zK-OL for qemu-devel@nongnu.org; Fri, 28 Feb 2014 12:07:58 -0500 References: <87sirhyi1b.fsf@linaro.org> <87txbnfuw1.fsf@linaro.org> <530C5925.8060608@suse.de> <87ppm7fhsb.fsf@linaro.org> <4B6FA9D8-356D-47D1-A270-C71A1216B305@suse.de> From: Alex =?utf-8?Q?Benn=C3=A9e?= Message-ID: <87mwhbf9ni.fsf@linaro.org> In-reply-to: Date: Fri, 28 Feb 2014 17:08:12 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] Call for testing QEMU aarch64-linux-user emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: linaro-dev , Dann Frazier , Michael Matz , Alexander Graf , "linaro-toolchain@lists.linaro.org" , qemu-devel , Wook Wookey , Andreas =?utf-8?Q?F=C3=A4rber?= , Christoffer Dall Peter Maydell writes: > On 28 February 2014 14:27, Alexander Graf wrote: >> Could we check the instruction at the sognaling pc and check >> if it's a known syscall instruction? No need to replace glibc >> wrappers then. > > No, because the behaviour we want for "started handling > syscall in qemu" through to "PC anything up to but not > including the syscall insn" is "back out and take signal > then try again", which means we need to be able to unwind > anything we were doing. If we (effectively) longjmp out of > the middle of glibc we're liable to leave locked mutexes > and otherwise mess up glibc internals. The other option is roll the real PC forward until you know you are at a point that everything is in a known state - in this case a labelled syscall instruction. You can achieve this with a host interpreter (which would be a lot of work to add to QEMU) or maybe achieve the same magic with ptrace? If you really want to avoid too much messing about you mask off all your signals until you really know you can do something about them. It goes without saying I hope that any serious attempt to fix this needs a decent set of test cases because the edge cases are numerous. -- Alex Bennée