1 // SPDX-License-Identifier: GPL-2.0
3 * intel-pasid.c - PASID idr, table and entry manipulation
5 * Copyright (C) 2018 Intel Corporation
10 #define pr_fmt(fmt) "DMAR: " fmt
12 #include <linux/bitops.h>
13 #include <linux/cpufeature.h>
14 #include <linux/dmar.h>
15 #include <linux/intel-iommu.h>
16 #include <linux/iommu.h>
17 #include <linux/memory.h>
18 #include <linux/pci.h>
19 #include <linux/pci-ats.h>
20 #include <linux/spinlock.h>
25 * Intel IOMMU system wide PASID name space:
27 u32 intel_pasid_max_id = PASID_MAX;
29 int vcmd_alloc_pasid(struct intel_iommu *iommu, u32 *pasid)
36 raw_spin_lock_irqsave(&iommu->register_lock, flags);
37 dmar_writeq(iommu->reg + DMAR_VCMD_REG, VCMD_CMD_ALLOC);
38 IOMMU_WAIT_OP(iommu, DMAR_VCRSP_REG, dmar_readq,
39 !(res & VCMD_VRSP_IP), res);
40 raw_spin_unlock_irqrestore(&iommu->register_lock, flags);
42 status_code = VCMD_VRSP_SC(res);
43 switch (status_code) {
44 case VCMD_VRSP_SC_SUCCESS:
45 *pasid = VCMD_VRSP_RESULT_PASID(res);
47 case VCMD_VRSP_SC_NO_PASID_AVAIL:
48 pr_info("IOMMU: %s: No PASID available\n", iommu->name);
53 pr_warn("IOMMU: %s: Unexpected error code %d\n",
54 iommu->name, status_code);
60 void vcmd_free_pasid(struct intel_iommu *iommu, u32 pasid)
66 raw_spin_lock_irqsave(&iommu->register_lock, flags);
67 dmar_writeq(iommu->reg + DMAR_VCMD_REG,
68 VCMD_CMD_OPERAND(pasid) | VCMD_CMD_FREE);
69 IOMMU_WAIT_OP(iommu, DMAR_VCRSP_REG, dmar_readq,
70 !(res & VCMD_VRSP_IP), res);
71 raw_spin_unlock_irqrestore(&iommu->register_lock, flags);
73 status_code = VCMD_VRSP_SC(res);
74 switch (status_code) {
75 case VCMD_VRSP_SC_SUCCESS:
77 case VCMD_VRSP_SC_INVALID_PASID:
78 pr_info("IOMMU: %s: Invalid PASID\n", iommu->name);
81 pr_warn("IOMMU: %s: Unexpected error code %d\n",
82 iommu->name, status_code);
87 * Per device pasid table management:
90 device_attach_pasid_table(struct device_domain_info *info,
91 struct pasid_table *pasid_table)
93 info->pasid_table = pasid_table;
94 list_add(&info->table, &pasid_table->dev);
98 device_detach_pasid_table(struct device_domain_info *info,
99 struct pasid_table *pasid_table)
101 info->pasid_table = NULL;
102 list_del(&info->table);
105 struct pasid_table_opaque {
106 struct pasid_table **pasid_table;
112 static int search_pasid_table(struct device_domain_info *info, void *opaque)
114 struct pasid_table_opaque *data = opaque;
116 if (info->iommu->segment == data->segment &&
117 info->bus == data->bus &&
118 info->devfn == data->devfn &&
120 *data->pasid_table = info->pasid_table;
127 static int get_alias_pasid_table(struct pci_dev *pdev, u16 alias, void *opaque)
129 struct pasid_table_opaque *data = opaque;
131 data->segment = pci_domain_nr(pdev->bus);
132 data->bus = PCI_BUS_NUM(alias);
133 data->devfn = alias & 0xff;
135 return for_each_device_domain(&search_pasid_table, data);
139 * Allocate a pasid table for @dev. It should be called in a
140 * single-thread context.
142 int intel_pasid_alloc_table(struct device *dev)
144 struct device_domain_info *info;
145 struct pasid_table *pasid_table;
146 struct pasid_table_opaque data;
153 info = get_domain_info(dev);
154 if (WARN_ON(!info || !dev_is_pci(dev) || info->pasid_table))
157 /* DMA alias device already has a pasid table, use it: */
158 data.pasid_table = &pasid_table;
159 ret = pci_for_each_dma_alias(to_pci_dev(dev),
160 &get_alias_pasid_table, &data);
164 pasid_table = kzalloc(sizeof(*pasid_table), GFP_KERNEL);
167 INIT_LIST_HEAD(&pasid_table->dev);
169 if (info->pasid_supported)
170 max_pasid = min_t(u32, pci_max_pasids(to_pci_dev(dev)),
173 size = max_pasid >> (PASID_PDE_SHIFT - 3);
174 order = size ? get_order(size) : 0;
175 pages = alloc_pages_node(info->iommu->node,
176 GFP_KERNEL | __GFP_ZERO, order);
182 pasid_table->table = page_address(pages);
183 pasid_table->order = order;
184 pasid_table->max_pasid = 1 << (order + PAGE_SHIFT + 3);
187 device_attach_pasid_table(info, pasid_table);
192 void intel_pasid_free_table(struct device *dev)
194 struct device_domain_info *info;
195 struct pasid_table *pasid_table;
196 struct pasid_dir_entry *dir;
197 struct pasid_entry *table;
200 info = get_domain_info(dev);
201 if (!info || !dev_is_pci(dev) || !info->pasid_table)
204 pasid_table = info->pasid_table;
205 device_detach_pasid_table(info, pasid_table);
207 if (!list_empty(&pasid_table->dev))
210 /* Free scalable mode PASID directory tables: */
211 dir = pasid_table->table;
212 max_pde = pasid_table->max_pasid >> PASID_PDE_SHIFT;
213 for (i = 0; i < max_pde; i++) {
214 table = get_pasid_table_from_pde(&dir[i]);
215 free_pgtable_page(table);
218 free_pages((unsigned long)pasid_table->table, pasid_table->order);
222 struct pasid_table *intel_pasid_get_table(struct device *dev)
224 struct device_domain_info *info;
226 info = get_domain_info(dev);
230 return info->pasid_table;
233 static int intel_pasid_get_dev_max_id(struct device *dev)
235 struct device_domain_info *info;
237 info = get_domain_info(dev);
238 if (!info || !info->pasid_table)
241 return info->pasid_table->max_pasid;
244 static struct pasid_entry *intel_pasid_get_entry(struct device *dev, u32 pasid)
246 struct device_domain_info *info;
247 struct pasid_table *pasid_table;
248 struct pasid_dir_entry *dir;
249 struct pasid_entry *entries;
250 int dir_index, index;
252 pasid_table = intel_pasid_get_table(dev);
253 if (WARN_ON(!pasid_table || pasid >= intel_pasid_get_dev_max_id(dev)))
256 dir = pasid_table->table;
257 info = get_domain_info(dev);
258 dir_index = pasid >> PASID_PDE_SHIFT;
259 index = pasid & PASID_PTE_MASK;
262 entries = get_pasid_table_from_pde(&dir[dir_index]);
264 entries = alloc_pgtable_page(info->iommu->node);
269 * The pasid directory table entry won't be freed after
270 * allocation. No worry about the race with free and
271 * clear. However, this entry might be populated by others
272 * while we are preparing it. Use theirs with a retry.
274 if (cmpxchg64(&dir[dir_index].val, 0ULL,
275 (u64)virt_to_phys(entries) | PASID_PTE_PRESENT)) {
276 free_pgtable_page(entries);
281 return &entries[index];
285 * Interfaces for PASID table entry manipulation:
287 static inline void pasid_clear_entry(struct pasid_entry *pe)
289 WRITE_ONCE(pe->val[0], 0);
290 WRITE_ONCE(pe->val[1], 0);
291 WRITE_ONCE(pe->val[2], 0);
292 WRITE_ONCE(pe->val[3], 0);
293 WRITE_ONCE(pe->val[4], 0);
294 WRITE_ONCE(pe->val[5], 0);
295 WRITE_ONCE(pe->val[6], 0);
296 WRITE_ONCE(pe->val[7], 0);
299 static inline void pasid_clear_entry_with_fpd(struct pasid_entry *pe)
301 WRITE_ONCE(pe->val[0], PASID_PTE_FPD);
302 WRITE_ONCE(pe->val[1], 0);
303 WRITE_ONCE(pe->val[2], 0);
304 WRITE_ONCE(pe->val[3], 0);
305 WRITE_ONCE(pe->val[4], 0);
306 WRITE_ONCE(pe->val[5], 0);
307 WRITE_ONCE(pe->val[6], 0);
308 WRITE_ONCE(pe->val[7], 0);
312 intel_pasid_clear_entry(struct device *dev, u32 pasid, bool fault_ignore)
314 struct pasid_entry *pe;
316 pe = intel_pasid_get_entry(dev, pasid);
320 if (fault_ignore && pasid_pte_is_present(pe))
321 pasid_clear_entry_with_fpd(pe);
323 pasid_clear_entry(pe);
326 static inline void pasid_set_bits(u64 *ptr, u64 mask, u64 bits)
330 old = READ_ONCE(*ptr);
331 WRITE_ONCE(*ptr, (old & ~mask) | bits);
335 * Setup the DID(Domain Identifier) field (Bit 64~79) of scalable mode
339 pasid_set_domain_id(struct pasid_entry *pe, u64 value)
341 pasid_set_bits(&pe->val[1], GENMASK_ULL(15, 0), value);
345 * Get domain ID value of a scalable mode PASID entry.
348 pasid_get_domain_id(struct pasid_entry *pe)
350 return (u16)(READ_ONCE(pe->val[1]) & GENMASK_ULL(15, 0));
354 * Setup the SLPTPTR(Second Level Page Table Pointer) field (Bit 12~63)
355 * of a scalable mode PASID entry.
358 pasid_set_slptr(struct pasid_entry *pe, u64 value)
360 pasid_set_bits(&pe->val[0], VTD_PAGE_MASK, value);
364 * Setup the AW(Address Width) field (Bit 2~4) of a scalable mode PASID
368 pasid_set_address_width(struct pasid_entry *pe, u64 value)
370 pasid_set_bits(&pe->val[0], GENMASK_ULL(4, 2), value << 2);
374 * Setup the PGTT(PASID Granular Translation Type) field (Bit 6~8)
375 * of a scalable mode PASID entry.
378 pasid_set_translation_type(struct pasid_entry *pe, u64 value)
380 pasid_set_bits(&pe->val[0], GENMASK_ULL(8, 6), value << 6);
384 * Enable fault processing by clearing the FPD(Fault Processing
385 * Disable) field (Bit 1) of a scalable mode PASID entry.
387 static inline void pasid_set_fault_enable(struct pasid_entry *pe)
389 pasid_set_bits(&pe->val[0], 1 << 1, 0);
393 * Setup the SRE(Supervisor Request Enable) field (Bit 128) of a
394 * scalable mode PASID entry.
396 static inline void pasid_set_sre(struct pasid_entry *pe)
398 pasid_set_bits(&pe->val[2], 1 << 0, 1);
402 * Setup the WPE(Write Protect Enable) field (Bit 132) of a
403 * scalable mode PASID entry.
405 static inline void pasid_set_wpe(struct pasid_entry *pe)
407 pasid_set_bits(&pe->val[2], 1 << 4, 1 << 4);
411 * Setup the P(Present) field (Bit 0) of a scalable mode PASID
414 static inline void pasid_set_present(struct pasid_entry *pe)
416 pasid_set_bits(&pe->val[0], 1 << 0, 1);
420 * Setup Page Walk Snoop bit (Bit 87) of a scalable mode PASID
423 static inline void pasid_set_page_snoop(struct pasid_entry *pe, bool value)
425 pasid_set_bits(&pe->val[1], 1 << 23, value << 23);
429 * Setup the Page Snoop (PGSNP) field (Bit 88) of a scalable mode
433 pasid_set_pgsnp(struct pasid_entry *pe)
435 pasid_set_bits(&pe->val[1], 1ULL << 24, 1ULL << 24);
439 * Setup the First Level Page table Pointer field (Bit 140~191)
440 * of a scalable mode PASID entry.
443 pasid_set_flptr(struct pasid_entry *pe, u64 value)
445 pasid_set_bits(&pe->val[2], VTD_PAGE_MASK, value);
449 * Setup the First Level Paging Mode field (Bit 130~131) of a
450 * scalable mode PASID entry.
453 pasid_set_flpm(struct pasid_entry *pe, u64 value)
455 pasid_set_bits(&pe->val[2], GENMASK_ULL(3, 2), value << 2);
459 * Setup the Extended Access Flag Enable (EAFE) field (Bit 135)
460 * of a scalable mode PASID entry.
463 pasid_set_eafe(struct pasid_entry *pe)
465 pasid_set_bits(&pe->val[2], 1 << 7, 1 << 7);
469 pasid_cache_invalidation_with_pasid(struct intel_iommu *iommu,
474 desc.qw0 = QI_PC_DID(did) | QI_PC_GRAN(QI_PC_PASID_SEL) |
475 QI_PC_PASID(pasid) | QI_PC_TYPE;
480 qi_submit_sync(iommu, &desc, 1, 0);
484 devtlb_invalidation_with_pasid(struct intel_iommu *iommu,
485 struct device *dev, u32 pasid)
487 struct device_domain_info *info;
488 u16 sid, qdep, pfsid;
490 info = get_domain_info(dev);
491 if (!info || !info->ats_enabled)
494 sid = info->bus << 8 | info->devfn;
495 qdep = info->ats_qdep;
499 * When PASID 0 is used, it indicates RID2PASID(DMA request w/o PASID),
500 * devTLB flush w/o PASID should be used. For non-zero PASID under
501 * SVA usage, device could do DMA with multiple PASIDs. It is more
502 * efficient to flush devTLB specific to the PASID.
504 if (pasid == PASID_RID2PASID)
505 qi_flush_dev_iotlb(iommu, sid, pfsid, qdep, 0, 64 - VTD_PAGE_SHIFT);
507 qi_flush_dev_iotlb_pasid(iommu, sid, pfsid, pasid, qdep, 0, 64 - VTD_PAGE_SHIFT);
510 void intel_pasid_tear_down_entry(struct intel_iommu *iommu, struct device *dev,
511 u32 pasid, bool fault_ignore)
513 struct pasid_entry *pte;
516 pte = intel_pasid_get_entry(dev, pasid);
520 if (!(pte->val[0] & PASID_PTE_PRESENT))
523 did = pasid_get_domain_id(pte);
524 intel_pasid_clear_entry(dev, pasid, fault_ignore);
526 if (!ecap_coherent(iommu->ecap))
527 clflush_cache_range(pte, sizeof(*pte));
529 pasid_cache_invalidation_with_pasid(iommu, did, pasid);
530 qi_flush_piotlb(iommu, did, pasid, 0, -1, 0);
532 /* Device IOTLB doesn't need to be flushed in caching mode. */
533 if (!cap_caching_mode(iommu->cap))
534 devtlb_invalidation_with_pasid(iommu, dev, pasid);
537 static void pasid_flush_caches(struct intel_iommu *iommu,
538 struct pasid_entry *pte,
541 if (!ecap_coherent(iommu->ecap))
542 clflush_cache_range(pte, sizeof(*pte));
544 if (cap_caching_mode(iommu->cap)) {
545 pasid_cache_invalidation_with_pasid(iommu, did, pasid);
546 qi_flush_piotlb(iommu, did, pasid, 0, -1, 0);
548 iommu_flush_write_buffer(iommu);
552 static inline int pasid_enable_wpe(struct pasid_entry *pte)
555 unsigned long cr0 = read_cr0();
557 /* CR0.WP is normally set but just to be sure */
558 if (unlikely(!(cr0 & X86_CR0_WP))) {
559 pr_err_ratelimited("No CPU write protect!\n");
569 * Set up the scalable mode pasid table entry for first only
572 int intel_pasid_setup_first_level(struct intel_iommu *iommu,
573 struct device *dev, pgd_t *pgd,
574 u32 pasid, u16 did, int flags)
576 struct pasid_entry *pte;
578 if (!ecap_flts(iommu->ecap)) {
579 pr_err("No first level translation support on %s\n",
584 pte = intel_pasid_get_entry(dev, pasid);
588 pasid_clear_entry(pte);
590 /* Setup the first level page table pointer: */
591 pasid_set_flptr(pte, (u64)__pa(pgd));
592 if (flags & PASID_FLAG_SUPERVISOR_MODE) {
593 if (!ecap_srs(iommu->ecap)) {
594 pr_err("No supervisor request support on %s\n",
599 if (pasid_enable_wpe(pte))
604 if (flags & PASID_FLAG_FL5LP) {
605 if (cap_5lp_support(iommu->cap)) {
606 pasid_set_flpm(pte, 1);
608 pr_err("No 5-level paging support for first-level\n");
609 pasid_clear_entry(pte);
614 if (flags & PASID_FLAG_PAGE_SNOOP)
615 pasid_set_pgsnp(pte);
617 pasid_set_domain_id(pte, did);
618 pasid_set_address_width(pte, iommu->agaw);
619 pasid_set_page_snoop(pte, !!ecap_smpwc(iommu->ecap));
621 /* Setup Present and PASID Granular Transfer Type: */
622 pasid_set_translation_type(pte, PASID_ENTRY_PGTT_FL_ONLY);
623 pasid_set_present(pte);
624 pasid_flush_caches(iommu, pte, pasid, did);
630 * Skip top levels of page tables for iommu which has less agaw
631 * than default. Unnecessary for PT mode.
633 static inline int iommu_skip_agaw(struct dmar_domain *domain,
634 struct intel_iommu *iommu,
635 struct dma_pte **pgd)
639 for (agaw = domain->agaw; agaw > iommu->agaw; agaw--) {
640 *pgd = phys_to_virt(dma_pte_addr(*pgd));
641 if (!dma_pte_present(*pgd))
649 * Set up the scalable mode pasid entry for second only translation type.
651 int intel_pasid_setup_second_level(struct intel_iommu *iommu,
652 struct dmar_domain *domain,
653 struct device *dev, u32 pasid)
655 struct pasid_entry *pte;
662 * If hardware advertises no support for second level
663 * translation, return directly.
665 if (!ecap_slts(iommu->ecap)) {
666 pr_err("No second level translation support on %s\n",
672 agaw = iommu_skip_agaw(domain, iommu, &pgd);
674 dev_err(dev, "Invalid domain page table\n");
678 pgd_val = virt_to_phys(pgd);
679 did = domain->iommu_did[iommu->seq_id];
681 pte = intel_pasid_get_entry(dev, pasid);
683 dev_err(dev, "Failed to get pasid entry of PASID %d\n", pasid);
687 pasid_clear_entry(pte);
688 pasid_set_domain_id(pte, did);
689 pasid_set_slptr(pte, pgd_val);
690 pasid_set_address_width(pte, agaw);
691 pasid_set_translation_type(pte, PASID_ENTRY_PGTT_SL_ONLY);
692 pasid_set_fault_enable(pte);
693 pasid_set_page_snoop(pte, !!ecap_smpwc(iommu->ecap));
695 if (domain->domain.type == IOMMU_DOMAIN_UNMANAGED)
696 pasid_set_pgsnp(pte);
699 * Since it is a second level only translation setup, we should
700 * set SRE bit as well (addresses are expected to be GPAs).
702 if (pasid != PASID_RID2PASID)
704 pasid_set_present(pte);
705 pasid_flush_caches(iommu, pte, pasid, did);
711 * Set up the scalable mode pasid entry for passthrough translation type.
713 int intel_pasid_setup_pass_through(struct intel_iommu *iommu,
714 struct dmar_domain *domain,
715 struct device *dev, u32 pasid)
717 u16 did = FLPT_DEFAULT_DID;
718 struct pasid_entry *pte;
720 pte = intel_pasid_get_entry(dev, pasid);
722 dev_err(dev, "Failed to get pasid entry of PASID %d\n", pasid);
726 pasid_clear_entry(pte);
727 pasid_set_domain_id(pte, did);
728 pasid_set_address_width(pte, iommu->agaw);
729 pasid_set_translation_type(pte, PASID_ENTRY_PGTT_PT);
730 pasid_set_fault_enable(pte);
731 pasid_set_page_snoop(pte, !!ecap_smpwc(iommu->ecap));
734 * We should set SRE bit as well since the addresses are expected
738 pasid_set_present(pte);
739 pasid_flush_caches(iommu, pte, pasid, did);
745 intel_pasid_setup_bind_data(struct intel_iommu *iommu, struct pasid_entry *pte,
746 struct iommu_gpasid_bind_data_vtd *pasid_data)
749 * Not all guest PASID table entry fields are passed down during bind,
750 * here we only set up the ones that are dependent on guest settings.
751 * Execution related bits such as NXE, SMEP are not supported.
752 * Other fields, such as snoop related, are set based on host needs
753 * regardless of guest settings.
755 if (pasid_data->flags & IOMMU_SVA_VTD_GPASID_SRE) {
756 if (!ecap_srs(iommu->ecap)) {
757 pr_err_ratelimited("No supervisor request support on %s\n",
762 /* Enable write protect WP if guest requested */
763 if (pasid_data->flags & IOMMU_SVA_VTD_GPASID_WPE)
767 if (pasid_data->flags & IOMMU_SVA_VTD_GPASID_EAFE) {
768 if (!ecap_eafs(iommu->ecap)) {
769 pr_err_ratelimited("No extended access flag support on %s\n",
777 * Memory type is only applicable to devices inside processor coherent
778 * domain. Will add MTS support once coherent devices are available.
780 if (pasid_data->flags & IOMMU_SVA_VTD_GPASID_MTS_MASK) {
781 pr_warn_ratelimited("No memory type support %s\n",
790 * intel_pasid_setup_nested() - Set up PASID entry for nested translation.
791 * This could be used for guest shared virtual address. In this case, the
792 * first level page tables are used for GVA-GPA translation in the guest,
793 * second level page tables are used for GPA-HPA translation.
795 * @iommu: IOMMU which the device belong to
796 * @dev: Device to be set up for translation
797 * @gpgd: FLPTPTR: First Level Page translation pointer in GPA
798 * @pasid: PASID to be programmed in the device PASID table
799 * @pasid_data: Additional PASID info from the guest bind request
800 * @domain: Domain info for setting up second level page tables
801 * @addr_width: Address width of the first level (guest)
803 int intel_pasid_setup_nested(struct intel_iommu *iommu, struct device *dev,
804 pgd_t *gpgd, u32 pasid,
805 struct iommu_gpasid_bind_data_vtd *pasid_data,
806 struct dmar_domain *domain, int addr_width)
808 struct pasid_entry *pte;
815 if (!ecap_nest(iommu->ecap)) {
816 pr_err_ratelimited("IOMMU: %s: No nested translation support\n",
821 if (!(domain->flags & DOMAIN_FLAG_NESTING_MODE)) {
822 pr_err_ratelimited("Domain is not in nesting mode, %x\n",
827 pte = intel_pasid_get_entry(dev, pasid);
832 * Caller must ensure PASID entry is not in use, i.e. not bind the
833 * same PASID to the same device twice.
835 if (pasid_pte_is_present(pte))
838 pasid_clear_entry(pte);
840 /* Sanity checking performed by caller to make sure address
841 * width matching in two dimensions:
845 switch (addr_width) {
847 case ADDR_WIDTH_5LEVEL:
848 if (!cpu_feature_enabled(X86_FEATURE_LA57) ||
849 !cap_5lp_support(iommu->cap)) {
850 dev_err_ratelimited(dev,
851 "5-level paging not supported\n");
855 pasid_set_flpm(pte, 1);
858 case ADDR_WIDTH_4LEVEL:
859 pasid_set_flpm(pte, 0);
862 dev_err_ratelimited(dev, "Invalid guest address width %d\n",
867 /* First level PGD is in GPA, must be supported by the second level */
868 if ((uintptr_t)gpgd > domain->max_addr) {
869 dev_err_ratelimited(dev,
870 "Guest PGD %lx not supported, max %llx\n",
871 (uintptr_t)gpgd, domain->max_addr);
874 pasid_set_flptr(pte, (uintptr_t)gpgd);
876 ret = intel_pasid_setup_bind_data(iommu, pte, pasid_data);
880 /* Setup the second level based on the given domain */
883 agaw = iommu_skip_agaw(domain, iommu, &pgd);
885 dev_err_ratelimited(dev, "Invalid domain page table\n");
888 pgd_val = virt_to_phys(pgd);
889 pasid_set_slptr(pte, pgd_val);
890 pasid_set_fault_enable(pte);
892 did = domain->iommu_did[iommu->seq_id];
893 pasid_set_domain_id(pte, did);
895 pasid_set_address_width(pte, agaw);
896 pasid_set_page_snoop(pte, !!ecap_smpwc(iommu->ecap));
898 pasid_set_translation_type(pte, PASID_ENTRY_PGTT_NESTED);
899 pasid_set_present(pte);
900 pasid_flush_caches(iommu, pte, pasid, did);