Re: [Qemu-devel] Re: [PATCH] efault - add data type to put_user()/get_user()

2007-11-05 Thread Fabrice Bellard
Thayne Harbaugh wrote: > On Mon, 2007-11-05 at 22:42 +0100, Fabrice Bellard wrote: >> Thayne Harbaugh wrote: >>> On Sat, 2007-11-03 at 20:05 +0100, Fabrice Bellard wrote: I think that using host addresses in __put_user and __get_user is not logical. They should use target addresses as get

Re: [Qemu-devel] Re: [PATCH] efault - add data type to put_user()/get_user()

2007-11-05 Thread Thayne Harbaugh
On Mon, 2007-11-05 at 22:42 +0100, Fabrice Bellard wrote: > Thayne Harbaugh wrote: > > On Sat, 2007-11-03 at 20:05 +0100, Fabrice Bellard wrote: > >> I think that using host addresses in __put_user and __get_user is not > >> logical. They should use target addresses as get_user and put_user. As >

Re: [Qemu-devel] Re: [PATCH] efault - add data type to put_user()/get_user()

2007-11-05 Thread Fabrice Bellard
Thayne Harbaugh wrote: > On Sat, 2007-11-03 at 20:05 +0100, Fabrice Bellard wrote: >> I think that using host addresses in __put_user and __get_user is not >> logical. They should use target addresses as get_user and put_user. As >> Paul said, It is not worth mixing get/put/copy and lock/unlock fun

Re: [Qemu-devel] Re: [PATCH] efault - add data type to put_user()/get_user()

2007-11-05 Thread Thayne Harbaugh
Uhhh, I'm quite uncomfortable now. After sending the emails describing how everything should be done I realized that I had never reworked my base patches. All my higher-level patches are sound, but I never reworked my {get,put}_user() and copy_{to,from}_user() patches to follow the same pattern.

Re: [Qemu-devel] Re: [PATCH] efault - add data type to put_user()/get_user()

2007-11-05 Thread Thayne Harbaugh
On Sat, 2007-11-03 at 20:05 +0100, Fabrice Bellard wrote: > I think that using host addresses in __put_user and __get_user is not > logical. They should use target addresses as get_user and put_user. As > Paul said, It is not worth mixing get/put/copy and lock/unlock functions. Please see the "RF

Re: [Qemu-devel] Re: [PATCH] efault - add data type to put_user()/get_user()

2007-11-03 Thread Fabrice Bellard
I think that using host addresses in __put_user and __get_user is not logical. They should use target addresses as get_user and put_user. As Paul said, It is not worth mixing get/put/copy and lock/unlock functions. The ultimate goal of such cleanup is not only to generate -EFAULT correctly but als

Re: [Qemu-devel] Re: [PATCH] efault - add data type to put_user()/get_user()

2007-11-03 Thread Thiemo Seufer
Thayne Harbaugh wrote: > > On Wed, 2007-10-31 at 16:44 -0600, Thayne Harbaugh wrote: > > This patch updates get_user() and put_user() to take a third argument of > > data type. get_user() and put_user() use target address which are > > target_ulong and don't reflect the data type pointed to in ta

[Qemu-devel] Re: [PATCH] efault - add data type to put_user()/get_user()

2007-11-02 Thread Thayne Harbaugh
On Wed, 2007-10-31 at 16:44 -0600, Thayne Harbaugh wrote: > This patch updates get_user() and put_user() to take a third argument of > data type. get_user() and put_user() use target address which are > target_ulong and don't reflect the data type pointed to in target > memory. > > Simply castin

[Qemu-devel] Re: [PATCH] efault

2007-10-31 Thread Thayne Harbaugh
These three efault patches are the basis for another 30 patches which do the following: * Correct compiler warnings. * Add coding consistency. * Detect error cases and handle them properly. * Divide syscall.c to closer resemble the Linux kernel for code partitioning and organization. * Add new fea

[Qemu-devel] Re: [PATCH] efault - add data type to put_user()/get_user()

2007-10-31 Thread Thayne Harbaugh
This patch updates get_user() and put_user() to take a third argument of data type. get_user() and put_user() use target address which are target_ulong and don't reflect the data type pointed to in target memory. Simply casting the target_ulong to a type before passing to get/put_user() is poor b

[Qemu-devel] Re: [PATCH] efault - update __get_user() __put_user()

2007-10-31 Thread Thayne Harbaugh
This patch is a minor update to __get_user() and __put_user() to emphasize that they take host points. Index: qemu/linux-user/qemu.h === --- qemu.orig/linux-user/qemu.h 2007-10-31 11:03:03.0 -0600 +++ qemu/linux-user/qemu.h 200