Lines Matching full:ua
33 u64 ua; /* userspace address */ member
39 * We need to convert ua to hpa in real mode. Make it
56 static long mm_iommu_do_alloc(struct mm_struct *mm, unsigned long ua, in mm_iommu_do_alloc() argument
88 * we use @ua and @entries natural alignment to allow IOMMU pages in mm_iommu_do_alloc()
91 mem->pageshift = __ffs(ua | (entries << PAGE_SHIFT)); in mm_iommu_do_alloc()
106 ret = pin_user_pages(ua + (entry << PAGE_SHIFT), n, in mm_iommu_do_alloc()
127 mem->ua = ua; in mm_iommu_do_alloc()
134 if ((mem2->ua < (ua + (entries << PAGE_SHIFT))) && in mm_iommu_do_alloc()
135 (ua < (mem2->ua + in mm_iommu_do_alloc()
185 long mm_iommu_new(struct mm_struct *mm, unsigned long ua, unsigned long entries, in mm_iommu_new() argument
188 return mm_iommu_do_alloc(mm, ua, entries, MM_IOMMU_TABLE_INVALID_HPA, in mm_iommu_new()
193 long mm_iommu_newdev(struct mm_struct *mm, unsigned long ua, in mm_iommu_newdev() argument
197 return mm_iommu_do_alloc(mm, ua, entries, dev_hpa, pmem); in mm_iommu_newdev()
288 unsigned long ua, unsigned long size) in mm_iommu_lookup() argument
293 if ((mem->ua <= ua) && in mm_iommu_lookup()
294 (ua + size <= mem->ua + in mm_iommu_lookup()
306 unsigned long ua, unsigned long size) in mm_iommu_lookup_rm() argument
312 if ((mem->ua <= ua) && in mm_iommu_lookup_rm()
313 (ua + size <= mem->ua + in mm_iommu_lookup_rm()
324 unsigned long ua, unsigned long entries) in mm_iommu_get() argument
331 if ((mem->ua == ua) && (mem->entries == entries)) { in mm_iommu_get()
345 unsigned long ua, unsigned int pageshift, unsigned long *hpa) in mm_iommu_ua_to_hpa() argument
347 const long entry = (ua - mem->ua) >> PAGE_SHIFT; in mm_iommu_ua_to_hpa()
357 *hpa = mem->dev_hpa + (ua - mem->ua); in mm_iommu_ua_to_hpa()
362 *hpa = (*va & MM_IOMMU_TABLE_GROUP_PAGE_MASK) | (ua & ~PAGE_MASK); in mm_iommu_ua_to_hpa()
369 unsigned long ua, unsigned int pageshift, unsigned long *hpa) in mm_iommu_ua_to_hpa_rm() argument
371 const long entry = (ua - mem->ua) >> PAGE_SHIFT; in mm_iommu_ua_to_hpa_rm()
381 *hpa = mem->dev_hpa + (ua - mem->ua); in mm_iommu_ua_to_hpa_rm()
389 *hpa = (*pa & MM_IOMMU_TABLE_GROUP_PAGE_MASK) | (ua & ~PAGE_MASK); in mm_iommu_ua_to_hpa_rm()
394 extern void mm_iommu_ua_mark_dirty_rm(struct mm_struct *mm, unsigned long ua) in mm_iommu_ua_mark_dirty_rm() argument
401 mem = mm_iommu_lookup_rm(mm, ua, PAGE_SIZE); in mm_iommu_ua_mark_dirty_rm()
408 entry = (ua - mem->ua) >> PAGE_SHIFT; in mm_iommu_ua_mark_dirty_rm()