linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* struct user . u_ar0
@ 2007-10-28  0:54 H. Peter Anvin
  2007-10-28  8:04 ` Mike Frysinger
  0 siblings, 1 reply; 3+ messages in thread
From: H. Peter Anvin @ 2007-10-28  0:54 UTC (permalink / raw)
  To: linux-arch; +Cc: Linux Kernel Mailing List

I recently noticed that all architectures appear to have an entry n 
struct user called u_ar0:

   struct user_pt_regs * u_ar0;  /* Used by gdb to help find the values 
for */
                                 /* the registers. */

In all cases, u_ar0 is a pointer type, although the type of pointer 
varies with the architecture.

However, under no conditions does this field ever contain a pointer 
value!  It is set by the a.out code and its derivatives as an offset, 
not a pointer value (there are a total of four references in the kernel, 
in arch/{m68k,blackfin}/kernel/process.c, arch/x86/ia32/ia32_aout.c and 
fs/binfmt_aout.c -- they are all functionally identical and write-only):

dump.u_ar0 = (void *)(((unsigned long)(&dump.regs)) - ((unsigned 
long)(&dump)));

Any reason to *NOT* change this field to "unsigned long"?  <asm/user.h>, 
where struct user is defined, is not exported to userspace in any 
architecture as far as I can tell, although <linux/user.h>, which just 
contains #include <asm/user.h>, *is* exported (clearly a bug.)

	-hpa



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: struct user . u_ar0
  2007-10-28  0:54 struct user . u_ar0 H. Peter Anvin
@ 2007-10-28  8:04 ` Mike Frysinger
  2007-10-28 18:27   ` H. Peter Anvin
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Frysinger @ 2007-10-28  8:04 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: linux-arch, Linux Kernel Mailing List

On 10/27/07, H. Peter Anvin <hpa@zytor.com> wrote:
> I recently noticed that all architectures appear to have an entry n
> struct user called u_ar0:
>
>    struct user_pt_regs * u_ar0;  /* Used by gdb to help find the values
> for */
>                                  /* the registers. */
>
> In all cases, u_ar0 is a pointer type, although the type of pointer
> varies with the architecture.
>
> However, under no conditions does this field ever contain a pointer
> value!  It is set by the a.out code and its derivatives as an offset,
> not a pointer value (there are a total of four references in the kernel,
> in arch/{m68k,blackfin}/kernel/process.c, arch/x86/ia32/ia32_aout.c and
> fs/binfmt_aout.c -- they are all functionally identical and write-only):
>
> dump.u_ar0 = (void *)(((unsigned long)(&dump.regs)) - ((unsigned
> long)(&dump)));
>
> Any reason to *NOT* change this field to "unsigned long"?  <asm/user.h>,
> where struct user is defined, is not exported to userspace in any
> architecture as far as I can tell, although <linux/user.h>, which just
> contains #include <asm/user.h>, *is* exported (clearly a bug.)

Blackfin doesnt support a.out, so it may be easier to just change it
to "reserved2" (assuming this structure is part of our ABI), or delete
it (assuming the structure is internal to the kernel only).
-mike

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: struct user . u_ar0
  2007-10-28  8:04 ` Mike Frysinger
@ 2007-10-28 18:27   ` H. Peter Anvin
  0 siblings, 0 replies; 3+ messages in thread
From: H. Peter Anvin @ 2007-10-28 18:27 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: linux-arch, Linux Kernel Mailing List

Mike Frysinger wrote:
> 
> Blackfin doesnt support a.out, so it may be easier to just change it
> to "reserved2" (assuming this structure is part of our ABI), or delete
> it (assuming the structure is internal to the kernel only).
> -mike

Blackfin explicitly sets in in arch/blackfin/kernel/process.c, so you 
might want to consider what it is used for.  As far as a.out is 
concerned, it appears to be part of the core dump format.

	-hpa


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-28 18:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-28  0:54 struct user . u_ar0 H. Peter Anvin
2007-10-28  8:04 ` Mike Frysinger
2007-10-28 18:27   ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).