]>
Commit | Line | Data |
---|---|---|
342554a7 GKH |
1 | From foo@baz Tue 30 Apr 2019 12:38:50 PM CEST |
2 | From: Diana Craciun <diana.craciun@nxp.com> | |
3 | Date: Mon, 29 Apr 2019 18:49:03 +0300 | |
4 | Subject: powerpc/fsl: Emulate SPRN_BUCSR register | |
5 | To: stable@vger.kernel.org, gregkh@linuxfoundation.org | |
6 | Cc: linuxppc-dev@ozlabs.org, mpe@ellerman.id.au, Diana Craciun <diana.craciun@nxp.com> | |
7 | Message-ID: <1556552948-24957-4-git-send-email-diana.craciun@nxp.com> | |
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: |