KVM: PPC: Pass enum to kvmppc_get_last_inst
authorAlexander Graf <agraf@suse.de>
Wed, 10 Sep 2014 12:37:29 +0000 (14:37 +0200)
committerAlexander Graf <agraf@suse.de>
Mon, 22 Sep 2014 08:11:36 +0000 (10:11 +0200)
The kvmppc_get_last_inst function recently received a facelift that allowed
us to pass an enum of the type of instruction we want to read into it rather
than an unreadable boolean.

Unfortunately, not all callers ended up passing the enum. This wasn't really
an issue as "true" and "false" happen to match the two enum values we have,
but it's still hard to read.

Update all callers of kvmppc_get_last_inst() to follow the new calling
convention.

Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/kvm/booke.c
arch/powerpc/kvm/emulate.c
arch/powerpc/kvm/emulate_loadstore.c
arch/powerpc/kvm/powerpc.c

index ed5b0dd58726086dffaeae619e3b0142ce533e03..9b55dec2d6cc11846576abe16f286c87dc873b50 100644 (file)
@@ -992,12 +992,12 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
        case BOOKE_INTERRUPT_DATA_STORAGE:
        case BOOKE_INTERRUPT_DTLB_MISS:
        case BOOKE_INTERRUPT_HV_PRIV:
-               emulated = kvmppc_get_last_inst(vcpu, false, &last_inst);
+               emulated = kvmppc_get_last_inst(vcpu, INST_GENERIC, &last_inst);
                break;
        case BOOKE_INTERRUPT_PROGRAM:
                /* SW breakpoints arrive as illegal instructions on HV */
                if (vcpu->guest_debug & KVM_GUESTDBG_USE_SW_BP)
-                       emulated = kvmppc_get_last_inst(vcpu, false, &last_inst);
+                       emulated = kvmppc_get_last_inst(vcpu, INST_GENERIC, &last_inst);
                break;
        default:
                break;
index 005222b580eaece3fcb1739b7810f04ae9c44a06..5cc2e7af3a7b96322b9f768a7aadb867ea6b7560 100644 (file)
@@ -219,7 +219,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
        /* this default type might be overwritten by subcategories */
        kvmppc_set_exit_type(vcpu, EMULATED_INST_EXITS);
 
-       emulated = kvmppc_get_last_inst(vcpu, false, &inst);
+       emulated = kvmppc_get_last_inst(vcpu, INST_GENERIC, &inst);
        if (emulated != EMULATE_DONE)
                return emulated;
 
index 0de4ffa175a94d663367587a6140c3539a4049cf..6d3c0ee1d744bbd37c3f7052f9415afee687915e 100644 (file)
@@ -58,7 +58,7 @@ int kvmppc_emulate_loadstore(struct kvm_vcpu *vcpu)
        /* this default type might be overwritten by subcategories */
        kvmppc_set_exit_type(vcpu, EMULATED_INST_EXITS);
 
-       emulated = kvmppc_get_last_inst(vcpu, false, &inst);
+       emulated = kvmppc_get_last_inst(vcpu, INST_GENERIC, &inst);
        if (emulated != EMULATE_DONE)
                return emulated;
 
index ecf057551a2f5f189db1fb50f9d9040cd574f3b5..c1f8f53cd31224743be63e5969df08e4d67d07b6 100644 (file)
@@ -294,7 +294,7 @@ int kvmppc_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu)
        {
                u32 last_inst;
 
-               kvmppc_get_last_inst(vcpu, false, &last_inst);
+               kvmppc_get_last_inst(vcpu, INST_GENERIC, &last_inst);
                /* XXX Deliver Program interrupt to guest. */
                pr_emerg("%s: emulation failed (%08x)\n", __func__, last_inst);
                r = RESUME_HOST;