]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.4/powerpc-fsl-emulate-sprn_bucsr-register.patch
4.4-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.4 / powerpc-fsl-emulate-sprn_bucsr-register.patch
CommitLineData
342554a7
GKH
1From foo@baz Tue 30 Apr 2019 12:38:50 PM CEST
2From: Diana Craciun <diana.craciun@nxp.com>
3Date: Mon, 29 Apr 2019 18:49:03 +0300
4Subject: powerpc/fsl: Emulate SPRN_BUCSR register
5To: stable@vger.kernel.org, gregkh@linuxfoundation.org
6Cc: linuxppc-dev@ozlabs.org, mpe@ellerman.id.au, Diana Craciun <diana.craciun@nxp.com>
7Message-ID: <1556552948-24957-4-git-send-email-diana.craciun@nxp.com>
8
9From: Diana Craciun <diana.craciun@nxp.com>
10
11commit 98518c4d8728656db349f875fcbbc7c126d4c973 upstream.
12
13In order to flush the branch predictor the guest kernel performs
14writes to the BUCSR register which is hypervisor privilleged. However,
15the branch predictor is flushed at each KVM entry, so the branch
16predictor has been already flushed, so just return as soon as possible
17to guest.
18
19Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
20[mpe: Tweak comment formatting]
21Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
22Signed-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: