From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57224) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4AEd-0000GQ-TQ for qemu-devel@nongnu.org; Fri, 17 Jan 2014 09:17:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W4AEW-0006bs-Js for qemu-devel@nongnu.org; Fri, 17 Jan 2014 09:17:23 -0500 Received: from smtp.codeaurora.org ([198.145.11.231]:49271) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4AEW-0006be-D1 for qemu-devel@nongnu.org; Fri, 17 Jan 2014 09:17:16 -0500 Message-ID: <52D93B68.7060707@codeaurora.org> Date: Fri, 17 Jan 2014 09:17:12 -0500 From: Christopher Covington MIME-Version: 1.0 References: <20140117173320.7f76b2c5735ae5bf7ed98821@mega-nerd.com> In-Reply-To: <20140117173320.7f76b2c5735ae5bf7ed98821@mega-nerd.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Question on pointers in the qemu user space emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Erik de Castro Lopo Hi Erik, On 01/17/2014 01:33 AM, Erik de Castro Lopo wrote: > Hi all, > > I'm currently working on implementing a missing part of a linux-user > syscall. This syscall includes a function pointer for a callback. > > If one has a 64 bit user space emulation running on a 32 bit host, > how does one handle the fact that the pointer might be 64 bits? > > Does the fact that the 32 bit host can only ever give out 32 bit > addreses to the 64 bit guest just cancel out the possibility of > any problems? Not that I know anything about QEMU internals yet, but just for fun here's my armchair philosophizing. My interpretation of the scenario you describe is that some function exists in a 64-bit instruction set architecture. QEMU/TCG has translated it to the host's native 32-bit ISA for actual execution. It seems like you should be exclusively communicating the address of the 32-bit translated version to the host kernel. I don't think the host kernel could do anything useful with a pointer to the foreign ISA version, even if it got the address right. Regards, Christopher -- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation.