diff options
author | James Hogan <james.hogan@imgtec.com> | 2014-05-29 05:16:41 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-05-30 07:05:20 -0400 |
commit | 3d654833713ddb0464cbaee14fe75ef1e4e2ded0 (patch) | |
tree | 4015664df9a1044b08f7443523d24d9b9a597f0e /arch | |
parent | 2dca3725cbe0bc5aeb195e7c098bcebae5d40f83 (diff) |
MIPS: KVM: Fix kvm_debug bit-rottage
Fix build errors when DEBUG is defined in arch/mips/kvm/.
- The DEBUG code in kvm_mips_handle_tlbmod() was missing some variables.
- The DEBUG code in kvm_mips_host_tlb_write() was conditional on an
undefined "debug" variable.
- The DEBUG code in kvm_mips_host_tlb_inv() accessed asid_map directly
rather than using kvm_mips_get_user_asid(). Also fixed brace
placement.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: kvm@vger.kernel.org
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: Sanjay Lal <sanjayl@kymasys.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/kvm/kvm_mips_emul.c | 6 | ||||
-rw-r--r-- | arch/mips/kvm/kvm_tlb.c | 14 |
2 files changed, 10 insertions, 10 deletions
diff --git a/arch/mips/kvm/kvm_mips_emul.c b/arch/mips/kvm/kvm_mips_emul.c index 6d257384c9b4..c81ab791b8f2 100644 --- a/arch/mips/kvm/kvm_mips_emul.c +++ b/arch/mips/kvm/kvm_mips_emul.c | |||
@@ -1831,8 +1831,12 @@ kvm_mips_handle_tlbmod(unsigned long cause, uint32_t *opc, | |||
1831 | struct kvm_run *run, struct kvm_vcpu *vcpu) | 1831 | struct kvm_run *run, struct kvm_vcpu *vcpu) |
1832 | { | 1832 | { |
1833 | enum emulation_result er = EMULATE_DONE; | 1833 | enum emulation_result er = EMULATE_DONE; |
1834 | |||
1835 | #ifdef DEBUG | 1834 | #ifdef DEBUG |
1835 | struct mips_coproc *cop0 = vcpu->arch.cop0; | ||
1836 | unsigned long entryhi = (vcpu->arch.host_cp0_badvaddr & VPN2_MASK) | | ||
1837 | (kvm_read_c0_guest_entryhi(cop0) & ASID_MASK); | ||
1838 | int index; | ||
1839 | |||
1836 | /* | 1840 | /* |
1837 | * If address not in the guest TLB, then we are in trouble | 1841 | * If address not in the guest TLB, then we are in trouble |
1838 | */ | 1842 | */ |
diff --git a/arch/mips/kvm/kvm_tlb.c b/arch/mips/kvm/kvm_tlb.c index d65999a9f8af..994fc2384180 100644 --- a/arch/mips/kvm/kvm_tlb.c +++ b/arch/mips/kvm/kvm_tlb.c | |||
@@ -233,12 +233,9 @@ kvm_mips_host_tlb_write(struct kvm_vcpu *vcpu, unsigned long entryhi, | |||
233 | tlbw_use_hazard(); | 233 | tlbw_use_hazard(); |
234 | 234 | ||
235 | #ifdef DEBUG | 235 | #ifdef DEBUG |
236 | if (debug) { | 236 | kvm_debug("@ %#lx idx: %2d [entryhi(R): %#lx] entrylo0(R): 0x%08lx, entrylo1(R): 0x%08lx\n", |
237 | kvm_debug("@ %#lx idx: %2d [entryhi(R): %#lx] " | 237 | vcpu->arch.pc, idx, read_c0_entryhi(), |
238 | "entrylo0(R): 0x%08lx, entrylo1(R): 0x%08lx\n", | 238 | read_c0_entrylo0(), read_c0_entrylo1()); |
239 | vcpu->arch.pc, idx, read_c0_entryhi(), | ||
240 | read_c0_entrylo0(), read_c0_entrylo1()); | ||
241 | } | ||
242 | #endif | 239 | #endif |
243 | 240 | ||
244 | /* Flush D-cache */ | 241 | /* Flush D-cache */ |
@@ -507,10 +504,9 @@ int kvm_mips_host_tlb_inv(struct kvm_vcpu *vcpu, unsigned long va) | |||
507 | local_irq_restore(flags); | 504 | local_irq_restore(flags); |
508 | 505 | ||
509 | #ifdef DEBUG | 506 | #ifdef DEBUG |
510 | if (idx > 0) { | 507 | if (idx > 0) |
511 | kvm_debug("%s: Invalidated entryhi %#lx @ idx %d\n", __func__, | 508 | kvm_debug("%s: Invalidated entryhi %#lx @ idx %d\n", __func__, |
512 | (va & VPN2_MASK) | (vcpu->arch.asid_map[va & ASID_MASK] & ASID_MASK), idx); | 509 | (va & VPN2_MASK) | kvm_mips_get_user_asid(vcpu), idx); |
513 | } | ||
514 | #endif | 510 | #endif |
515 | 511 | ||
516 | return 0; | 512 | return 0; |