aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/44x_tlb.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kvm/44x_tlb.c')
-rw-r--r--arch/powerpc/kvm/44x_tlb.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/powerpc/kvm/44x_tlb.c b/arch/powerpc/kvm/44x_tlb.c
index 8f9c09cbb83..e8ed22f28ea 100644
--- a/arch/powerpc/kvm/44x_tlb.c
+++ b/arch/powerpc/kvm/44x_tlb.c
@@ -269,15 +269,19 @@ void kvmppc_mmu_destroy(struct kvm_vcpu *vcpu)
269 * Caller must ensure that the specified guest TLB entry is safe to insert into 269 * Caller must ensure that the specified guest TLB entry is safe to insert into
270 * the shadow TLB. 270 * the shadow TLB.
271 */ 271 */
272void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gpa_t gpaddr, u64 asid, 272void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gpa_t gpaddr,
273 u32 flags, u32 max_bytes, unsigned int gtlb_index) 273 unsigned int gtlb_index)
274{ 274{
275 struct kvmppc_44x_tlbe stlbe; 275 struct kvmppc_44x_tlbe stlbe;
276 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu); 276 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
277 struct kvmppc_44x_tlbe *gtlbe = &vcpu_44x->guest_tlb[gtlb_index];
277 struct kvmppc_44x_shadow_ref *ref; 278 struct kvmppc_44x_shadow_ref *ref;
278 struct page *new_page; 279 struct page *new_page;
279 hpa_t hpaddr; 280 hpa_t hpaddr;
280 gfn_t gfn; 281 gfn_t gfn;
282 u32 asid = gtlbe->tid;
283 u32 flags = gtlbe->word2;
284 u32 max_bytes = get_tlb_bytes(gtlbe);
281 unsigned int victim; 285 unsigned int victim;
282 286
283 /* Select TLB entry to clobber. Indirectly guard against races with the TLB 287 /* Select TLB entry to clobber. Indirectly guard against races with the TLB
@@ -448,10 +452,8 @@ int kvmppc_44x_emul_tlbwe(struct kvm_vcpu *vcpu, u8 ra, u8 rs, u8 ws)
448 } 452 }
449 453
450 if (tlbe_is_host_safe(vcpu, tlbe)) { 454 if (tlbe_is_host_safe(vcpu, tlbe)) {
451 u64 asid;
452 gva_t eaddr; 455 gva_t eaddr;
453 gpa_t gpaddr; 456 gpa_t gpaddr;
454 u32 flags;
455 u32 bytes; 457 u32 bytes;
456 458
457 eaddr = get_tlb_eaddr(tlbe); 459 eaddr = get_tlb_eaddr(tlbe);
@@ -462,10 +464,7 @@ int kvmppc_44x_emul_tlbwe(struct kvm_vcpu *vcpu, u8 ra, u8 rs, u8 ws)
462 eaddr &= ~(bytes - 1); 464 eaddr &= ~(bytes - 1);
463 gpaddr &= ~(bytes - 1); 465 gpaddr &= ~(bytes - 1);
464 466
465 asid = (tlbe->word0 & PPC44x_TLB_TS) | tlbe->tid; 467 kvmppc_mmu_map(vcpu, eaddr, gpaddr, gtlb_index);
466 flags = tlbe->word2 & 0xffff;
467
468 kvmppc_mmu_map(vcpu, eaddr, gpaddr, asid, flags, bytes, gtlb_index);
469 } 468 }
470 469
471 KVMTRACE_5D(GTLB_WRITE, vcpu, gtlb_index, tlbe->tid, tlbe->word0, 470 KVMTRACE_5D(GTLB_WRITE, vcpu, gtlb_index, tlbe->tid, tlbe->word0,