]> git.karo-electronics.de Git - karo-tx-linux.git/commit
MIPS: KVM: remove shadow_tlb code
authorJames Hogan <james.hogan@imgtec.com>
Fri, 17 Jan 2014 12:01:31 +0000 (12:01 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Fri, 24 Jan 2014 21:39:56 +0000 (22:39 +0100)
commit08596b0a757824df775cac0f4fa06975f578d3b2
treed600208c08034e523dbd3466c32f83fea01521e5
parente36059e508c209703c3a60ef716a5b524fb0a832
MIPS: KVM: remove shadow_tlb code

The kvm_mips_init_shadow_tlb() function is called from
kvm_arch_vcpu_init() and initialises entries 0 to
current_cpu_data.tlbsize-1 of the virtual cpu's shadow_tlb[64] array.

However newer cores with FTLBs can have a tlbsize > 64, for example the
ProAptiv I'm testing on has a total tlbsize of 576. This causes
kvm_mips_init_shadow_tlb() to overflow the shadow_tlb[64] array and
overwrite the comparecount_timer among other things, causing a lock up
when starting a KVM guest.

Aside from kvm_mips_init_shadow_tlb() which only initialises it, the
shadow_tlb[64] array is only actually used by the following functions:
 - kvm_shadow_tlb_put() & kvm_shadow_tlb_load()
     These are never called. The only call sites are #if 0'd out.
 - kvm_mips_dump_shadow_tlbs()
     This is never called.

It was originally added for trap & emulate, but turned out to be
unnecessary so it was disabled.

So instead of fixing the shadow_tlb initialisation code, lets just
remove the shadow_tlb[64] array and the above functions entirely. The
only functional change here is the removal of broken shadow_tlb
initialisation. The rest just deletes dead code.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: Gleb Natapov <gleb@redhat.com>
Cc: kvm@vger.kernel.org
Cc: Sanjay Lal <sanjayl@kymasys.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/6384/
arch/mips/include/asm/kvm_host.h
arch/mips/kvm/kvm_mips.c
arch/mips/kvm/kvm_tlb.c