]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
AMD/IOMMU: restrict feature logging
authorJan Beulich <jbeulich@suse.com>
Tue, 2 Jul 2019 11:27:39 +0000 (13:27 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 2 Jul 2019 11:27:39 +0000 (13:27 +0200)
The common case is all IOMMUs having the same features. Log them only
for the first IOMMU, or for any that have a differing feature set.

Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Brian Woods <brian.woods@amd.com>
xen/drivers/passthrough/amd/iommu_detect.c

index 3c5d4de1a3789687aa1a9a137d795babed5b4680..28282e47ac14b47e6ddc7ccd4722928de9cd3b4e 100644 (file)
@@ -62,6 +62,7 @@ void __init get_iommu_features(struct amd_iommu *iommu)
 {
     u32 low, high;
     int i = 0 ;
+    const struct amd_iommu *first;
     static const char *__initdata feature_str[] = {
         "- Prefetch Pages Command", 
         "- Peripheral Page Service Request", 
@@ -89,6 +90,11 @@ void __init get_iommu_features(struct amd_iommu *iommu)
 
     iommu->features = ((u64)high << 32) | low;
 
+    /* Don't log the same set of features over and over. */
+    first = list_first_entry(&amd_iommu_head, struct amd_iommu, list);
+    if ( iommu != first && iommu->features == first->features )
+        return;
+
     printk("AMD-Vi: IOMMU Extended Features:\n");
 
     while ( feature_str[i] )