Re: [PATCH v3 4/7] powerpc/dt_cpu_ftrs: Set current thread fscr bits

2022-03-09 Thread Michael Ellerman
Christophe Leroy  writes:
> Le 21/05/2020 à 03:43, Alistair Popple a écrit :
>> Setting the FSCR bit directly in the SPR only sets it during the initial
>> boot and early init of the kernel but not for the init process or any
>> subsequent kthreads. This is because the thread_struct for those is
>> copied from the current thread_struct setup at boot which doesn't
>> reflect any changes made to the FSCR during cpu feature detection. This
>> patch ensures the current thread state is updated to match once feature
>> detection is complete.
>> 
>> Signed-off-by: Alistair Popple 
>
> I see that the series has been merged but this patch was left over.
>
> Has it been forgotten or is it rejected ?

I fixed the underlying issue, see:

  912c0a7f2b5d ("powerpc/64s: Save FSCR to init_task.thread.fscr after feature 
init")

So I guess it was superseeded (by a preceeding patch).

cheers


Re: [PATCH v3 4/7] powerpc/dt_cpu_ftrs: Set current thread fscr bits

2022-03-09 Thread Christophe Leroy

Hi,

Le 21/05/2020 à 03:43, Alistair Popple a écrit :

Setting the FSCR bit directly in the SPR only sets it during the initial
boot and early init of the kernel but not for the init process or any
subsequent kthreads. This is because the thread_struct for those is
copied from the current thread_struct setup at boot which doesn't
reflect any changes made to the FSCR during cpu feature detection. This
patch ensures the current thread state is updated to match once feature
detection is complete.

Signed-off-by: Alistair Popple 


I see that the series has been merged but this patch was left over.

Has it been forgotten or is it rejected ?

Thanks
Christophe



---
  arch/powerpc/kernel/dt_cpu_ftrs.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c 
b/arch/powerpc/kernel/dt_cpu_ftrs.c
index b5e21264d168..677190f70cac 100644
--- a/arch/powerpc/kernel/dt_cpu_ftrs.c
+++ b/arch/powerpc/kernel/dt_cpu_ftrs.c
@@ -170,6 +170,7 @@ static int __init feat_try_enable_unknown(struct 
dt_cpu_feature *f)
u64 fscr = mfspr(SPRN_FSCR);
fscr |= 1UL << f->fscr_bit_nr;
mtspr(SPRN_FSCR, fscr);
+   current->thread.fscr |= 1UL << f->fscr_bit_nr;
} else {
/* Does not have a known recipe */
return 0;
@@ -205,6 +206,7 @@ static int __init feat_enable(struct dt_cpu_feature *f)
u64 fscr = mfspr(SPRN_FSCR);
fscr |= 1UL << f->fscr_bit_nr;
mtspr(SPRN_FSCR, fscr);
+   current->thread.fscr |= 1UL << f->fscr_bit_nr;
}
}