@@ -86,6 +86,7 @@
#define OP_TRAP_64 2
#define OP_31_XOP_TRAP 4
+#define OP_31_XOP_MFCR 19
#define OP_31_XOP_LWZX 23
#define OP_31_XOP_DCBST 54
#define OP_31_XOP_LWZUX 55
@@ -473,6 +473,16 @@ int kvmppc_emulate_any_instruction(struct kvm_vcpu *vcpu)
emulated = kvmppc_emulate_load(vcpu, addr, &value, 4);
kvmppc_set_gpr(vcpu, get_rt(inst), value);
break;
+ case 31:
+ switch (get_xop(inst)) {
+ case OP_31_XOP_MFCR:
+ kvmppc_set_gpr(vcpu, get_rt(inst), kvmppc_get_cr(vcpu));
+ break;
+ default:
+ emulated = EMULATE_FAIL;
+ break;
+ }
+ break;
default:
emulated = EMULATE_FAIL;
break;
This patch adds full emulation support for the mfcr instruction. Signed-off-by: Alexander Graf <agraf@suse.de> --- arch/powerpc/include/asm/ppc-opcode.h | 1 + arch/powerpc/kvm/emulate.c | 10 ++++++++++ 2 files changed, 11 insertions(+)