]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - 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
CommitLineData
3140e7c0
GKH
1From foo@baz Fri Mar 29 16:04:51 CET 2019
2From: Michael Ellerman <mpe@ellerman.id.au>
3Date: Fri, 29 Mar 2019 22:26:09 +1100
4Subject: powerpc/fsl: Add macro to flush the branch predictor
5To: stable@vger.kernel.org, gregkh@linuxfoundation.org
6Cc: linuxppc-dev@ozlabs.org, diana.craciun@nxp.com, msuchanek@suse.de, christophe.leroy@c-s.fr
7Message-ID: <20190329112620.14489-22-mpe@ellerman.id.au>
8
9From: Diana Craciun <diana.craciun@nxp.com>
10
11commit 1cbf8990d79ff69da8ad09e8a3df014e1494462b upstream.
12
13The BUCSR register can be used to invalidate the entries in the
14branch prediction mechanisms.
15
16Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
17Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
18Signed-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 */