summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/e500_mmu_host.c
diff options
context:
space:
mode:
authorMihai Caraman <mihai.caraman@freescale.com>2014-06-30 15:54:58 +0300
committerAlexander Graf <agraf@suse.de>2014-07-28 15:22:20 +0200
commitd57cef91a0c30d3439a4d235eb94ab9efbf797a0 (patch)
tree6a3c90fd213f531116afd393e89611b7a1cb9c8e /arch/powerpc/kvm/e500_mmu_host.c
parent9642382e826066c2d30d1b23d1b45410cdd8e07d (diff)
downloadblackbird-obmc-linux-d57cef91a0c30d3439a4d235eb94ab9efbf797a0.tar.gz
blackbird-obmc-linux-d57cef91a0c30d3439a4d235eb94ab9efbf797a0.zip
KVM: PPC: e500: Fix default tlb for victim hint
Tlb search operation used for victim hint relies on the default tlb set by the host. When hardware tablewalk support is enabled in the host, the default tlb is TLB1 which leads KVM to evict the bolted entry. Set and restore the default tlb when searching for victim hint. Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com> Reviewed-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm/e500_mmu_host.c')
-rw-r--r--arch/powerpc/kvm/e500_mmu_host.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c
index dd2cc03f406f..79677d76d1a4 100644
--- a/arch/powerpc/kvm/e500_mmu_host.c
+++ b/arch/powerpc/kvm/e500_mmu_host.c
@@ -107,11 +107,15 @@ static u32 get_host_mas0(unsigned long eaddr)
{
unsigned long flags;
u32 mas0;
+ u32 mas4;
local_irq_save(flags);
mtspr(SPRN_MAS6, 0);
+ mas4 = mfspr(SPRN_MAS4);
+ mtspr(SPRN_MAS4, mas4 & ~MAS4_TLBSEL_MASK);
asm volatile("tlbsx 0, %0" : : "b" (eaddr & ~CONFIG_PAGE_OFFSET));
mas0 = mfspr(SPRN_MAS0);
+ mtspr(SPRN_MAS4, mas4);
local_irq_restore(flags);
return mas0;
OpenPOWER on IntegriCloud