]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/powerpc-fsl-add-macro-to-flush-the-branch-predictor.patch
5.0-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.19 / powerpc-fsl-add-macro-to-flush-the-branch-predictor.patch
1 From foo@baz Fri Mar 29 16:04:51 CET 2019
2 From: Michael Ellerman <mpe@ellerman.id.au>
3 Date: Fri, 29 Mar 2019 22:26:09 +1100
4 Subject: powerpc/fsl: Add macro to flush the branch predictor
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-22-mpe@ellerman.id.au>
8
9 From: Diana Craciun <diana.craciun@nxp.com>
10
11 commit 1cbf8990d79ff69da8ad09e8a3df014e1494462b upstream.
12
13 The BUCSR register can be used to invalidate the entries in the
14 branch prediction mechanisms.
15
16 Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
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/ppc_asm.h | 10 ++++++++++
21 1 file changed, 10 insertions(+)
22
23 --- a/arch/powerpc/include/asm/ppc_asm.h
24 +++ b/arch/powerpc/include/asm/ppc_asm.h
25 @@ -821,4 +821,14 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
26 stringify_in_c(.long (_target) - . ;) \
27 stringify_in_c(.previous)
28
29 +#ifdef CONFIG_PPC_FSL_BOOK3E
30 +#define BTB_FLUSH(reg) \
31 + lis reg,BUCSR_INIT@h; \
32 + ori reg,reg,BUCSR_INIT@l; \
33 + mtspr SPRN_BUCSR,reg; \
34 + isync;
35 +#else
36 +#define BTB_FLUSH(reg)
37 +#endif /* CONFIG_PPC_FSL_BOOK3E */
38 +
39 #endif /* _ASM_POWERPC_PPC_ASM_H */