From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IXxmQ-00048B-RW for qemu-devel@nongnu.org; Wed, 19 Sep 2007 07:31:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IXxmQ-00047z-A6 for qemu-devel@nongnu.org; Wed, 19 Sep 2007 07:31:42 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IXxmQ-00047w-41 for qemu-devel@nongnu.org; Wed, 19 Sep 2007 07:31:42 -0400 Received: from grayson.netsweng.com ([207.235.77.11]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IXxmP-0002t9-Nh for qemu-devel@nongnu.org; Wed, 19 Sep 2007 07:31:41 -0400 Received: from amavis by grayson.netsweng.com with scanned-ok (Exim 3.36 #1 (Debian)) id 1IXxmP-0006Er-00 for ; Wed, 19 Sep 2007 07:31:41 -0400 Received: from grayson.netsweng.com ([127.0.0.1]) by localhost (grayson.netsweng.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MXq3a7TFKRtt for ; Wed, 19 Sep 2007 07:31:16 -0400 (EDT) Received: from h134.99.28.71.ip.alltel.net ([71.28.99.134] helo=trantor.stuart.netsweng.com) by grayson.netsweng.com with esmtp (Exim 3.36 #1 (Debian)) id 1IXxm0-0006EX-00 for ; Wed, 19 Sep 2007 07:31:16 -0400 Date: Wed, 19 Sep 2007 07:30:49 -0400 (EDT) From: Stuart Anderson Subject: Re: [Qemu-devel] RFC: [0/11] EFAULT patch In-Reply-To: <1190167518.14938.348.camel@rapid> Message-ID: References: <1190167518.14938.348.camel@rapid> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Wed, 19 Sep 2007, J. Mayer wrote: > The idea is great but there seem to be a problem in those patches: > you directly cast syscall arguments, which are (or should be) > target_ulong to pointers in the host environment. You should to use the > g2h / h2g macros to get the pointer in the host memory from the offset > in the target address space. I was explicitly told to _not_ use these in this code. > Offset in the target address space can not > be assumed to be the same size as an address in the host address space, And in fact, they definitely are not the same in certain cobinations. > thus can never be casted directly to host pointer. At some point, we have to convert things from target_long to a host pointer. If we can agree on what that right mechanism it to do this, I'd be glad to use it. So far, everything I've seen involved some form of type casting. > This used to be handled by the lock_user functions and should be handled > in your patch too... It was handled by g2h() which was just a typecast hidden behind the macro. Stuart Stuart R. Anderson anderson@netsweng.com Network & Software Engineering http://www.netsweng.com/ 1024D/37A79149: 0791 D3B8 9A4C 2CDC A31F BD03 0A62 E534 37A7 9149