KVM: PPC: Add MMIO emulation for remaining floating-point instructions
authorPaul Mackerras <paulus@ozlabs.org>
Thu, 23 Mar 2017 00:55:16 +0000 (11:55 +1100)
committerPaul Mackerras <paulus@ozlabs.org>
Thu, 20 Apr 2017 01:37:44 +0000 (11:37 +1000)
For completeness, this adds emulation of the lfiwax and lfiwzx
instructions.  With this, all floating-point load and store instructions
as of Power ISA V2.07 are emulated.

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

index 738bac164f8bb747be226823d229a03e877b538f..73f06f4dddc78a44725a59a150b42b270b312704 100644 (file)
 #define OP_31_XOP_STFDX     727
 #define OP_31_XOP_STFDUX    759
 #define OP_31_XOP_LHBRX     790
+#define OP_31_XOP_LFIWAX    855
+#define OP_31_XOP_LFIWZX    887
 #define OP_31_XOP_STHBRX    918
 #define OP_31_XOP_STFIWX    983
 
index f10ba0c2c202b2c9492c3ec06bbd3d0b0f13070d..af833531af31912e727e39c5146d966c3b4609ee 100644 (file)
@@ -270,6 +270,20 @@ int kvmppc_emulate_loadstore(struct kvm_vcpu *vcpu)
                        kvmppc_set_gpr(vcpu, ra, vcpu->arch.vaddr_accessed);
                        break;
 
+               case OP_31_XOP_LFIWAX:
+                       if (kvmppc_check_fp_disabled(vcpu))
+                               return EMULATE_DONE;
+                       emulated = kvmppc_handle_loads(run, vcpu,
+                               KVM_MMIO_REG_FPR|rt, 4, 1);
+                       break;
+
+               case OP_31_XOP_LFIWZX:
+                       if (kvmppc_check_fp_disabled(vcpu))
+                               return EMULATE_DONE;
+                       emulated = kvmppc_handle_load(run, vcpu,
+                               KVM_MMIO_REG_FPR|rt, 4, 1);
+                       break;
+
                case OP_31_XOP_STFSX:
                        if (kvmppc_check_fp_disabled(vcpu))
                                return EMULATE_DONE;