All of lore.kernel.org
 help / color / mirror / Atom feed
* [parisc-linux] parisc64 kernel and ret1 (gr29) setup
@ 2000-12-21 16:00 Richard Hirst
  2000-12-21 20:57 ` Matthew Wilcox
  2001-01-23 13:45 ` Richard Hirst
  0 siblings, 2 replies; 12+ messages in thread
From: Richard Hirst @ 2000-12-21 16:00 UTC (permalink / raw)
  To: parisc-linux

Hi,
  I tried calling ptrace() from a 32 bit app on a 64 bit kernel, and
the kernel crashed.  sys_ptrace needs a 32 bit wrapper, but that is
a seperate issue (I think).

It died at sys_ptrace+0x28, where it tried to use ret1.
(ret1 = 00000000000517a1):

0000000000000000 <sys_ptrace>:
   0:   0f c2 12 c1     std  rp,-10(sr0,sp)
   4:   37 de 03 00     ldo 180(sp),sp
   8:   73 c5 3e 51     std r5,-d8(sp)
   c:   37 a5 3f 81     ldo -40(ret1),r5
  10:   73 c4 3e 61     std r4,-d0(sp)
  14:   08 1b 02 44     copy dp,r4
  18:   db 39 0f e0     extrd,s r25,63,32,r25
  1c:   73 c8 3e 31     std r8,-e8(sp)
  20:   73 c6 3e 41     std r6,-e0(sp)
  24:   73 c3 3e 71     std r3,-c8(sp)
  28:   73 b7 3f b1     std r23,-28(ret1)
  2c:   ef 40 2e 28     cmpib,*= 0,r26,748 <.L1098+0x7c>
  30:   34 08 3f ff     ldi -1,r8
  34:   d3 33 1e e8     extrw,s r25,23,24,r19
  38:   2b 60 00 00     addil 0,dp,%r1
                        38: R_PARISC_DLTIND21L  pidhash

At the moment we set up sp with "ldo TASK_SZ_ALGN+64(%r1),%r30" on syscall
entry.  For 64 bit presumably we should do something like:

	ldo     TASK_SZ_ALGN+80(%r1),%r30
	ldo	-16(%r30),%r29

Which gives 64 bytes for parameter saves, plus 16 bytes for rp+sp, and
initialises ret1.

Does that sound right?

Richard

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: [parisc-linux] parisc64 kernel and ret1 (gr29) setup
@ 2001-01-23 18:47 Cary Coutant
  2001-01-23 21:17 ` Jeffrey A Law
  0 siblings, 1 reply; 12+ messages in thread
From: Cary Coutant @ 2001-01-23 18:47 UTC (permalink / raw)
  To: Matthew Wilcox, Alan Modra; +Cc: Richard Hirst, parisc-linux

>> Is there any code elsewhere that "knows" the stack frame is 64 bytes
>> (except for gdb and signal handler frames)?
>
>i'm not sure that's the point... knowing the stack frame is 64 byte
>aligned allows the compiler to know the alignment of all types being
>placed on the stack.

On HP-UX, the 64-bit conventions require only 16-byte alignment for stack 
frames.

Several years ago we made an attempt to establish a 64-byte stack frame 
alignment in the 32-bit conventions, so that the compiler could take 
advantage of certain cache hints available on some PA-RISC CPUs. Because 
of the complexity of assuring that all stack frames in a program obeyed 
this convention, and the growth in average stack use, we abandoned the 
idea.

I don't believe, however, that we ever fixed the 32-bit conventions 
document to reflect this reversal. Unfortunately, it still says that sp 
must be 64-byte aligned. Trust me -- it's wrong. We've never enforced a 
64-byte alignment.

-cary

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

end of thread, other threads:[~2001-02-11 23:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-12-21 16:00 [parisc-linux] parisc64 kernel and ret1 (gr29) setup Richard Hirst
2000-12-21 20:57 ` Matthew Wilcox
2000-12-21 20:55   ` Richard Hirst
2001-01-23 13:45 ` Richard Hirst
2001-01-23 14:20   ` Alan Modra
2001-01-23 14:30     ` Matthew Wilcox
2001-01-23 15:43     ` Richard Hirst
2001-02-07 11:18   ` Richard Hirst
2001-02-11 12:09     ` Alan Modra
2001-02-11 23:03       ` Richard Hirst
  -- strict thread matches above, loose matches on Subject: below --
2001-01-23 18:47 Cary Coutant
2001-01-23 21:17 ` Jeffrey A Law

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.