Re: [REGRESSION][BISECTED] PCI Passthrough / SR-IOV Failure on Stable Kernel ≥ v6.12.35

From: Ban ZuoXiang
Date: Wed Jul 23 2025 - 05:23:37 EST


> Nope! We need your help as you are the one that can reproduce it :)
>
> Are we missing a backport? Did we get the backport incorrect? Should
> we just revert it?
>
> thanks,
> greg k-h

Hi, greg k-h

Original patch:

> diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
> index bb871674d8acba..226e174577fff1 100644
> --- a/drivers/iommu/intel/iommu.c
> +++ b/drivers/iommu/intel/iommu.c
> @@ -4298,6 +4306,9 @@ static int identity_domain_attach_dev(struct
> iommu_domain *domain, struct device
>      else
>          ret = device_setup_pass_through(dev);
>  
> +    if (!ret)
> +        info->domain_attached = true;
> +
>      return ret;
>  }
Backport patch:
> diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
> index 157542c07aaafa..56e9f125cda9a0 100644
> --- a/drivers/iommu/intel/iommu.c
> +++ b/drivers/iommu/intel/iommu.c
> @@ -4406,6 +4414,9 @@ static int device_set_dirty_tracking(struct
> list_head *devices, bool enable)
>              break;
>      }
>  
> +    if (!ret)
> +        info->domain_attached = true;
> +
>      return ret;
>  }

The last hunk of the original patch [1] was applied to the
|identity_domain_attach_dev| function, 
but the last hunk of the backport patch [2] appears to have been
mistakenly applied to the |device_set_dirty_tracking| function.
I can confirm that correctly placing the patch from
device_set_dirty_tracking into identity_domain_attach_dev resolves the
issue.

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=320302baed05c6456164652541f23d2a96522c06
[2]
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=fb5873b779dd5858123c19bbd6959566771e2e83

thanks,
Ban ZuoXiang