KVM: PPC: Add MMIO emulation for stdx (store doubleword indexed)
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Fri, 17 Mar 2017 08:31:38 +0000 (19:31 +1100)
committerPaul Mackerras <paulus@ozlabs.org>
Thu, 20 Apr 2017 01:37:33 +0000 (11:37 +1000)
This adds missing stdx emulation for emulated MMIO accesses by KVM
guests.  This allows the Mellanox mlx5_core driver from recent kernels
to work when MMIO emulation is enforced by userspace.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/include/asm/ppc-opcode.h
arch/powerpc/kvm/emulate_loadstore.c

index 1e37c3c0733a82282642942d17e6a78432ea1a97..94e7df22630efe75a963768b2f6d3a638b826113 100644 (file)
@@ -94,6 +94,7 @@
 #define OP_31_XOP_TRAP_64   68
 #define OP_31_XOP_DCBF      86
 #define OP_31_XOP_LBZX      87
+#define OP_31_XOP_STDX      149
 #define OP_31_XOP_STWX      151
 #define OP_31_XOP_STBX      215
 #define OP_31_XOP_LBZUX     119
index 9cda1b9dbc51921a9a5983887751ac370c8e2e72..a0f27a30379d8e58bc021f4f4d4c55ce1da33bba 100644 (file)
@@ -119,6 +119,12 @@ int kvmppc_emulate_loadstore(struct kvm_vcpu *vcpu)
                        kvmppc_set_gpr(vcpu, ra, vcpu->arch.vaddr_accessed);
                        break;
 
+               case OP_31_XOP_STDX:
+                       emulated = kvmppc_handle_store(run, vcpu,
+                                                      kvmppc_get_gpr(vcpu, rs),
+                                                       8, 1);
+                       break;
+
                case OP_31_XOP_STWX:
                        emulated = kvmppc_handle_store(run, vcpu,
                                                       kvmppc_get_gpr(vcpu, rs),