RE: [PATCH v10 5/7] iommu/vt-d: Make prq draining code generic

From: Tian, Kevin
Date: Thu Jul 13 2023 - 03:50:05 EST


> From: Jacob Pan <jacob.jun.pan@xxxxxxxxxxxxxxx>
> Sent: Thursday, July 13, 2023 12:34 AM
>
> - /* Domain type specific cleanup: */
> domain = iommu_get_domain_for_dev_pasid(dev, pasid, 0);
> - if (domain) {
> - switch (domain->type) {
> - case IOMMU_DOMAIN_SVA:
> - intel_svm_remove_dev_pasid(dev, pasid);
> - break;
> - default:
> - /* should never reach here */
> - WARN_ON(1);
> - break;
> - }
> + if (!domain)
> + goto out_tear_down;

WARN_ON()

> * large and has to be physically contiguous. So it's
> * hard to be as defensive as we might like.
> */
> - intel_pasid_tear_down_entry(iommu, dev, svm->pasid,
> false);
> - intel_svm_drain_prq(dev, svm->pasid);

after removing the 2 lines the comment above becomes stale.

> -static void intel_svm_drain_prq(struct device *dev, u32 pasid)
> +void intel_drain_pasid_prq(struct device *dev, u32 pasid)
> {
> struct device_domain_info *info;
> struct dmar_domain *domain;

later we should move generic prq handling logic out of svm.c into
a new prq.c