From: Hollis Blanchard Subject: Re: user/hypervisor address space solution Date: Wed, 15 Feb 2006 21:48:15 +1100 Message-ID: <1140000495.23614.27.camel@localhost.localdomain> References: <1139283935.13776.71.camel@localhost.localdomain> <1139871396.8407.124.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain 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: Dan Magenheimer , Jimi Xenidis , xen-devel List-Id: xen-devel@lists.xenproject.org On Mon, 2006-02-13 at 23:45 +0000, Keir Fraser wrote: > > On 13 Feb 2006, at 22:56, Hollis Blanchard wrote: > > > There are very few uses of get/put_user() in common code right now, > and > > those can be trivially converted. However, there are some in arch > code > > e.g. xen/arch/x86/domain.c) that cannot, and so the current put_user > > interface would need to be preserved as some arch-specific macro. In > > this case I'd call it "x86_put_user" to emphasize that only x86 arch > > code should be using it. Too many x86isms creep into places like > > grant_table.c... > > I expect copy_to/from_user would also need to change. There are places > where an array of structs are passed to a hcall, a pointer into that > array is passed around in Xen, and individual array entries are copied > in/out. I am very happy to report that, after converting the get/put_user calls as described (and fixing my bugs), domain creation and domU booting is now working with an unmodified libxc. I am still using the simple C tools I hacked up because I need the simplicity/traceability. 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. -- Hollis Blanchard IBM Linux Technology Center