From: Hollis Blanchard Subject: Re: user/hypervisor address space solution Date: Thu, 16 Feb 2006 21:40:40 -0600 Message-ID: <751415e1574c13834eaf0a37f44a3c23@us.ibm.com> References: <1139283935.13776.71.camel@localhost.localdomain> <1139871396.8407.124.camel@localhost.localdomain> <1140000495.23614.27.camel@localhost.localdomain> Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Jimi Xenidis , Dan Magenheimer , xen-devel List-Id: xen-devel@lists.xenproject.org On Feb 15, 2006, at 5:23 AM, Keir Fraser wrote: > > On 15 Feb 2006, at 10:48, Hollis Blanchard wrote: > >> I will be busy for a week or so, but I will try to come up with a >> patch >> that converts x86 and ia64 and all common code to the proposed API: >> get_user_offset(val, base, offset) >> put_user_offset(val, base, offset) >> get_user_array(val, array, index) >> put_user_array(val, array, index) >> copy_to_user(to, from, len) >> copy_from_user(to, from, len) >> ... plus __ variants of all of these, with identical arguments >> ... plus arch-specific get/put_user for e.g. xen/arch/x86/domain.c, >> since some of those usages don't seem to fit above. >> >> If you don't like the API, please speak up now. > > Should be called get_guest/put_guest/copy_from_guest/copy_to_guest. > Better names, and the arch-specific old functions can still keep their > old names. "guest" not "domain"? Either way is fine with me. If we do leave the old names in, though, I'm sure people will slip them into common code... > What's the difference between foo_offset() and foo_array()? Just convenience: many (most?) users of get/put_user() are to an address like "&array[index]". If we only had _offset(), those callers would look like: put_user(val, array, sizeof(*array)*index); Actually that doesn't look too bad. :) If you're ok with that, we can stick with just the "offset" variant. -- Hollis Blanchard IBM Linux Technology Center