diff options
Diffstat (limited to 'arch/mips/kvm/emulate.c')
-rw-r--r-- | arch/mips/kvm/emulate.c | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/arch/mips/kvm/emulate.c b/arch/mips/kvm/emulate.c index 6eb52b9c9818..e788515f766b 100644 --- a/arch/mips/kvm/emulate.c +++ b/arch/mips/kvm/emulate.c | |||
@@ -1642,8 +1642,14 @@ enum emulation_result kvm_mips_emulate_cache(union mips_instruction inst, | |||
1642 | 1642 | ||
1643 | preempt_disable(); | 1643 | preempt_disable(); |
1644 | if (KVM_GUEST_KSEGX(va) == KVM_GUEST_KSEG0) { | 1644 | if (KVM_GUEST_KSEGX(va) == KVM_GUEST_KSEG0) { |
1645 | if (kvm_mips_host_tlb_lookup(vcpu, va) < 0) | 1645 | if (kvm_mips_host_tlb_lookup(vcpu, va) < 0 && |
1646 | kvm_mips_handle_kseg0_tlb_fault(va, vcpu); | 1646 | kvm_mips_handle_kseg0_tlb_fault(va, vcpu)) { |
1647 | kvm_err("%s: handling mapped kseg0 tlb fault for %lx, vcpu: %p, ASID: %#lx\n", | ||
1648 | __func__, va, vcpu, read_c0_entryhi()); | ||
1649 | er = EMULATE_FAIL; | ||
1650 | preempt_enable(); | ||
1651 | goto done; | ||
1652 | } | ||
1647 | } else if ((KVM_GUEST_KSEGX(va) < KVM_GUEST_KSEG0) || | 1653 | } else if ((KVM_GUEST_KSEGX(va) < KVM_GUEST_KSEG0) || |
1648 | KVM_GUEST_KSEGX(va) == KVM_GUEST_KSEG23) { | 1654 | KVM_GUEST_KSEGX(va) == KVM_GUEST_KSEG23) { |
1649 | int index; | 1655 | int index; |
@@ -1680,12 +1686,18 @@ enum emulation_result kvm_mips_emulate_cache(union mips_instruction inst, | |||
1680 | run, vcpu); | 1686 | run, vcpu); |
1681 | preempt_enable(); | 1687 | preempt_enable(); |
1682 | goto dont_update_pc; | 1688 | goto dont_update_pc; |
1683 | } else { | 1689 | } |
1684 | /* | 1690 | /* |
1685 | * We fault an entry from the guest tlb to the | 1691 | * We fault an entry from the guest tlb to the |
1686 | * shadow host TLB | 1692 | * shadow host TLB |
1687 | */ | 1693 | */ |
1688 | kvm_mips_handle_mapped_seg_tlb_fault(vcpu, tlb); | 1694 | if (kvm_mips_handle_mapped_seg_tlb_fault(vcpu, tlb)) { |
1695 | kvm_err("%s: handling mapped seg tlb fault for %lx, index: %u, vcpu: %p, ASID: %#lx\n", | ||
1696 | __func__, va, index, vcpu, | ||
1697 | read_c0_entryhi()); | ||
1698 | er = EMULATE_FAIL; | ||
1699 | preempt_enable(); | ||
1700 | goto done; | ||
1689 | } | 1701 | } |
1690 | } | 1702 | } |
1691 | } else { | 1703 | } else { |
@@ -2659,7 +2671,12 @@ enum emulation_result kvm_mips_handle_tlbmiss(u32 cause, | |||
2659 | * OK we have a Guest TLB entry, now inject it into the | 2671 | * OK we have a Guest TLB entry, now inject it into the |
2660 | * shadow host TLB | 2672 | * shadow host TLB |
2661 | */ | 2673 | */ |
2662 | kvm_mips_handle_mapped_seg_tlb_fault(vcpu, tlb); | 2674 | if (kvm_mips_handle_mapped_seg_tlb_fault(vcpu, tlb)) { |
2675 | kvm_err("%s: handling mapped seg tlb fault for %lx, index: %u, vcpu: %p, ASID: %#lx\n", | ||
2676 | __func__, va, index, vcpu, | ||
2677 | read_c0_entryhi()); | ||
2678 | er = EMULATE_FAIL; | ||
2679 | } | ||
2663 | } | 2680 | } |
2664 | } | 2681 | } |
2665 | 2682 | ||