powerpc/fsl: Emulate SPRN_BUCSR register
authorDiana Craciun <diana.craciun@nxp.com>
Wed, 12 Dec 2018 14:03:03 +0000 (16:03 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 20 Dec 2018 11:59:03 +0000 (22:59 +1100)
In order to flush the branch predictor the guest kernel performs
writes to the BUCSR register which is hypervisor privilleged. However,
the branch predictor is flushed at each KVM entry, so the branch
predictor has been already flushed, so just return as soon as possible
to guest.

Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
[mpe: Tweak comment formatting]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kvm/e500_emulate.c

index 3f8189eb56ed038f2be56f478f8c6e6925c11f27..fde1de08b4d77e7321bfa0dbf82fc3c6c6565859 100644 (file)
@@ -277,6 +277,13 @@ int kvmppc_core_emulate_mtspr_e500(struct kvm_vcpu *vcpu, int sprn, ulong spr_va
                vcpu->arch.pwrmgtcr0 = spr_val;
                break;
 
+       case SPRN_BUCSR:
+               /*
+                * If we are here, it means that we have already flushed the
+                * branch predictor, so just return to guest.
+                */
+               break;
+
        /* extra exceptions */
 #ifdef CONFIG_SPE_POSSIBLE
        case SPRN_IVOR32: