linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* MIPS: [raw_]smp_processor_id uses current_thread_info
@ 2009-09-23 18:27 Randy MacLeod
  2009-09-24 15:51 ` Ralf Baechle
  0 siblings, 1 reply; 3+ messages in thread
From: Randy MacLeod @ 2009-09-23 18:27 UTC (permalink / raw)
  To: linux-mips

Hi,

I'd like advice on changing the implementation of smp_processor_id on
Cavium specifically and/or MIPS generally.

Currently we have: arch/mips/include/asm/smp.h
#define raw_smp_processor_id() (current_thread_info()->cpu)

A co-worker has an issue where the current thread pointer is corrupted
on a Cavium MIPS system running 2.6.14 (but the same code exists in 2.6.31).
During the resulting panic() the kernel calls smp_processor_id()
which dereferences the corrupt task pointer again - ouch. I've notice that
other arches have raw_smp_processor_id() defined to
 - a platform specific register read, or
 - a percpu variable or
 - have a hard_smp_processor_id() defined
This last one is presumably for times when you don't trust the kernel
data structures to be
sane.

I can create a patch that calls cvmx_get_core_num(); for cavium.
Is there a more generic way to get the cpu number on MIPS?

Thanks,
-- 
../Randy/..

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

end of thread, other threads:[~2009-09-24 18:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-23 18:27 MIPS: [raw_]smp_processor_id uses current_thread_info Randy MacLeod
2009-09-24 15:51 ` Ralf Baechle
2009-09-24 18:16   ` Kevin D. Kissell

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).