diff mbox

[17/33] KVM: PPC: Add lwz instruction emulation

Message ID 1403472217-22263-18-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 adds full emulation support for the lwz instruction.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/kvm/emulate.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox

Patch

diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
index 9f89a41..e688d85 100644
--- a/arch/powerpc/kvm/emulate.c
+++ b/arch/powerpc/kvm/emulate.c
@@ -468,6 +468,11 @@  int kvmppc_emulate_any_instruction(struct kvm_vcpu *vcpu)
 		if (emulated == EMULATE_DONE)
 			kvmppc_set_gpr(vcpu, get_rt(inst), value);
 		break;
+	case OP_LWZ:
+		addr = get_addr(vcpu, (s16)get_d(inst), get_ra(inst));
+		emulated = kvmppc_emulate_load(vcpu, addr, &value, 4);
+		kvmppc_set_gpr(vcpu, get_rt(inst), value);
+		break;
 	default:
 		emulated = EMULATE_FAIL;
 		break;