diff options
author | Hollis Blanchard <hollisb@us.ibm.com> | 2009-01-03 17:23:02 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-03-24 05:02:56 -0400 |
commit | be8d1cae07d5acf4a61046d7def5eda40f0981e1 (patch) | |
tree | 32560487e3fd05bb6c64c394016e9461c70b2227 /arch/powerpc/kvm/44x_tlb.c | |
parent | 58a96214a306fc7fc66105097eea9c4f3bfa35bc (diff) |
KVM: ppc: turn tlb_xlate() into a per-core hook (and give it a better name)
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/kvm/44x_tlb.c')
-rw-r--r-- | arch/powerpc/kvm/44x_tlb.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/44x_tlb.c b/arch/powerpc/kvm/44x_tlb.c index e8ed22f28eae..2f14671e8a15 100644 --- a/arch/powerpc/kvm/44x_tlb.c +++ b/arch/powerpc/kvm/44x_tlb.c | |||
@@ -208,6 +208,16 @@ int kvmppc_44x_tlb_index(struct kvm_vcpu *vcpu, gva_t eaddr, unsigned int pid, | |||
208 | return -1; | 208 | return -1; |
209 | } | 209 | } |
210 | 210 | ||
211 | gpa_t kvmppc_mmu_xlate(struct kvm_vcpu *vcpu, unsigned int gtlb_index, | ||
212 | gva_t eaddr) | ||
213 | { | ||
214 | struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu); | ||
215 | struct kvmppc_44x_tlbe *gtlbe = &vcpu_44x->guest_tlb[gtlb_index]; | ||
216 | unsigned int pgmask = get_tlb_bytes(gtlbe) - 1; | ||
217 | |||
218 | return get_tlb_raddr(gtlbe) | (eaddr & pgmask); | ||
219 | } | ||
220 | |||
211 | int kvmppc_44x_itlb_index(struct kvm_vcpu *vcpu, gva_t eaddr) | 221 | int kvmppc_44x_itlb_index(struct kvm_vcpu *vcpu, gva_t eaddr) |
212 | { | 222 | { |
213 | unsigned int as = !!(vcpu->arch.msr & MSR_IS); | 223 | unsigned int as = !!(vcpu->arch.msr & MSR_IS); |