]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.14.110/powerpc-fsl-emulate-sprn_bucsr-register.patch
Linux 4.9.167
[thirdparty/kernel/stable-queue.git] / releases / 4.14.110 / powerpc-fsl-emulate-sprn_bucsr-register.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:11 +1100
4 Subject: powerpc/fsl: Emulate SPRN_BUCSR register
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-24-mpe@ellerman.id.au>
8
9 From: Diana Craciun <diana.craciun@nxp.com>
10
11 commit 98518c4d8728656db349f875fcbbc7c126d4c973 upstream.
12
13 In order to flush the branch predictor the guest kernel performs
14 writes to the BUCSR register which is hypervisor privilleged. However,
15 the branch predictor is flushed at each KVM entry, so the branch
16 predictor has been already flushed, so just return as soon as possible
17 to guest.
18
19 Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
20 [mpe: Tweak comment formatting]
21 Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
22 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23 ---
24 arch/powerpc/kvm/e500_emulate.c | 7 +++++++
25 1 file changed, 7 insertions(+)
26
27 --- a/arch/powerpc/kvm/e500_emulate.c
28 +++ b/arch/powerpc/kvm/e500_emulate.c
29 @@ -277,6 +277,13 @@ int kvmppc_core_emulate_mtspr_e500(struc
30 vcpu->arch.pwrmgtcr0 = spr_val;
31 break;
32
33 + case SPRN_BUCSR:
34 + /*
35 + * If we are here, it means that we have already flushed the
36 + * branch predictor, so just return to guest.
37 + */
38 + break;
39 +
40 /* extra exceptions */
41 #ifdef CONFIG_SPE_POSSIBLE
42 case SPRN_IVOR32: