[Qemu-devel] [PATCH] fcntl64 fix

2007-03-25 Thread Kirill A. Shutemov
TARGET_F_*64 should be used instead of F_*64, because on 64-bit host systems F_GETLK == F_GETLK64(same for SETLK and SETLKW), so we cannot determinate if it's a long lock or not on a target system. Patch in the attachment. P.S. Please, review my privious patches, which I have added description

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-25 Thread Kirill A. Shutemov
On [Tue, 20.03.2007 21:47], Thiemo Seufer wrote: Stuart Anderson wrote: [snip] --- linux-user/syscall_defs.h.orig 2007-02-23 15:44:47.0 -0500 +++ linux-user/syscall_defs.h 2007-02-23 15:44:26.0 -0500 @@ -1414,7 +1414,9 @@ struct target_eabi_flock64 { short

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-25 Thread Kirill A. Shutemov
On [Tue, 20.03.2007 19:05], Stuart Anderson wrote: Now that the dust has settled, I see where the change is probably a no-op anyway. A quick little test program indicates that on x86_64, l_start will have an offset of 8 wether the structure is packed or not, and wether the __pad member is

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-22 Thread Kirill A. Shutemov
On [Tue, 20.03.2007 13:42], Kirill A. Shutemov wrote: Yep. You're right. Fixed patch in the attachment. Patch that fixes dummy bug in the attachment. Sorry. -- Regards, Kirill A. Shutemov + Belarus, Minsk + Velesys LLC, http://www.velesys.com/ + ALT Linux Team, http://www.altlinux.com/

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-21 Thread Stuart Anderson
On Wed, 21 Mar 2007, Kirill A. Shutemov wrote: Primarily, I also thought that problem is in padding, because, without the patch F_GETLK, on 32-bit target recognises as F_GETLK64 on 64-bit host. It's happen because on 64-bit host and 32-bit target F_GETLK == F_GETLK64 == TARGET_F_GETLK. So if

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-21 Thread Stuart Anderson
On Tue, 20 Mar 2007, Paul Brook wrote: Now that the dust has settled, I see where the change is probably a no-op anyway. A quick little test program indicates that on x86_64, l_start will have an offset of 8 wether the structure is packed or not, and wether the __pad member is present or not.

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-20 Thread Kirill A. Shutemov
Yep. You're right. Fixed patch in the attachment. On [Mon, 19.03.2007 17:12], Thiemo Seufer wrote: Kirill A. Shutemov wrote: TARGET_F_*64 should be used instead of F_*64, because on 64-bit host systems F_GETLK == F_GETLK64(same for SETLK and SETLKW), so we cannot determinate if it's a long

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-20 Thread Kirill A. Shutemov
On [Tue, 20.03.2007 09:55], Stuart Anderson wrote: On Tue, 20 Mar 2007, Kirill A. Shutemov wrote: Yep. You're right. Fixed patch in the attachment. Kiril, What 32 bit host and 64 bit host are you using? I'm working on arm on x86_64, and I'm starting to think that perhaps all of

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-20 Thread Stuart Anderson
On Tue, 20 Mar 2007, Kirill A. Shutemov wrote: Kiril, What 32 bit host and 64 bit host are you using? I'm working on arm on x86_64, and I'm starting to think that perhaps all of the different parts of the fix are needed to ensure it works correctly on all target/host combinations.

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-20 Thread Kirill A. Shutemov
On [Tue, 20.03.2007 12:53], Stuart Anderson wrote: On Tue, 20 Mar 2007, Kirill A. Shutemov wrote: Kiril, What 32 bit host and 64 bit host are you using? I'm working on arm on x86_64, and I'm starting to think that perhaps all of the different parts of the fix are needed to ensure it

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-20 Thread Stuart Anderson
On Tue, 20 Mar 2007, Kirill A. Shutemov wrote: What are you using as a test app? I got error when runing Debian's apt-get and tried to fix it. OK, that's what got me started on this one, but I switched to using the ltp-kernel-test package for a more comprehensive set of tests once I got

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-20 Thread Kirill A. Shutemov
On [Tue, 20.03.2007 14:03], Stuart Anderson wrote: On Tue, 20 Mar 2007, Kirill A. Shutemov wrote: What are you using as a test app? I got error when runing Debian's apt-get and tried to fix it. OK, that's what got me started on this one, but I switched to using the ltp-kernel-test

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-20 Thread Stuart Anderson
On Tue, 20 Mar 2007, Kirill A. Shutemov wrote: No. Remap is needed: $ uname -m; echo -e '#include fcntl.h\nF_GETLK64' | cpp | tail -1 x86_64 5 $ uname -m; echo -e '#include fcntl.h\nF_GETLK64' | cpp | tail -1 armv5l 12 Same for F_SETLK64 and F_SETLKW64. You are right. I had previously

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-20 Thread Stuart Anderson
OK, I think I finally have it all sorted out. Sorry if I sounded dense along the way.. there were multiple variable, which increases the number of possible combinations quickly. The patch from Kirill is needed, and makes things better. One thing I notice with it is that we now handle

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-20 Thread Paul Brook
struct target_eabi_flock64 { short l_type; short l_whence; +#if HOST_LONG_BITS == 32 int __pad; +#endif This change is definitely wrong. This is a target structure, and is packed, so should be independent of the host. Paul

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-20 Thread Thiemo Seufer
Stuart Anderson wrote: [snip] --- linux-user/syscall_defs.h.orig2007-02-23 15:44:47.0 -0500 +++ linux-user/syscall_defs.h 2007-02-23 15:44:26.0 -0500 @@ -1414,7 +1414,9 @@ struct target_eabi_flock64 { short l_type; short l_whence; +#if HOST_LONG_BITS == 32

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-20 Thread Stuart Anderson
On Tue, 20 Mar 2007, Thiemo Seufer wrote: Still, this part makes no sense to me since it is in a packed struct. Can you explain why this works better for you? It worked better, in that it fixed a problem that let me continue on to fix other issues. After revisiting fcntl() and coming up with

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-20 Thread Kirill A. Shutemov
On [Tue, 20.03.2007 21:47], Thiemo Seufer wrote: Stuart Anderson wrote: [snip] --- linux-user/syscall_defs.h.orig 2007-02-23 15:44:47.0 -0500 +++ linux-user/syscall_defs.h 2007-02-23 15:44:26.0 -0500 @@ -1414,7 +1414,9 @@ struct target_eabi_flock64 { short

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-20 Thread Kirill A. Shutemov
On [Tue, 20.03.2007 19:05], Stuart Anderson wrote: Now that the dust has settled, I see where the change is probably a no-op anyway. A quick little test program indicates that on x86_64, l_start will have an offset of 8 wether the structure is packed or not, and wether the __pad member is

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-20 Thread Paul Brook
Now that the dust has settled, I see where the change is probably a no-op anyway. A quick little test program indicates that on x86_64, l_start will have an offset of 8 wether the structure is packed or not, and wether the __pad member is present or not. The unsigned long long is always going

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-19 Thread Thiemo Seufer
Kirill A. Shutemov wrote: TARGET_F_*64 should be used instead of F_*64, because on 64-bit host systems F_GETLK == F_GETLK64(same for SETLK and SETLKW), so we cannot determinate if it's a long lock or not on a target 32-bit system. Patch in the attachment. P.S. Please, review my privious

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-19 Thread Stuart Anderson
My initial fix was before I started using LTP, and just took care of a single case that was holding me up. Now I have run the fcntl tests in LTP on ARM (both oABI and EABI) and there are a lot of failures indicating that there is a lot more work to be done yet on fcntl(). I'll take a look into

Re: [Qemu-devel] [PATCH] fcntl64 fix

2007-03-19 Thread Stuart Anderson
On Mon, 19 Mar 2007, Stuart Anderson wrote: My initial fix was before I started using LTP, and just took care of a single case that was holding me up. Now I have run the fcntl tests in LTP on ARM (both oABI and EABI) and there are a lot of failures indicating that there is a lot more work to

[Qemu-devel] [PATCH] fcntl64 fix

2007-03-09 Thread Kirill A. Shutemov
TARGET_F_*64 should be used instead of F_*64, because on 64-bit host systems F_GETLK == F_GETLK64(same for SETLK and SETLKW), so we cannot determinate if it's a long lock or not on a target 32-bit system. Patch in the attachment. P.S. Please, review my privious patches, which I have added