aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2013-02-13 14:37:48 -0500
committerAlexander Graf <agraf@suse.de>2013-03-21 20:21:11 -0400
commitd6940b64167829f0367dbda65ddafb59efbd29c7 (patch)
tree1b9f6343c468efbeae0163c625009d42f68822d9
parent15b708beee6841e0a59ded702c8bfe3042a5b5a4 (diff)
kvm/ppc/e500: h2g_tlb1_rmap: esel 0 is valid
Add one to esel values in h2g_tlb1_rmap, so that "no mapping" can be distinguished from "esel 0". Note that we're not saved by the fact that host esel 0 is reserved for non-KVM use, because KVM host esel numbering is not the raw host numbering (see to_htlb1_esel). Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
-rw-r--r--arch/powerpc/kvm/e500_mmu_host.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c
index a222edfb9a9b..35fb80ec1f57 100644
--- a/arch/powerpc/kvm/e500_mmu_host.c
+++ b/arch/powerpc/kvm/e500_mmu_host.c
@@ -511,10 +511,10 @@ static int kvmppc_e500_tlb1_map_tlb1(struct kvmppc_vcpu_e500 *vcpu_e500,
511 vcpu_e500->g2h_tlb1_map[esel] |= (u64)1 << sesel; 511 vcpu_e500->g2h_tlb1_map[esel] |= (u64)1 << sesel;
512 vcpu_e500->gtlb_priv[1][esel].ref.flags |= E500_TLB_BITMAP; 512 vcpu_e500->gtlb_priv[1][esel].ref.flags |= E500_TLB_BITMAP;
513 if (vcpu_e500->h2g_tlb1_rmap[sesel]) { 513 if (vcpu_e500->h2g_tlb1_rmap[sesel]) {
514 unsigned int idx = vcpu_e500->h2g_tlb1_rmap[sesel]; 514 unsigned int idx = vcpu_e500->h2g_tlb1_rmap[sesel] - 1;
515 vcpu_e500->g2h_tlb1_map[idx] &= ~(1ULL << sesel); 515 vcpu_e500->g2h_tlb1_map[idx] &= ~(1ULL << sesel);
516 } 516 }
517 vcpu_e500->h2g_tlb1_rmap[sesel] = esel; 517 vcpu_e500->h2g_tlb1_rmap[sesel] = esel + 1;
518 518
519 return sesel; 519 return sesel;
520} 520}