Lines Matching refs:stt

66 	struct kvmppc_spapr_tce_table *stt;  in kvmppc_find_table()  local
68 list_for_each_entry_lockless(stt, &kvm->arch.spapr_tce_tables, list) in kvmppc_find_table()
69 if (stt->liobn == liobn) in kvmppc_find_table()
70 return stt; in kvmppc_find_table()
101 static long kvmppc_rm_tce_validate(struct kvmppc_spapr_tce_table *stt, in kvmppc_rm_tce_validate() argument
113 if (iommu_tce_check_gpa(stt->page_shift, gpa)) in kvmppc_rm_tce_validate()
116 if (kvmppc_rm_tce_to_ua(stt->kvm, tce, &ua)) in kvmppc_rm_tce_validate()
119 list_for_each_entry_lockless(stit, &stt->iommu_tables, next) { in kvmppc_rm_tce_validate()
124 mem = mm_iommu_lookup_rm(stt->kvm->mm, ua, 1ULL << shift); in kvmppc_rm_tce_validate()
167 static void kvmppc_rm_tce_put(struct kvmppc_spapr_tce_table *stt, in kvmppc_rm_tce_put() argument
173 idx -= stt->offset; in kvmppc_rm_tce_put()
174 page = stt->pages[idx / TCES_PER_PAGE]; in kvmppc_rm_tce_put()
191 static long kvmppc_rm_ioba_validate(struct kvmppc_spapr_tce_table *stt, in kvmppc_rm_ioba_validate() argument
195 unsigned long ret = kvmppc_ioba_validate(stt, ioba, npages); in kvmppc_rm_ioba_validate()
206 idx = (ioba >> stt->page_shift) - stt->offset; in kvmppc_rm_ioba_validate()
211 if (!stt->pages[i]) in kvmppc_rm_ioba_validate()
303 struct kvmppc_spapr_tce_table *stt, struct iommu_table *tbl, in kvmppc_rm_tce_iommu_unmap() argument
307 unsigned long subpages = 1ULL << (stt->page_shift - tbl->it_page_shift); in kvmppc_rm_tce_iommu_unmap()
362 struct kvmppc_spapr_tce_table *stt, struct iommu_table *tbl, in kvmppc_rm_tce_iommu_map() argument
367 unsigned long subpages = 1ULL << (stt->page_shift - tbl->it_page_shift); in kvmppc_rm_tce_iommu_map()
385 struct kvmppc_spapr_tce_table *stt; in kvmppc_rm_h_put_tce() local
398 stt = kvmppc_find_table(vcpu->kvm, liobn); in kvmppc_rm_h_put_tce()
399 if (!stt) in kvmppc_rm_h_put_tce()
402 ret = kvmppc_rm_ioba_validate(stt, ioba, 1, tce == 0); in kvmppc_rm_h_put_tce()
406 ret = kvmppc_rm_tce_validate(stt, tce); in kvmppc_rm_h_put_tce()
414 entry = ioba >> stt->page_shift; in kvmppc_rm_h_put_tce()
416 list_for_each_entry_lockless(stit, &stt->iommu_tables, next) { in kvmppc_rm_h_put_tce()
418 ret = kvmppc_rm_tce_iommu_unmap(vcpu->kvm, stt, in kvmppc_rm_h_put_tce()
421 ret = kvmppc_rm_tce_iommu_map(vcpu->kvm, stt, in kvmppc_rm_h_put_tce()
432 kvmppc_rm_tce_put(stt, entry, tce); in kvmppc_rm_h_put_tce()
485 struct kvmppc_spapr_tce_table *stt; in kvmppc_rm_h_put_tce_indirect() local
502 stt = kvmppc_find_table(vcpu->kvm, liobn); in kvmppc_rm_h_put_tce_indirect()
503 if (!stt) in kvmppc_rm_h_put_tce_indirect()
506 entry = ioba >> stt->page_shift; in kvmppc_rm_h_put_tce_indirect()
517 ret = kvmppc_rm_ioba_validate(stt, ioba, npages, false); in kvmppc_rm_h_put_tce_indirect()
558 ret = kvmppc_rm_tce_validate(stt, tce); in kvmppc_rm_h_put_tce_indirect()
572 list_for_each_entry_lockless(stit, &stt->iommu_tables, next) { in kvmppc_rm_h_put_tce_indirect()
573 ret = kvmppc_rm_tce_iommu_map(vcpu->kvm, stt, in kvmppc_rm_h_put_tce_indirect()
584 kvmppc_rm_tce_put(stt, entry + i, tce); in kvmppc_rm_h_put_tce_indirect()
588 list_for_each_entry_lockless(stit, &stt->iommu_tables, next) in kvmppc_rm_h_put_tce_indirect()
601 struct kvmppc_spapr_tce_table *stt; in kvmppc_rm_h_stuff_tce() local
609 stt = kvmppc_find_table(vcpu->kvm, liobn); in kvmppc_rm_h_stuff_tce()
610 if (!stt) in kvmppc_rm_h_stuff_tce()
613 ret = kvmppc_rm_ioba_validate(stt, ioba, npages, tce_value == 0); in kvmppc_rm_h_stuff_tce()
621 list_for_each_entry_lockless(stit, &stt->iommu_tables, next) { in kvmppc_rm_h_stuff_tce()
622 unsigned long entry = ioba >> stt->page_shift; in kvmppc_rm_h_stuff_tce()
625 ret = kvmppc_rm_tce_iommu_unmap(vcpu->kvm, stt, in kvmppc_rm_h_stuff_tce()
639 for (i = 0; i < npages; ++i, ioba += (1ULL << stt->page_shift)) in kvmppc_rm_h_stuff_tce()
640 kvmppc_rm_tce_put(stt, ioba >> stt->page_shift, tce_value); in kvmppc_rm_h_stuff_tce()
643 list_for_each_entry_lockless(stit, &stt->iommu_tables, next) in kvmppc_rm_h_stuff_tce()
644 iommu_tce_kill_rm(stit->tbl, ioba >> stt->page_shift, npages); in kvmppc_rm_h_stuff_tce()
653 struct kvmppc_spapr_tce_table *stt; in kvmppc_h_get_tce() local
659 stt = kvmppc_find_table(vcpu->kvm, liobn); in kvmppc_h_get_tce()
660 if (!stt) in kvmppc_h_get_tce()
663 ret = kvmppc_ioba_validate(stt, ioba, 1); in kvmppc_h_get_tce()
667 idx = (ioba >> stt->page_shift) - stt->offset; in kvmppc_h_get_tce()
668 page = stt->pages[idx / TCES_PER_PAGE]; in kvmppc_h_get_tce()