Discussion:
GENERIC.MP hangs
KIYOHARA Takashi
2013-04-01 15:27:53 UTC
Permalink
Hi! Nick,


GENERIC.MP hangs in percpu_alloc(). cpu0 waits cpu1 into idle_loop().
However cpu1 doesn't go idle_loop() on hp700 in
arch/hp700/dev/cpu.c:cpu_hatch().

Please see other archs:
x86/x86/cpu.c
powerpc/powerpc/locore_subr.S
arch/arm/cortex/a9_mpsubr.S

x86/x86/cpu.c:cpu_hatch() ---
void
cpu_hatch(void *v)
{
:

aprint_debug_dev(ci->ci_dev, "running\n");

idle_loop(NULL);
KASSERT(false);
}
--- x86/x86/cpu.c:cpu_hatch()

powerpc/powerpc/locore_subr.S ---
ENTRY(cpu_spinup_trampoline)
:

bl _C_LABEL(cpu_hatch)
mr %r1,%r3
b _C_LABEL(idle_loop)

ENTRY(cpu_spinstart)
:

bla _C_LABEL(cpu_hatch)
mr %r1,%r3 /* move the return from cpu_hatch to the stackpointer*/
b _C_LABEL(idle_loop)
--- powerpc/powerpc/locore_subr.S

Please fix. :)

However,
Oops, hangs again for another reason after resolved this problem... X-<
probably I will report again in several months.

Thanks,
--
kiyohara
Nick Hudson
2013-04-03 15:21:11 UTC
Permalink
Post by KIYOHARA Takashi
Hi! Nick,
GENERIC.MP hangs in percpu_alloc(). cpu0 waits cpu1 into idle_loop().
However cpu1 doesn't go idle_loop() on hp700 in
arch/hp700/dev/cpu.c:cpu_hatch().
[snip]
Post by KIYOHARA Takashi
Please fix. :)
However,
Oops, hangs again for another reason after resolved this problem... X-<
probably I will report again in several months.
Do you have a patch you'd like reviewing?
Post by KIYOHARA Takashi
Thanks,
--
kiyohara
There's quite a lot of work needed in pmap and trap handlers for full MP
support.

Nick
KIYOHARA Takashi
2013-04-06 10:14:45 UTC
Permalink
Hi!


From: Nick Hudson <***@netbsd.org>
Date: Wed, 03 Apr 2013 15:21:11 +0000
Post by Nick Hudson
Post by KIYOHARA Takashi
GENERIC.MP hangs in percpu_alloc(). cpu0 waits cpu1 into idle_loop().
However cpu1 doesn't go idle_loop() on hp700 in
arch/hp700/dev/cpu.c:cpu_hatch().
[snip]
Post by KIYOHARA Takashi
Please fix. :)
However,
Oops, hangs again for another reason after resolved this problem... X-<
probably I will report again in several months.
Do you have a patch you'd like reviewing?
I try with this change.

Index: cpu.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hp700/dev/cpu.c,v
retrieving revision 1.30
diff -u -r1.30 cpu.c
--- cpu.c 21 Feb 2013 15:16:02 -0000 1.30
+++ cpu.c 6 Apr 2013 09:56:49 -0000
@@ -38,6 +38,7 @@
#include <sys/device.h>
#include <sys/atomic.h>
#include <sys/reboot.h>
+#include <sys/idle.h>

#include <uvm/uvm.h>

@@ -283,9 +284,8 @@
while (!start_secondary_cpu)
;

- /* Spin for now */
- for (;;)
- ;
+ idle_loop(NULL);

+ /* NOTREACHED */
}
#endif


But, I think more better to call idle_loop() in locore.S. This reason
is our stack space more than free in cpu_hatch().

# I don't know PA-RISC assembler. X-<
Maybe, it is more better?

Index: locore.S
===================================================================
RCS file: /cvsroot/src/sys/arch/hp700/hp700/locore.S,v
retrieving revision 1.61
diff -u -r1.61 locore.S
--- locore.S 23 May 2012 16:11:37 -0000 1.61
+++ locore.S 6 Apr 2013 10:05:12 -0000
@@ -523,6 +523,7 @@
* Okay, time to return to the land of C.
*/
b cpu_hatch
+ b idle_loop
nop

EXIT(hw_cpu_spinup_trampoline)
Post by Nick Hudson
There's quite a lot of work needed in pmap and trap handlers for full MP
support.
OK!
I will try and report next month(?).

Thanks,
--
kiyohara

Continue reading on narkive:
Loading...