Lines Matching refs:pte
513 struct pasid_entry *pte; in intel_pasid_tear_down_entry() local
516 pte = intel_pasid_get_entry(dev, pasid); in intel_pasid_tear_down_entry()
517 if (WARN_ON(!pte)) in intel_pasid_tear_down_entry()
520 if (!pasid_pte_is_present(pte)) in intel_pasid_tear_down_entry()
523 did = pasid_get_domain_id(pte); in intel_pasid_tear_down_entry()
524 pgtt = pasid_pte_get_pgtt(pte); in intel_pasid_tear_down_entry()
529 clflush_cache_range(pte, sizeof(*pte)); in intel_pasid_tear_down_entry()
548 struct pasid_entry *pte, in pasid_flush_caches() argument
552 clflush_cache_range(pte, sizeof(*pte)); in pasid_flush_caches()
562 static inline int pasid_enable_wpe(struct pasid_entry *pte) in pasid_enable_wpe() argument
573 pasid_set_wpe(pte); in pasid_enable_wpe()
586 struct pasid_entry *pte; in intel_pasid_setup_first_level() local
594 pte = intel_pasid_get_entry(dev, pasid); in intel_pasid_setup_first_level()
595 if (WARN_ON(!pte)) in intel_pasid_setup_first_level()
599 if (pasid_pte_is_present(pte)) in intel_pasid_setup_first_level()
602 pasid_clear_entry(pte); in intel_pasid_setup_first_level()
605 pasid_set_flptr(pte, (u64)__pa(pgd)); in intel_pasid_setup_first_level()
612 pasid_set_sre(pte); in intel_pasid_setup_first_level()
613 if (pasid_enable_wpe(pte)) in intel_pasid_setup_first_level()
620 pasid_set_flpm(pte, 1); in intel_pasid_setup_first_level()
623 pasid_clear_entry(pte); in intel_pasid_setup_first_level()
629 pasid_set_pgsnp(pte); in intel_pasid_setup_first_level()
631 pasid_set_domain_id(pte, did); in intel_pasid_setup_first_level()
632 pasid_set_address_width(pte, iommu->agaw); in intel_pasid_setup_first_level()
633 pasid_set_page_snoop(pte, !!ecap_smpwc(iommu->ecap)); in intel_pasid_setup_first_level()
636 pasid_set_translation_type(pte, PASID_ENTRY_PGTT_FL_ONLY); in intel_pasid_setup_first_level()
637 pasid_set_present(pte); in intel_pasid_setup_first_level()
638 pasid_flush_caches(iommu, pte, pasid, did); in intel_pasid_setup_first_level()
669 struct pasid_entry *pte; in intel_pasid_setup_second_level() local
695 pte = intel_pasid_get_entry(dev, pasid); in intel_pasid_setup_second_level()
696 if (!pte) { in intel_pasid_setup_second_level()
702 if (pasid_pte_is_present(pte)) in intel_pasid_setup_second_level()
705 pasid_clear_entry(pte); in intel_pasid_setup_second_level()
706 pasid_set_domain_id(pte, did); in intel_pasid_setup_second_level()
707 pasid_set_slptr(pte, pgd_val); in intel_pasid_setup_second_level()
708 pasid_set_address_width(pte, agaw); in intel_pasid_setup_second_level()
709 pasid_set_translation_type(pte, PASID_ENTRY_PGTT_SL_ONLY); in intel_pasid_setup_second_level()
710 pasid_set_fault_enable(pte); in intel_pasid_setup_second_level()
711 pasid_set_page_snoop(pte, !!ecap_smpwc(iommu->ecap)); in intel_pasid_setup_second_level()
714 pasid_set_pgsnp(pte); in intel_pasid_setup_second_level()
721 pasid_set_sre(pte); in intel_pasid_setup_second_level()
722 pasid_set_present(pte); in intel_pasid_setup_second_level()
723 pasid_flush_caches(iommu, pte, pasid, did); in intel_pasid_setup_second_level()
736 struct pasid_entry *pte; in intel_pasid_setup_pass_through() local
738 pte = intel_pasid_get_entry(dev, pasid); in intel_pasid_setup_pass_through()
739 if (!pte) { in intel_pasid_setup_pass_through()
745 if (pasid_pte_is_present(pte)) in intel_pasid_setup_pass_through()
748 pasid_clear_entry(pte); in intel_pasid_setup_pass_through()
749 pasid_set_domain_id(pte, did); in intel_pasid_setup_pass_through()
750 pasid_set_address_width(pte, iommu->agaw); in intel_pasid_setup_pass_through()
751 pasid_set_translation_type(pte, PASID_ENTRY_PGTT_PT); in intel_pasid_setup_pass_through()
752 pasid_set_fault_enable(pte); in intel_pasid_setup_pass_through()
753 pasid_set_page_snoop(pte, !!ecap_smpwc(iommu->ecap)); in intel_pasid_setup_pass_through()
759 pasid_set_sre(pte); in intel_pasid_setup_pass_through()
760 pasid_set_present(pte); in intel_pasid_setup_pass_through()
761 pasid_flush_caches(iommu, pte, pasid, did); in intel_pasid_setup_pass_through()
767 intel_pasid_setup_bind_data(struct intel_iommu *iommu, struct pasid_entry *pte, in intel_pasid_setup_bind_data() argument
783 pasid_set_sre(pte); in intel_pasid_setup_bind_data()
786 pasid_set_wpe(pte); in intel_pasid_setup_bind_data()
795 pasid_set_eafe(pte); in intel_pasid_setup_bind_data()
830 struct pasid_entry *pte; in intel_pasid_setup_nested() local
849 pte = intel_pasid_get_entry(dev, pasid); in intel_pasid_setup_nested()
850 if (WARN_ON(!pte)) in intel_pasid_setup_nested()
857 if (pasid_pte_is_present(pte)) in intel_pasid_setup_nested()
860 pasid_clear_entry(pte); in intel_pasid_setup_nested()
877 pasid_set_flpm(pte, 1); in intel_pasid_setup_nested()
881 pasid_set_flpm(pte, 0); in intel_pasid_setup_nested()
896 pasid_set_flptr(pte, (uintptr_t)gpgd); in intel_pasid_setup_nested()
898 ret = intel_pasid_setup_bind_data(iommu, pte, pasid_data); in intel_pasid_setup_nested()
911 pasid_set_slptr(pte, pgd_val); in intel_pasid_setup_nested()
912 pasid_set_fault_enable(pte); in intel_pasid_setup_nested()
915 pasid_set_domain_id(pte, did); in intel_pasid_setup_nested()
917 pasid_set_address_width(pte, agaw); in intel_pasid_setup_nested()
918 pasid_set_page_snoop(pte, !!ecap_smpwc(iommu->ecap)); in intel_pasid_setup_nested()
920 pasid_set_translation_type(pte, PASID_ENTRY_PGTT_NESTED); in intel_pasid_setup_nested()
921 pasid_set_present(pte); in intel_pasid_setup_nested()
922 pasid_flush_caches(iommu, pte, pasid, did); in intel_pasid_setup_nested()