All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] a couple of cpu ftrs fixes
@ 2018-04-05  5:57 Nicholas Piggin
  2018-04-05  5:57 ` [PATCH 1/2] powerpc/64s: Fix pkey support in dt_cpu_ftrs, add CPU_FTR_PKEY bit Nicholas Piggin
  2018-04-05  5:57 ` [PATCH 2/2] powerpc/64s: Fix POWER9 DD2.2 and above in cputable features Nicholas Piggin
  0 siblings, 2 replies; 4+ messages in thread
From: Nicholas Piggin @ 2018-04-05  5:57 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Nicholas Piggin

These are a couple of differences between cputable and dt_cpu_ftrs
I noticed with CPU_FTR bits. We have to be a bit careful now to keep
them in sync when we change one or the other.

Nicholas Piggin (2):
  powerpc/64s: Fix pkey support in dt_cpu_ftrs, add CPU_FTR_PKEY bit
  powerpc/64s: Fix POWER9 DD2.2 and above in cputable features

 arch/powerpc/include/asm/cputable.h | 3 ++-
 arch/powerpc/kernel/dt_cpu_ftrs.c   | 7 +++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

-- 
2.16.3

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

* [PATCH 1/2] powerpc/64s: Fix pkey support in dt_cpu_ftrs, add CPU_FTR_PKEY bit
  2018-04-05  5:57 [PATCH 0/2] a couple of cpu ftrs fixes Nicholas Piggin
@ 2018-04-05  5:57 ` Nicholas Piggin
  2018-04-05 14:42   ` [1/2] " Michael Ellerman
  2018-04-05  5:57 ` [PATCH 2/2] powerpc/64s: Fix POWER9 DD2.2 and above in cputable features Nicholas Piggin
  1 sibling, 1 reply; 4+ messages in thread
From: Nicholas Piggin @ 2018-04-05  5:57 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Nicholas Piggin, Ram Pai

The pkey code added a CPU_FTR_PKEY bit, but did not add it to the
dt_cpu_ftrs feature set. Although capability is supported by all
processors in the base dt_cpu_ftrs set for 64s, it's a significant
and sufficiently well defined feature to make it optional. So add
it as a quirk for now, which can be versioned out then controlled
by the firmware (once dt_cpu_ftrs gains versioning support).

Fixes: cf43d3b264 ("powerpc: Enable pkey subsystem ")
Cc: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 arch/powerpc/kernel/dt_cpu_ftrs.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c b/arch/powerpc/kernel/dt_cpu_ftrs.c
index ed7605d8fd2d..e88fbb1fdb8f 100644
--- a/arch/powerpc/kernel/dt_cpu_ftrs.c
+++ b/arch/powerpc/kernel/dt_cpu_ftrs.c
@@ -729,6 +729,13 @@ static __init void cpufeatures_cpu_quirks(void)
 		cur_cpu_spec->cpu_features &= ~(CPU_FTR_DAWR);
 		cur_cpu_spec->cpu_features |= CPU_FTR_P9_TLBIE_BUG;
 	}
+
+	/*
+	 * PKEY was not in the initial base or feature node
+	 * specification, but it should become optional in the next
+	 * cpu feature version sequence.
+	 */
+	cur_cpu_spec->cpu_features |= CPU_FTR_PKEY;
 }
 
 static void __init cpufeatures_setup_finished(void)
-- 
2.16.3

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

* [PATCH 2/2] powerpc/64s: Fix POWER9 DD2.2 and above in cputable features
  2018-04-05  5:57 [PATCH 0/2] a couple of cpu ftrs fixes Nicholas Piggin
  2018-04-05  5:57 ` [PATCH 1/2] powerpc/64s: Fix pkey support in dt_cpu_ftrs, add CPU_FTR_PKEY bit Nicholas Piggin
@ 2018-04-05  5:57 ` Nicholas Piggin
  1 sibling, 0 replies; 4+ messages in thread
From: Nicholas Piggin @ 2018-04-05  5:57 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Nicholas Piggin

The CPU_FTR_POWER9_DD2_1 flag is intended to be set for DD2.1 and
above (which is what the dt_cpu_ftrs setup does). Fix cputable for
DD2.2 to match.

This came about due to patches b5af4f279323 ("powerpc: Add CPU feature
bits for TM bug workarounds on POWER9 v2.2"), and 9e9626ed3a4a
("powerpc/64s: Fix POWER9 DD2.2 and above in DT CPU features") being
in-flight at once. The latter patch fixed dt_cpu_ftrs like this one
does. The former changed cputable to match dt_cpu_ftrs.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 arch/powerpc/include/asm/cputable.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index 4e332f3531c5..931dda8be87c 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -467,7 +467,8 @@ static inline void cpu_feature_keys_init(void) { }
 			     (~CPU_FTR_SAO))
 #define CPU_FTRS_POWER9_DD2_0 CPU_FTRS_POWER9
 #define CPU_FTRS_POWER9_DD2_1 (CPU_FTRS_POWER9 | CPU_FTR_POWER9_DD2_1)
-#define CPU_FTRS_POWER9_DD2_2 (CPU_FTRS_POWER9 | CPU_FTR_P9_TM_HV_ASSIST | \
+#define CPU_FTRS_POWER9_DD2_2 (CPU_FTRS_POWER9 | CPU_FTR_POWER9_DD2_1 | \
+			       CPU_FTR_P9_TM_HV_ASSIST | \
 			       CPU_FTR_P9_TM_XER_SO_BUG)
 #define CPU_FTRS_CELL	(CPU_FTR_LWSYNC | \
 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
-- 
2.16.3

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

* Re: [1/2] powerpc/64s: Fix pkey support in dt_cpu_ftrs, add CPU_FTR_PKEY bit
  2018-04-05  5:57 ` [PATCH 1/2] powerpc/64s: Fix pkey support in dt_cpu_ftrs, add CPU_FTR_PKEY bit Nicholas Piggin
@ 2018-04-05 14:42   ` Michael Ellerman
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2018-04-05 14:42 UTC (permalink / raw)
  To: Nicholas Piggin, linuxppc-dev; +Cc: Ram Pai, Nicholas Piggin

On Thu, 2018-04-05 at 05:57:54 UTC, Nicholas Piggin wrote:
> The pkey code added a CPU_FTR_PKEY bit, but did not add it to the
> dt_cpu_ftrs feature set. Although capability is supported by all
> processors in the base dt_cpu_ftrs set for 64s, it's a significant
> and sufficiently well defined feature to make it optional. So add
> it as a quirk for now, which can be versioned out then controlled
> by the firmware (once dt_cpu_ftrs gains versioning support).
> 
> Fixes: cf43d3b264 ("powerpc: Enable pkey subsystem ")
> Cc: Ram Pai <linuxram@us.ibm.com>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/c130153e453cba0f37ad10fa18a1aa

cheers

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

end of thread, other threads:[~2018-04-05 14:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-05  5:57 [PATCH 0/2] a couple of cpu ftrs fixes Nicholas Piggin
2018-04-05  5:57 ` [PATCH 1/2] powerpc/64s: Fix pkey support in dt_cpu_ftrs, add CPU_FTR_PKEY bit Nicholas Piggin
2018-04-05 14:42   ` [1/2] " Michael Ellerman
2018-04-05  5:57 ` [PATCH 2/2] powerpc/64s: Fix POWER9 DD2.2 and above in cputable features Nicholas Piggin

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.