提交 0c1fc3c3 编写于 作者: B Bharat Bhushan 提交者: Alexander Graf

KVM: PPC: Critical interrupt emulation support

rfci instruction and CSRR0/1 registers are emulated.
Signed-off-by: NScott Wood <scottwood@freescale.com>
Signed-off-by: NStuart Yoder <stuart.yoder@freescale.com>
Signed-off-by: NBharat Bhushan <bharat.bhushan@freescale.com>
Signed-off-by: NAlexander Graf <agraf@suse.de>
上级 66c9897d
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "booke.h" #include "booke.h"
#define OP_19_XOP_RFI 50 #define OP_19_XOP_RFI 50
#define OP_19_XOP_RFCI 51
#define OP_31_XOP_MFMSR 83 #define OP_31_XOP_MFMSR 83
#define OP_31_XOP_WRTEE 131 #define OP_31_XOP_WRTEE 131
...@@ -36,6 +37,12 @@ static void kvmppc_emul_rfi(struct kvm_vcpu *vcpu) ...@@ -36,6 +37,12 @@ static void kvmppc_emul_rfi(struct kvm_vcpu *vcpu)
kvmppc_set_msr(vcpu, vcpu->arch.shared->srr1); kvmppc_set_msr(vcpu, vcpu->arch.shared->srr1);
} }
static void kvmppc_emul_rfci(struct kvm_vcpu *vcpu)
{
vcpu->arch.pc = vcpu->arch.csrr0;
kvmppc_set_msr(vcpu, vcpu->arch.csrr1);
}
int kvmppc_booke_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu, int kvmppc_booke_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
unsigned int inst, int *advance) unsigned int inst, int *advance)
{ {
...@@ -52,6 +59,12 @@ int kvmppc_booke_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu, ...@@ -52,6 +59,12 @@ int kvmppc_booke_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
*advance = 0; *advance = 0;
break; break;
case OP_19_XOP_RFCI:
kvmppc_emul_rfci(vcpu);
kvmppc_set_exit_type(vcpu, EMULATED_RFCI_EXITS);
*advance = 0;
break;
default: default:
emulated = EMULATE_FAIL; emulated = EMULATE_FAIL;
break; break;
...@@ -113,6 +126,12 @@ int kvmppc_booke_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, ulong spr_val) ...@@ -113,6 +126,12 @@ int kvmppc_booke_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, ulong spr_val)
case SPRN_ESR: case SPRN_ESR:
vcpu->arch.shared->esr = spr_val; vcpu->arch.shared->esr = spr_val;
break; break;
case SPRN_CSRR0:
vcpu->arch.csrr0 = spr_val;
break;
case SPRN_CSRR1:
vcpu->arch.csrr1 = spr_val;
break;
case SPRN_DBCR0: case SPRN_DBCR0:
vcpu->arch.dbcr0 = spr_val; vcpu->arch.dbcr0 = spr_val;
break; break;
...@@ -232,6 +251,12 @@ int kvmppc_booke_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, ulong *spr_val) ...@@ -232,6 +251,12 @@ int kvmppc_booke_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, ulong *spr_val)
case SPRN_ESR: case SPRN_ESR:
*spr_val = vcpu->arch.shared->esr; *spr_val = vcpu->arch.shared->esr;
break; break;
case SPRN_CSRR0:
*spr_val = vcpu->arch.csrr0;
break;
case SPRN_CSRR1:
*spr_val = vcpu->arch.csrr1;
break;
case SPRN_DBCR0: case SPRN_DBCR0:
*spr_val = vcpu->arch.dbcr0; *spr_val = vcpu->arch.dbcr0;
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册