]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.14/powerpc-64s-add-new-security-feature-flags-for-count-cache-flush.patch
Linux 4.9.167
[thirdparty/kernel/stable-queue.git] / queue-4.14 / powerpc-64s-add-new-security-feature-flags-for-count-cache-flush.patch
1 From foo@baz Fri Mar 29 15:53:50 CET 2019
2 From: Michael Ellerman <mpe@ellerman.id.au>
3 Date: Fri, 29 Mar 2019 22:26:04 +1100
4 Subject: powerpc/64s: Add new security feature flags for count cache flush
5 To: stable@vger.kernel.org, gregkh@linuxfoundation.org
6 Cc: linuxppc-dev@ozlabs.org, diana.craciun@nxp.com, msuchanek@suse.de, christophe.leroy@c-s.fr
7 Message-ID: <20190329112620.14489-17-mpe@ellerman.id.au>
8
9 From: Michael Ellerman <mpe@ellerman.id.au>
10
11 commit dc8c6cce9a26a51fc19961accb978217a3ba8c75 upstream.
12
13 Add security feature flags to indicate the need for software to flush
14 the count cache on context switch, and for the presence of a hardware
15 assisted count cache flush.
16
17 Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19 ---
20 arch/powerpc/include/asm/security_features.h | 6 ++++++
21 1 file changed, 6 insertions(+)
22
23 --- a/arch/powerpc/include/asm/security_features.h
24 +++ b/arch/powerpc/include/asm/security_features.h
25 @@ -59,6 +59,9 @@ static inline bool security_ftr_enabled(
26 // Indirect branch prediction cache disabled
27 #define SEC_FTR_COUNT_CACHE_DISABLED 0x0000000000000020ull
28
29 +// bcctr 2,0,0 triggers a hardware assisted count cache flush
30 +#define SEC_FTR_BCCTR_FLUSH_ASSIST 0x0000000000000800ull
31 +
32
33 // Features indicating need for Spectre/Meltdown mitigations
34
35 @@ -74,6 +77,9 @@ static inline bool security_ftr_enabled(
36 // Firmware configuration indicates user favours security over performance
37 #define SEC_FTR_FAVOUR_SECURITY 0x0000000000000200ull
38
39 +// Software required to flush count cache on context switch
40 +#define SEC_FTR_FLUSH_COUNT_CACHE 0x0000000000000400ull
41 +
42
43 // Features enabled by default
44 #define SEC_FTR_DEFAULT \