Skip to contentSkip to conversation

64 bit kernel crash with wrong r27 value

parisc-linux Richard Hirst 2 participants 2 messages Dec 22, 2000 – Jan 2, 2001

lore
Share & tools
lore
#0 lore raw

Hi,
I just had a crash loading a kernel module; it was in schedule(),
but r27 (dp) was still pointing to the modules local data. r2 referenced the syscall exit path.

My theory is that the syscall involved calling the module, which would set dp to reference the modules local data, and the return path had no cause to reload dp as that is always the callers responsibility. So, I have added a loadgp to entry.S at syscall_exit:, which solved the problem.

However, (a) I'm not sure this is the right place to loadgp - maybe it should be in syscall.S, and (b) there may well be other places where we need to do loadgp - eg. returning from interrupt. Comments?

Didn't see this on 32 bit kernel, because kernel and modules all run on the same dp value. For 64 bit, the kernel and each module has its own dp value.

Richard

#1 lore raw
Quoted 1 line · Richard Hirst

had no cause to reload dp as that is always the callers responsibility.

Yes. For hppa64, dp should be assumed trashed by any function call. That means some further patches in entry.S are needed, which ought to be made #ifdef __LP64__

Alan

Signature · 1 line
Linuxcare.  Support for the Revolution.