All of lore.kernel.org
 help / color / mirror / Atom feed
* CFE problem: starting secondary CPU.
@ 2006-10-06 23:58 ` Kaz Kylheku
  0 siblings, 0 replies; 14+ messages in thread
From: Kaz Kylheku @ 2006-10-06 23:58 UTC (permalink / raw)
  To: linux-mips

Anyone seen a problem like this? cfe_cpu_start() works fine on a
32 bit kernel, but not on 64.

I added a function to cfe/smp.c:

  static asmlinkage void dummy()
  {
    prom_printf("dummy called\n");
  }

This serves as the simplest possible "hello world". 

If I substitute this for the function passed to cfe_cpu_start(),
on a 32 bit kernel, the slave CPU calls the function and the
message is printed on the serial console.

On a 64 bit kernel, the function is never reached. The API call returns,
but the
secondary CPU never calls in.

The sign-extension of the address looks good. The function pointer looks
like
FFFFFFFF8XXXXXXX. This is cast to long before being assigned into the
right field
of the CFE request structure, where it is converted to 64 bit unsigned.

Inside CFE, the CPU is just looping around waiting for the address to
call with
a direct jump.

So it's a puzzling problem.

^ permalink raw reply	[flat|nested] 14+ messages in thread
* RE: CFE problem: starting secondary CPU.
@ 2006-10-09  2:10 ` Kaz Kylheku
  0 siblings, 0 replies; 14+ messages in thread
From: Kaz Kylheku @ 2006-10-09  2:10 UTC (permalink / raw)
  To: linux-mips

Jonathan Day wrote:
> I've seen the case where the second CPU did not start
> on a Broadcom 1250 running a 64-bit kernel, but I
> don't know if anyone has a good solution. I just
> rigged the values in the Linux kernel so that it knows
> about the second CPU.

Do you have a patch for that?

> It's a godawful hack, but I
> needed something quick at the time.

I wrote another hack. I struggled with it for hours and
then finally got it to work. Whoo! 

The idea is based on the hypothesis that the 64 bit
kernel's environment somehow makes the CFE calls unreliable.

Under this hack, the CPUs are started early through CFE,
before most other initializations. They go into a holding function
which is almost identical to the one inside CFE, 
except that it's running kernel code.

Then later at the point where the CPU's are to be released
into the kernel, it's purely an in-kernel operation, no
longer involving any calls to CFE.



Remarks:



I have some CFE code which reads environment variables
using CFE. Under 64 bit, there is a mysterious oops in it.
The code looks good, and runs fine under 32.

What could it be? Maybe CFE doesn't like being called from
a task! Something about the 64 bit stack?

Note that code which starts the other CPU's is called from a
kernel thread which calls the init() function, not from
the mainline.

I will investigate further.

^ permalink raw reply	[flat|nested] 14+ messages in thread
* RE: CFE problem: starting secondary CPU.
@ 2006-10-10 17:20 ` Kaz Kylheku
  0 siblings, 0 replies; 14+ messages in thread
From: Kaz Kylheku @ 2006-10-10 17:20 UTC (permalink / raw)
  To: linux-mips; +Cc: mason

Mark E Mason: 
> Kaz Kylheku:
> > 
> > Anyone seen a problem like this? cfe_cpu_start() works fine on a
> > 32 bit kernel, but not on 64.
> 
> Which version of CFE are you using?  We'd seen something like 
> this with
> the 1480 eval boards, some specific versions of CFE, and 64-bit SMP
> Linux.

I see in the release notes that something was fixed in 1.2.4 that could
prevent 64 bit SMP from booting: a bug that was preventing the upper
halves of registers from being saved. Is that what you are talking
about?

We are on 1.3.0.

Thanks.

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

end of thread, other threads:[~2006-10-10 17:54 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-06 23:58 CFE problem: starting secondary CPU Kaz Kylheku
2006-10-06 23:58 ` Kaz Kylheku
2006-10-07  2:15 ` Jonathan Day
2006-10-07 10:53   ` Ralf Baechle
2006-10-07 22:10     ` girish
2006-10-08 21:35       ` Jonathan Day
2006-10-09 13:25         ` Ralf Baechle
2006-10-09 19:12           ` Jonathan Day
2006-10-09 19:42 ` Mark E Mason
  -- strict thread matches above, loose matches on Subject: below --
2006-10-09  2:10 Kaz Kylheku
2006-10-09  2:10 ` Kaz Kylheku
2006-10-10 17:20 Kaz Kylheku
2006-10-10 17:20 ` Kaz Kylheku
2006-10-10 17:53 ` Mark E Mason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.