/* Pages have been freed at this point */ staticvoid intel_arch_invalidate_secondary_tlbs(struct mmu_notifier *mn, struct mm_struct *mm, unsignedlong start, unsignedlong end)
{ struct dmar_domain *domain = container_of(mn, struct dmar_domain, notifier);
if (start == 0 && end == ULONG_MAX) {
cache_tag_flush_all(domain); return;
}
/* * The mm_types defines vm_end as the first byte after the end address, * different from IOMMU subsystem using the last address of an address * range.
*/
cache_tag_flush_range(domain, start, end - 1, 0);
}
/* This might end up being called from exit_mmap(), *before* the page * tables are cleared. And __mmu_notifier_release() will delete us from * the list of notifiers so that our invalidate_range() callback doesn't * get called when the page tables are cleared. So we need to protect * against hardware accessing those page tables. * * We do it by clearing the entry in the PASID table and then flushing * the IOTLB and the PASID table caches. This might upset hardware; * perhaps we'll want to point the PASID to a dummy PGD (like the zero * page) so that we end up taking a fault that the hardware really * *has* to handle gracefully without affecting other processes.
*/
spin_lock_irqsave(&domain->lock, flags);
list_for_each_entry(dev_pasid, &domain->dev_pasids, link_domain) {
info = dev_iommu_priv_get(dev_pasid->dev);
intel_pasid_tear_down_entry(info->iommu, dev_pasid->dev,
dev_pasid->pasid, true);
}
spin_unlock_irqrestore(&domain->lock, flags);
if (!(iommu->flags & VTD_FLAG_SVM_CAPABLE)) return -ENODEV;
if (!info->pasid_enabled || !info->ats_enabled) return -EINVAL;
/* * Devices having device-specific I/O fault handling should not * support PCI/PRI. The IOMMU side has no means to check the * capability of device-specific IOPF. Therefore, IOMMU can only * default that if the device driver enables SVA on a non-PRI * device, it will handle IOPF in its own way.
*/ if (!info->pri_supported) return 0;
/* Devices supporting PRI should have it enabled. */ if (!info->pri_enabled) return -EINVAL;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.