diff mbox

[20/33] KVM: PPC: Add ori instruction emulation

Message ID 1403472217-22263-21-git-send-email-agraf@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Alexander Graf June 22, 2014, 9:23 p.m. UTC
This patch implements emulation for the ori instruction.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/include/asm/ppc-opcode.h | 1 +
 arch/powerpc/kvm/emulate.c            | 5 +++++
 2 files changed, 6 insertions(+)
diff mbox

Patch

diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
index 2302a8e..a92c0e3 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -113,6 +113,7 @@ 
 #define OP_31_XOP_STHBRX    918
 
 #define OP_ADDIS 15
+#define OP_ORI  24
 #define OP_LWZ  32
 #define OP_LD   58
 #define OP_LWZU 33
diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
index 40f21bb..0437d3f 100644
--- a/arch/powerpc/kvm/emulate.c
+++ b/arch/powerpc/kvm/emulate.c
@@ -480,6 +480,11 @@  int kvmppc_emulate_any_instruction(struct kvm_vcpu *vcpu)
 		value += ((s16)get_d(inst)) << 16;
 		kvmppc_set_gpr(vcpu, get_rt(inst), value);
 		break;
+	case OP_ORI:
+		value = kvmppc_get_gpr(vcpu, get_rs(inst));
+		value |= get_d(inst);
+		kvmppc_set_gpr(vcpu, get_ra(inst), value);
+		break;
 	case 31:
 		switch (get_xop(inst)) {
 		case OP_31_XOP_MFCR: