• Home
  • Raw
  • Download

Lines Matching refs:pte

174 static inline void dma_clear_pte(struct dma_pte *pte)  in dma_clear_pte()  argument
176 pte->val = 0; in dma_clear_pte()
179 static inline void dma_set_pte_readable(struct dma_pte *pte) in dma_set_pte_readable() argument
181 pte->val |= DMA_PTE_READ; in dma_set_pte_readable()
184 static inline void dma_set_pte_writable(struct dma_pte *pte) in dma_set_pte_writable() argument
186 pte->val |= DMA_PTE_WRITE; in dma_set_pte_writable()
189 static inline void dma_set_pte_prot(struct dma_pte *pte, unsigned long prot) in dma_set_pte_prot() argument
191 pte->val = (pte->val & ~3) | (prot & 3); in dma_set_pte_prot()
194 static inline u64 dma_pte_addr(struct dma_pte *pte) in dma_pte_addr() argument
196 return (pte->val & VTD_PAGE_MASK); in dma_pte_addr()
199 static inline void dma_set_pte_addr(struct dma_pte *pte, u64 addr) in dma_set_pte_addr() argument
201 pte->val |= (addr & VTD_PAGE_MASK); in dma_set_pte_addr()
204 static inline bool dma_pte_present(struct dma_pte *pte) in dma_pte_present() argument
206 return (pte->val & 3) != 0; in dma_pte_present()
606 struct dma_pte *parent, *pte = NULL; in addr_to_dma_pte() local
621 pte = &parent[offset]; in addr_to_dma_pte()
625 if (!dma_pte_present(pte)) { in addr_to_dma_pte()
634 dma_set_pte_addr(pte, virt_to_phys(tmp_page)); in addr_to_dma_pte()
639 dma_set_pte_readable(pte); in addr_to_dma_pte()
640 dma_set_pte_writable(pte); in addr_to_dma_pte()
641 domain_flush_cache(domain, pte, sizeof(*pte)); in addr_to_dma_pte()
643 parent = phys_to_virt(dma_pte_addr(pte)); in addr_to_dma_pte()
648 return pte; in addr_to_dma_pte()
655 struct dma_pte *parent, *pte = NULL; in dma_addr_level_pte() local
662 pte = &parent[offset]; in dma_addr_level_pte()
664 return pte; in dma_addr_level_pte()
666 if (!dma_pte_present(pte)) in dma_addr_level_pte()
668 parent = phys_to_virt(dma_pte_addr(pte)); in dma_addr_level_pte()
677 struct dma_pte *pte = NULL; in dma_pte_clear_one() local
680 pte = dma_addr_level_pte(domain, addr, 1); in dma_pte_clear_one()
682 if (pte) { in dma_pte_clear_one()
683 dma_clear_pte(pte); in dma_pte_clear_one()
684 domain_flush_cache(domain, pte, sizeof(*pte)); in dma_pte_clear_one()
711 struct dma_pte *pte; in dma_pte_free_pagetable() local
727 pte = dma_addr_level_pte(domain, tmp, level); in dma_pte_free_pagetable()
728 if (pte) { in dma_pte_free_pagetable()
730 phys_to_virt(dma_pte_addr(pte))); in dma_pte_free_pagetable()
731 dma_clear_pte(pte); in dma_pte_free_pagetable()
732 domain_flush_cache(domain, pte, sizeof(*pte)); in dma_pte_free_pagetable()
1638 struct dma_pte *pte; in domain_page_mapping() local
1651 pte = addr_to_dma_pte(domain, iova + VTD_PAGE_SIZE * index); in domain_page_mapping()
1652 if (!pte) in domain_page_mapping()
1657 BUG_ON(dma_pte_addr(pte)); in domain_page_mapping()
1658 dma_set_pte_addr(pte, start_pfn << VTD_PAGE_SHIFT); in domain_page_mapping()
1659 dma_set_pte_prot(pte, prot); in domain_page_mapping()
1660 domain_flush_cache(domain, pte, sizeof(*pte)); in domain_page_mapping()
3123 struct dma_pte *pte; in intel_iommu_iova_to_phys() local
3126 pte = addr_to_dma_pte(dmar_domain, iova); in intel_iommu_iova_to_phys()
3127 if (pte) in intel_iommu_iova_to_phys()
3128 phys = dma_pte_addr(pte); in intel_iommu_iova_to_phys()