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
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|