From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I7rde-0008KQ-Op for qemu-devel@nongnu.org; Mon, 09 Jul 2007 07:42:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I7rdd-0008KB-LR for qemu-devel@nongnu.org; Mon, 09 Jul 2007 07:42:46 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I7rdd-0008K8-Go for qemu-devel@nongnu.org; Mon, 09 Jul 2007 07:42:45 -0400 Received: from grayson.netsweng.com ([207.235.77.11]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I7rdd-0006Ix-5H for qemu-devel@nongnu.org; Mon, 09 Jul 2007 07:42:45 -0400 Received: from amavis by grayson.netsweng.com with scanned-ok (Exim 3.36 #1 (Debian)) id 1I7rdG-0006Bm-00 for ; Mon, 09 Jul 2007 07:42:22 -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 FrPa-bZiFrkq for ; Mon, 9 Jul 2007 07:42:05 -0400 (EDT) Received: from h231.94.213.151.ip.alltel.net ([151.213.94.231] helo=trantor.stuart.netsweng.com) by grayson.netsweng.com with esmtp (Exim 3.36 #1 (Debian)) id 1I7rcu-0006B9-00 for ; Mon, 09 Jul 2007 07:42:00 -0400 Date: Mon, 9 Jul 2007 07:41:34 -0400 (EDT) From: Stuart Anderson Subject: Re: [Qemu-devel] [PATCH] linux-user EFAULT implementation In-Reply-To: Message-ID: References: <468E68F7.8070005@bellard.org> 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 Fri, 6 Jul 2007, Stuart Anderson wrote: > So, the question is: > > Can I simplify this code to assume that guest and > host addresses coexist and use the copy_*_user() or > just the access_ok() interfaces? Attached is a diff that shows what this will look like for the struct sockaddr handling case. In short, the two functions for mapping this structure get renamed target_to_host_sockaddr -> copy_from_user_sockaddr host_to_target_sockaddr -> copy_to_user_sockaddr and lose the pg_access parameter as read/write access is determined by wether we are copying to or from "user space". The macro access_ok() is used to check the validity of the memory being accessed. This change also completely drops the notion of locking and unlocking memory, which was the previous model being used. Fabrice, Is this change what you had in mind? Does it cause a problem for anyone else? 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