* Re: syscalls in modules
@ 1997-05-23 14:17 Derek Atkins
0 siblings, 0 replies; 2+ messages in thread
From: Derek Atkins @ 1997-05-23 14:17 UTC (permalink / raw)
Thanks, this fixed the problem. I can now load syscalls into the
kernel and they work properly. Thanks!!!
So, to whom do I need to contact to get this patch into the mainline
Linux kernel. Specifically, I'd like to see this make it into 2.0.31
(assuming there is a 2.0.31) as well as the 2.1 kernels?
-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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: syscalls in modules
@ 1997-05-28 17:48 Derek Atkins
0 siblings, 0 replies; 2+ messages in thread
From: Derek Atkins @ 1997-05-28 17:48 UTC (permalink / 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1997-05-28 17:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-05-23 14:17 syscalls in modules Derek Atkins
-- strict thread matches above, loose matches on Subject: below --
1997-05-28 17:48 Derek Atkins
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox