MIPS: KVM: Remove ifdef DEBUG around kvm_debug
[firefly-linux-kernel-4.4.55.git] / arch / mips / kvm / kvm_mips_emul.c
index 6d257384c9b43eb3b3e39b95e6546d0d670f0be5..8d484009008283e9afdd0da7344c99cf4b8ec8e6 100644 (file)
@@ -1831,8 +1831,12 @@ kvm_mips_handle_tlbmod(unsigned long cause, uint32_t *opc,
                       struct kvm_run *run, struct kvm_vcpu *vcpu)
 {
        enum emulation_result er = EMULATE_DONE;
-
 #ifdef DEBUG
+       struct mips_coproc *cop0 = vcpu->arch.cop0;
+       unsigned long entryhi = (vcpu->arch.host_cp0_badvaddr & VPN2_MASK) |
+                               (kvm_read_c0_guest_entryhi(cop0) & ASID_MASK);
+       int index;
+
        /*
         * If address not in the guest TLB, then we are in trouble
         */
@@ -2315,11 +2319,9 @@ kvm_mips_handle_tlbmiss(unsigned long cause, uint32_t *opc,
                                er = EMULATE_FAIL;
                        }
                } else {
-#ifdef DEBUG
                        kvm_debug
                            ("Injecting hi: %#lx, lo0: %#lx, lo1: %#lx into shadow host TLB\n",
                             tlb->tlb_hi, tlb->tlb_lo0, tlb->tlb_lo1);
-#endif
                        /* OK we have a Guest TLB entry, now inject it into the shadow host TLB */
                        kvm_mips_handle_mapped_seg_tlb_fault(vcpu, tlb, NULL,
                                                             NULL);