[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4FB58EFD.7010302@zytor.com>
Date: Thu, 17 May 2012 16:51:25 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: "H.J. Lu" <hjl.tools@...il.com>
CC: linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
torvalds@...ux-foundation.org, mingo@...nel.org, tglx@...utronix.de
Subject: Re: [PATCH 08/10] Use __kernel_ulong_t in struct msqid64_ds
On 05/17/2012 03:13 PM, H.J. Lu wrote:
> From: "H.J. Lu" <hjl.tools@...il.com>
>
> Replace unsigned long with __kernel_ulong_t in struct msqid64_ds for
> user space. Don't change unsigned long when __BITS_PER_LONG != 64
> since __kernel_ulong_t == unsigned long in this case.
>
> Signed-off-by: H.J. Lu <hjl.tools@...il.com>
This patch and the one before it seems to have another problem: we
currently define __BITS_PER_LONG as:
#ifdef __x86_64__
# define __BITS_PER_LONG 64
#else
# define __BITS_PER_LONG 32
#endif
... which means __BITS_PER_LONG == 64 on x86-64. This seems wrong. The
result would seem to be that the padding members around __kernel_time_t
in struct shmid64_ds (not visible in patch 07/10 but existing in the
same structure) work by accident (I also wonder how the heck they're
currently supposed to work on bigendian architectures!!)
However, whereas struct shmid64_ds seems to work okay, this patch would
now seem to be wrong.
The sane thing would seem to be to change __BITS_PER_LONG to 32 on x32
and fix the padding hacks in struct shmid64_ds; H.J., would you agree?
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists