Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Derek Atkins <warlord@mit.edu>
Subject: Re: syscalls in modules
Date: 28 May 1997 13:48:12 -0400	[thread overview]
Message-ID: <e092b4456d6149956660e2dddfd26775.axp-list@archive.invalid> (raw)

Richard,

Thanks.  This patch did fix the problem with calling installed
syscalls.  However, there still seems to be a problem when tracing
syscalls installed from modules.

If I load a module that installs a syscall and then I 'strace' a
program that calls that syscall, I get an oops if that syscall returns
an error.

I suspect that the gp register isn't being restored properly elsewhere
in entry.S.  I just don't know where it _should_ be restored.  I
suspect that it is a problem with most of the jsr functions, but I was
hoping that someone more familiar with the code could give me an
"expert" opinion.  Places where I think it might be an issue (assuming
that jsr is the problem) are: strace (jsr $26,($27),syscall_trace) --
and later when it does jsr to the syscall (jsr $26,($27),do_entSys),
it loads gp with the (replaced) $26: (ldgp $29,0($26)).

Other possible places where GP could be a problem include
strace_success where it jumps to syscall_trace or strace_error where
it also jumps to syscall_trace.  The handle_bottom_half code also
jumps into do_bottom_half and doesn't reload GP afterwards.

Could you verify that these are real potential problems, if any of
them are?

I can send you an oops if that would help.

Again, this is with 2.0.27, but I suspect it is still a problem in
2.1.XX as well.  I'm willing to try a 2.1.X entry.S (provided it is
compatible with 2.0.27) if you think that will solve the problem.

Thanks!

-derek

Richard Henderson <richard@stommel.tamu.edu> writes:

> 
> Bother.  I forgot to cc you on the reply I just made.  Basically
> Andreas was right, but the patch was wrong.  Try this:
> 
> --- entry.S.orig        Thu May 22 15:31:23 1997
> +++ entry.S     Thu May 22 15:32:19 1997
> @@ -512,6 +512,7 @@
>         beq     $4,1f
>         ldq     $27,0($5)
>  1:     jsr     $26,($27),do_entSys
> +       ldgp    $29,0($26)
>         blt     $0,syscall_error        /* the call failed */
>         stq     $0,0($30)
>         stq     $31,72($30)             /* a3=0 => no error */
> 
> And on a related point, you must use -fno-fp-regs, since the
> kernel does not save them on kernel entry and gcc has a habit
> of using them to avoid spilling int regs when it just needs 
> to move data.  Which is ordinarily a nice win, but...
> 
> And similarly, I don't know if you are doing a 2.1 version yet
> but there you must use -ffixed-8 as well, as we co-opt $8 as
> a global register variable.
> 
> 
> r~

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/      PP-ASEL      N1NWH
       warlord@MIT.EDU                        PGP key available

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

             reply	other threads:[~1997-05-28 17:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-28 17:48 Derek Atkins [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-05-23 14:17 syscalls in modules Derek Atkins
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox