summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2013-02-13 19:37:48 (GMT)
committerStuart Yoder <stuart.yoder@freescale.com>2013-04-11 22:29:42 (GMT)
commit938e7b470cc390855df129ad53b9f99375aec602 (patch)
treec753a3652b3a27ec97369d26e6e8720abd545aa6 /arch
parent1b71ae79766846d425a5f7f84cb78100ee191cde (diff)
downloadlinux-fsl-qoriq-938e7b470cc390855df129ad53b9f99375aec602.tar.xz
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>
Diffstat (limited to 'arch')
-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 a222edf..35fb80e 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,
vcpu_e500->g2h_tlb1_map[esel] |= (u64)1 << sesel;
vcpu_e500->gtlb_priv[1][esel].ref.flags |= E500_TLB_BITMAP;
if (vcpu_e500->h2g_tlb1_rmap[sesel]) {
- unsigned int idx = vcpu_e500->h2g_tlb1_rmap[sesel];
+ unsigned int idx = vcpu_e500->h2g_tlb1_rmap[sesel] - 1;
vcpu_e500->g2h_tlb1_map[idx] &= ~(1ULL << sesel);
}
- vcpu_e500->h2g_tlb1_rmap[sesel] = esel;
+ vcpu_e500->h2g_tlb1_rmap[sesel] = esel + 1;
return sesel;
}