• James Hogan's avatar
    KVM: MIPS/TLB: Fix off-by-one in TLB invalidate · f3a8603f
    James Hogan authored
    kvm_mips_host_tlb_inv() uses the TLBP instruction to probe the host TLB
    for an entry matching the given guest virtual address, and determines
    whether a match was found based on whether CP0_Index > 0. This is
    technically incorrect as an index of 0 (with the high bit clear) is a
    perfectly valid TLB index.
    
    This is harmless at the moment due to the use of at least 1 wired TLB
    entry for the KVM commpage, however we will soon be ridding ourselves of
    that particular wired entry so lets fix the condition in case the entry
    needing invalidation does land at TLB index 0.
    Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: "Radim Krčmář" <rkrcmar@redhat.com>
    Cc: Ralf Baechle <ralf@linux-mips.org>
    Cc: linux-mips@linux-mips.org
    Cc: kvm@vger.kernel.org
    f3a8603f
tlb.c 10 KB