From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4EyK-00004t-Hz for qemu-devel@nongnu.org; Fri, 17 Jan 2014 14:20:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W4EyG-0002wQ-4n for qemu-devel@nongnu.org; Fri, 17 Jan 2014 14:20:52 -0500 Received: from hendrix.mega-nerd.net ([203.206.230.162]:38594) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4EyF-0002wK-Mz for qemu-devel@nongnu.org; Fri, 17 Jan 2014 14:20:48 -0500 Received: from rollins.mnn (pharoah-vpn [10.9.8.2]) by hendrix.mega-nerd.net (Postfix) with SMTP id 3E6DA106DDA for ; Sat, 18 Jan 2014 06:20:44 +1100 (EST) Date: Sat, 18 Jan 2014 06:20:44 +1100 From: Erik de Castro Lopo Message-Id: <20140118062044.dc6e92d3183e3ddc65fd31a3@mega-nerd.com> In-Reply-To: References: <20140117173320.7f76b2c5735ae5bf7ed98821@mega-nerd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Question on pointers in the qemu user space emulation Reply-To: qemu-devel@nongnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Peter Maydell wrote: > On 17 January 2014 06:33, Erik de Castro Lopo wrote: > > I'm currently working on implementing a missing part of a linux-user > > syscall. This syscall includes a function pointer for a callback. > > Which syscall? Callbacks from the kernel are pretty tricky. > Basically you need to register a host function as the callback > with the host kernel, and stash the guest function pointer somewhere > so that when the callback comes in from the host kernel you can > arrange to interrupt the guest and restart it at the desired > location. > > Pretty much the only situation we support this for is the special > case of signal handlers. In fact I wasn't even aware there was > any other kind of kernel-to-userspace callback... The syscall is kind of signal related. When I implemented the POSIX timer syscalls a little while ago I got them working for my specific use case. Since then someone pointed out that the implementation was not complete and I'd like to fix that. The ticket is here: https://bugs.launchpad.net/qemu/+bug/1042388#27 and the guest user space test case here: https://bugs.launchpad.net/qemu/+bug/1042388/+attachment/3948443/+files/timer_test.c Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/