diff options
author | Mihai Caraman <mihai.caraman@freescale.com> | 2013-04-17 15:40:35 (GMT) |
---|---|---|
committer | Fleming Andrew-AFLEMING <AFLEMING@freescale.com> | 2013-04-17 20:25:14 (GMT) |
commit | 8153955f97d3c99c1204a3690937c991a0aa92df (patch) | |
tree | 3970c68a294b082d04c6ce9ed0db74a2c4d3186c /arch/powerpc/kvm | |
parent | c29142c0d3942e2c59ad3b9f780780e65f167d3a (diff) | |
download | linux-fsl-qoriq-8153955f97d3c99c1204a3690937c991a0aa92df.tar.xz |
KVM: PPC: Book3E: Emulate MCSRR0/1 SPR and rfmci instruction
Emulate MCSRR0/1 SPR and rfmci instruction since they are used by A-006198
erratum fix.
Also fix kvm_exit_names array in the process.
Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
Change-Id: I15372519a9b3010ab8dfb43255a8b78ef10c4893
Reviewed-on: http://git.am.freescale.net:8181/1299
Reviewed-by: Yoder Stuart-B08248 <stuart.yoder@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r-- | arch/powerpc/kvm/booke_emulate.c | 25 | ||||
-rw-r--r-- | arch/powerpc/kvm/timing.c | 6 |
2 files changed, 30 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/booke_emulate.c b/arch/powerpc/kvm/booke_emulate.c index 27a4b28..aaff1b7 100644 --- a/arch/powerpc/kvm/booke_emulate.c +++ b/arch/powerpc/kvm/booke_emulate.c @@ -23,6 +23,7 @@ #include "booke.h" +#define OP_19_XOP_RFMCI 38 #define OP_19_XOP_RFI 50 #define OP_19_XOP_RFCI 51 @@ -43,6 +44,12 @@ static void kvmppc_emul_rfci(struct kvm_vcpu *vcpu) kvmppc_set_msr(vcpu, vcpu->arch.csrr1); } +static void kvmppc_emul_rfmci(struct kvm_vcpu *vcpu) +{ + vcpu->arch.pc = vcpu->arch.mcsrr0; + kvmppc_set_msr(vcpu, vcpu->arch.mcsrr1); +} + int kvmppc_booke_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu, unsigned int inst, int *advance) { @@ -65,6 +72,12 @@ int kvmppc_booke_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu, *advance = 0; break; + case OP_19_XOP_RFMCI: + kvmppc_emul_rfmci(vcpu); + kvmppc_set_exit_type(vcpu, EMULATED_RFMCI_EXITS); + *advance = 0; + break; + default: emulated = EMULATE_FAIL; break; @@ -138,6 +151,12 @@ int kvmppc_booke_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, ulong spr_val) case SPRN_DBCR1: vcpu->arch.dbg_reg.dbcr1 = spr_val; break; + case SPRN_MCSRR0: + vcpu->arch.mcsrr0 = spr_val; + break; + case SPRN_MCSRR1: + vcpu->arch.mcsrr1 = spr_val; + break; case SPRN_DBSR: vcpu->arch.dbsr &= ~spr_val; break; @@ -284,6 +303,12 @@ int kvmppc_booke_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, ulong *spr_val) case SPRN_DBCR1: *spr_val = vcpu->arch.dbg_reg.dbcr1; break; + case SPRN_MCSRR0: + *spr_val = vcpu->arch.mcsrr0; + break; + case SPRN_MCSRR1: + *spr_val = vcpu->arch.mcsrr1; + break; case SPRN_DBSR: *spr_val = vcpu->arch.dbsr; break; diff --git a/arch/powerpc/kvm/timing.c b/arch/powerpc/kvm/timing.c index 07b6110..828c4d2 100644 --- a/arch/powerpc/kvm/timing.c +++ b/arch/powerpc/kvm/timing.c @@ -129,13 +129,17 @@ static const char *kvm_exit_names[__NUMBER_OF_KVM_EXIT_TYPES] = { [EMULATED_TLBSX_EXITS] = "EMUL_TLBSX", [EMULATED_TLBWE_EXITS] = "EMUL_TLBWE", [EMULATED_RFI_EXITS] = "EMUL_RFI", + [EMULATED_RFCI_EXITS] = "EMUL_RFCI", [DEC_EXITS] = "DEC", [EXT_INTR_EXITS] = "EXTINT", [HALT_WAKEUP] = "HALT", [USR_PR_INST] = "USR_PR_INST", [FP_UNAVAIL] = "FP_UNAVAIL", [DEBUG_EXITS] = "DEBUG", - [TIMEINGUEST] = "TIMEINGUEST" + [TIMEINGUEST] = "TIMEINGUEST", + [DBELL_EXITS] = "DBELL", + [GDBELL_EXITS] = "GDBELL", + [EMULATED_RFMCI_EXITS] = "EMUL_RFMCI" }; static int kvmppc_exit_timing_show(struct seq_file *m, void *private) |