All of lore.kernel.org
 help / color / mirror / Atom feed
* Does SMP work at all on 40x ?
@ 2019-01-30  7:16 Christophe Leroy
  2019-01-30 11:43 ` Michael Ellerman
  2019-02-01  7:42 ` Benjamin Herrenschmidt
  0 siblings, 2 replies; 4+ messages in thread
From: Christophe Leroy @ 2019-01-30  7:16 UTC (permalink / raw)
  To: Paul Mackerras, Benjamin Herrenschmidt, Michael Ellerman, linuxppc-dev

In transfer_to_handler() (entry_32.S), we have:

#if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
...
#ifdef CONFIG_SMP
	CURRENT_THREAD_INFO(r9, r1)
	lwz	r9,TI_CPU(r9)
	slwi	r9,r9,3
	add	r11,r11,r9
#endif
#endif

When running this piece of code, MMU translation is off. But r9 contains 
the virtual addr of current_thread_info, so unless I miss something, 
this cannot work on the 40x, can it ?

On CONFIG_BOOKE it works because phys addr = virt addr

Christophe

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

* Re: Does SMP work at all on 40x ?
  2019-01-30  7:16 Does SMP work at all on 40x ? Christophe Leroy
@ 2019-01-30 11:43 ` Michael Ellerman
  2019-01-31 10:53   ` Christophe Leroy
  2019-02-01  7:42 ` Benjamin Herrenschmidt
  1 sibling, 1 reply; 4+ messages in thread
From: Michael Ellerman @ 2019-01-30 11:43 UTC (permalink / raw)
  To: Christophe Leroy, Paul Mackerras, Benjamin Herrenschmidt, linuxppc-dev

Christophe Leroy <christophe.leroy@c-s.fr> writes:

> In transfer_to_handler() (entry_32.S), we have:
>
> #if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
> ...
> #ifdef CONFIG_SMP
> 	CURRENT_THREAD_INFO(r9, r1)
> 	lwz	r9,TI_CPU(r9)
> 	slwi	r9,r9,3
> 	add	r11,r11,r9
> #endif
> #endif
>
> When running this piece of code, MMU translation is off. But r9 contains 
> the virtual addr of current_thread_info, so unless I miss something, 
> this cannot work on the 40x, can it ?
>
> On CONFIG_BOOKE it works because phys addr = virt addr

AFAIK 40x can't be SMP:

  config SMP
  	depends on PPC_BOOK3S || PPC_BOOK3E || FSL_BOOKE || PPC_47x


But this stuff is all before my time.

The commit that added the SMP block was clearly only meant for BookE:

  4eaddb4d7ec3 ("[POWERPC] Make Book-E debug handling SMP safe")

cheers

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

* Re: Does SMP work at all on 40x ?
  2019-01-30 11:43 ` Michael Ellerman
@ 2019-01-31 10:53   ` Christophe Leroy
  0 siblings, 0 replies; 4+ messages in thread
From: Christophe Leroy @ 2019-01-31 10:53 UTC (permalink / raw)
  To: Michael Ellerman, Paul Mackerras, Benjamin Herrenschmidt, linuxppc-dev



Le 30/01/2019 à 12:43, Michael Ellerman a écrit :
> Christophe Leroy <christophe.leroy@c-s.fr> writes:
> 
>> In transfer_to_handler() (entry_32.S), we have:
>>
>> #if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
>> ...
>> #ifdef CONFIG_SMP
>> 	CURRENT_THREAD_INFO(r9, r1)
>> 	lwz	r9,TI_CPU(r9)
>> 	slwi	r9,r9,3
>> 	add	r11,r11,r9
>> #endif
>> #endif
>>
>> When running this piece of code, MMU translation is off. But r9 contains
>> the virtual addr of current_thread_info, so unless I miss something,
>> this cannot work on the 40x, can it ?
>>
>> On CONFIG_BOOKE it works because phys addr = virt addr
> 
> AFAIK 40x can't be SMP:
> 
>    config SMP
>    	depends on PPC_BOOK3S || PPC_BOOK3E || FSL_BOOKE || PPC_47x
> 
> 
> But this stuff is all before my time.
> 
> The commit that added the SMP block was clearly only meant for BookE:
> 
>    4eaddb4d7ec3 ("[POWERPC] Make Book-E debug handling SMP safe")

Ok, then no need to worry about it. It will implicitely get fixed with 
the THREAD_INFO_IN_TASK_STRUCT series.

Christophe

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

* Re: Does SMP work at all on 40x ?
  2019-01-30  7:16 Does SMP work at all on 40x ? Christophe Leroy
  2019-01-30 11:43 ` Michael Ellerman
@ 2019-02-01  7:42 ` Benjamin Herrenschmidt
  1 sibling, 0 replies; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2019-02-01  7:42 UTC (permalink / raw)
  To: Christophe Leroy, Paul Mackerras, Michael Ellerman, linuxppc-dev

On Wed, 2019-01-30 at 08:16 +0100, Christophe Leroy wrote:
> In transfer_to_handler() (entry_32.S), we have:
> 
> #if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
> ...
> #ifdef CONFIG_SMP
> 	CURRENT_THREAD_INFO(r9, r1)
> 	lwz	r9,TI_CPU(r9)
> 	slwi	r9,r9,3
> 	add	r11,r11,r9
> #endif
> #endif
> 
> When running this piece of code, MMU translation is off. But r9 contains 
> the virtual addr of current_thread_info, so unless I miss something, 
> this cannot work on the 40x, can it ?
> 
> On CONFIG_BOOKE it works because phys addr = virt addr

There is no 40x SMP that I am aware of.

Cheers,
Ben.



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

end of thread, other threads:[~2019-02-01  7:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-30  7:16 Does SMP work at all on 40x ? Christophe Leroy
2019-01-30 11:43 ` Michael Ellerman
2019-01-31 10:53   ` Christophe Leroy
2019-02-01  7:42 ` Benjamin Herrenschmidt

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.