All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] powerpc: dt_cpu_ftrs: Set current thread fscr bits
@ 2020-04-23  4:40 Alistair Popple
  2020-04-23  4:40 ` [PATCH 2/2] powerpc: Enable Prefixed Instructions Alistair Popple
  0 siblings, 1 reply; 2+ messages in thread
From: Alistair Popple @ 2020-04-23  4:40 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: mikey, oohall, npiggin, Alistair Popple

Setting the FSCR bit directly in the SPR only sets it for the initial
boot and early init of the kernel. When the init process is started it
gets copied from the current thread_struct which does not reflect any
changes made during CPU feature detection. This patch ensures the
current thread_struct state is updated to match FSCR after feature
detection is complete.

Signed-off-by: Alistair Popple <alistair@popple.id.au>
---
 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 36bc0d5c4f3a..dede8f0b678f 100644
--- a/arch/powerpc/kernel/dt_cpu_ftrs.c
+++ b/arch/powerpc/kernel/dt_cpu_ftrs.c
@@ -169,6 +169,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;
@@ -204,6 +205,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;
 		}
 	}
 
-- 
2.20.1


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

* [PATCH 2/2] powerpc: Enable Prefixed Instructions
  2020-04-23  4:40 [PATCH 1/2] powerpc: dt_cpu_ftrs: Set current thread fscr bits Alistair Popple
@ 2020-04-23  4:40 ` Alistair Popple
  0 siblings, 0 replies; 2+ messages in thread
From: Alistair Popple @ 2020-04-23  4:40 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: mikey, oohall, npiggin, Alistair Popple

Prefix instructions have their own FSCR bit which needs to enabled via
a CPU feature. The kernel will save the FSCR for problem state but it
needs to be enabled initially.

Signed-off-by: Alistair Popple <alistair@popple.id.au>
---
 arch/powerpc/kernel/dt_cpu_ftrs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c b/arch/powerpc/kernel/dt_cpu_ftrs.c
index dede8f0b678f..e4caa4456869 100644
--- a/arch/powerpc/kernel/dt_cpu_ftrs.c
+++ b/arch/powerpc/kernel/dt_cpu_ftrs.c
@@ -627,6 +627,7 @@ static struct dt_cpu_feature_match __initdata
 	{"vector-binary128", feat_enable, 0},
 	{"vector-binary16", feat_enable, 0},
 	{"wait-v3", feat_enable, 0},
+	{"prefix-instructions", feat_enable, 0},
 };
 
 static bool __initdata using_dt_cpu_ftrs;
-- 
2.20.1


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

end of thread, other threads:[~2020-04-23  4:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-23  4:40 [PATCH 1/2] powerpc: dt_cpu_ftrs: Set current thread fscr bits Alistair Popple
2020-04-23  4:40 ` [PATCH 2/2] powerpc: Enable Prefixed Instructions Alistair Popple

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.