From: James Hogan Date: Fri, 17 Jan 2014 12:01:31 +0000 (+0000) Subject: MIPS: KVM: remove shadow_tlb code X-Git-Tag: v3.14-rc1~37^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08596b0a757824df775cac0f4fa06975f578d3b2;p=pandora-kernel.git 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 Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Cc: Gleb Natapov Cc: kvm@vger.kernel.org Cc: Sanjay Lal Acked-by: Paolo Bonzini Signed-off-by: John Crispin Patchwork: http://patchwork.linux-mips.org/patch/6384/ --- Reading git-diff-tree failed