RE: [PATCH v4 6/7] iommu/vt-d: Add support for static identity domain
From: Tian, Kevin
Date: Fri Aug 09 2024 - 04:29:49 EST
> From: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
> Sent: Friday, August 9, 2024 1:55 PM
>
> +static int context_setup_pass_through(struct device *dev, u8 bus, u8 devfn)
> +{
> + struct device_domain_info *info = dev_iommu_priv_get(dev);
> + struct intel_iommu *iommu = info->iommu;
> + struct context_entry *context;
> +
> + spin_lock(&iommu->lock);
> + context = iommu_context_addr(iommu, bus, devfn, 1);
> + if (!context) {
> + spin_unlock(&iommu->lock);
> + return -ENOMEM;
> + }
> +
> + if (context_present(context) && !context_copied(iommu, bus, devfn))
> {
> + spin_unlock(&iommu->lock);
> + return 0;
> + }
Is it a valid case to setup passthrough on a present entry?