]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.16.4/powerpc-64s-fix-pkey-support-in-dt_cpu_ftrs-add-cpu_ftr_pkey-bit.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.16.4 / powerpc-64s-fix-pkey-support-in-dt_cpu_ftrs-add-cpu_ftr_pkey-bit.patch
CommitLineData
0f23eb5b
GKH
1From c130153e453cba0f37ad10fa18a1aa9c9a598a59 Mon Sep 17 00:00:00 2001
2From: Nicholas Piggin <npiggin@gmail.com>
3Date: Thu, 5 Apr 2018 15:57:54 +1000
4Subject: powerpc/64s: Fix pkey support in dt_cpu_ftrs, add CPU_FTR_PKEY bit
5
6From: Nicholas Piggin <npiggin@gmail.com>
7
8commit c130153e453cba0f37ad10fa18a1aa9c9a598a59 upstream.
9
10The pkey code added a CPU_FTR_PKEY bit, but did not add it to the
11dt_cpu_ftrs feature set. Although capability is supported by all
12processors in the base dt_cpu_ftrs set for 64s, it's a significant
13and sufficiently well defined feature to make it optional. So add
14it as a quirk for now, which can be versioned out then controlled
15by the firmware (once dt_cpu_ftrs gains versioning support).
16
17Fixes: cf43d3b26452 ("powerpc: Enable pkey subsystem")
18Cc: stable@vger.kernel.org # v4.16+
19Cc: Ram Pai <linuxram@us.ibm.com>
20Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
21Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
22Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23
24---
25 arch/powerpc/kernel/dt_cpu_ftrs.c | 7 +++++++
26 1 file changed, 7 insertions(+)
27
28--- a/arch/powerpc/kernel/dt_cpu_ftrs.c
29+++ b/arch/powerpc/kernel/dt_cpu_ftrs.c
30@@ -658,6 +658,13 @@ static void __init cpufeatures_setup_sta
31 cur_cpu_spec->cpu_features |= CPU_FTR_ARCH_300;
32 cur_cpu_spec->cpu_user_features2 |= PPC_FEATURE2_ARCH_3_00;
33 }
34+
35+ /*
36+ * PKEY was not in the initial base or feature node
37+ * specification, but it should become optional in the next
38+ * cpu feature version sequence.
39+ */
40+ cur_cpu_spec->cpu_features |= CPU_FTR_PKEY;
41 }
42
43 static bool __init cpufeatures_process_feature(struct dt_cpu_feature *f)