Mailing List Archive

[xen staging] VT-d: skip IOMMU bitmap cleanup for phantom devices
commit 9d92140d0255e14d8c3eaba7edc931327eb96fd0
Author: Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Sep 16 11:02:48 2021 +0200
Commit: Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Sep 16 11:02:48 2021 +0200

VT-d: skip IOMMU bitmap cleanup for phantom devices

Doing the cleanup also for phantom devices is at best redundant with
doing it for the corresponding real device. I couldn't force myself into
checking all the code paths whether it really is: It seems better to
explicitly skip this step in such cases.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
---
xen/drivers/passthrough/vtd/iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 9827ab184d..aeb1dddc88 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1733,7 +1733,7 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
return -EINVAL;
}

- if ( ret || QUARANTINE_SKIP(domain) )
+ if ( ret || QUARANTINE_SKIP(domain) || pdev->devfn != devfn )
return ret;

/*
--
generated by git-patchbot for /home/xen/git/xen.git#staging