Skip to contentSkip to conversation

iommu/amd: Fix extended features logging

PATCH RESEND Applied Alexander Monakov 3 participants 3 messages May 4, 2021 – Jun 4, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND v2 1/1 iommu/amd: Fix extended features logging

print_iommu_info prints the EFR register and then the decoded list of features on a separate line:

pci 0000:00:00.2: AMD-Vi: Extended features (0x206d73ef22254ade):
PPR X2APIC NX GT IA GA PC GA_vAPIC

The second line is emitted via 'pr_cont', which causes it to have a different ('warn') loglevel compared to the previous line ('info').

Commit 9a295ff0ffc9 attempted to rectify this by removing the newline from the pci_info format string, but this doesn't work, as pci_info calls implicitly append a newline anyway.

Printing the decoded features on the same line would make it quite long. Instead, change pci_info() to pr_info() to omit PCI bus location info, which is also shown in the preceding message. This results in:

pci 0000:00:00.2: AMD-Vi: Found IOMMU cap 0x40
AMD-Vi: Extended features (0x206d73ef22254ade): PPR X2APIC NX GT IA GA PC GA_vAPIC
AMD-Vi: Interrupt remapping enabled

Fixes 9a295ff0ffc9 ("iommu/amd: Print extended features in one line to fix divergent log levels")
Cc Paul Menzel <[email protected]>
Cc Joerg Roedel <[email protected]>
Cc Suravee Suthikulpanit <[email protected]>
---
 drivers/iommu/amd/init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/amd/init.c +2 -2
index 429a4baa3aee..8f0eb865119a 100644
@@ -1954,8 +1954,8 @@ static void print_iommu_info(void)
 		pci_info(pdev, "Found IOMMU cap 0x%x\n", iommu->cap_ptr);
 
 		if (iommu->cap & (1 << IOMMU_CAP_EFR)) {
-			pci_info(pdev, "Extended features (%#llx):",
-				 iommu->features);
+			pr_info("Extended features (%#llx):", iommu->features);
+
 			for (i = 0; i < ARRAY_SIZE(feat_str); ++i) {
 				if (iommu_feature(iommu, (1ULL << i)))
 					pr_cont(" %s", feat_str[i]);

base-commit: 9f4ad9e425a1d3b6a34617b8ea226d56a119a717

Signature · 1 line
2.30.0
Reviewed-by on v2 1/1
#1 lore raw

Am 04.05.21 um 12:22 schrieb Alexander Monakov:

Quoted 48 lines

print_iommu_info prints the EFR register and then the decoded list of features on a separate line:

pci 0000:00:00.2: AMD-Vi: Extended features (0x206d73ef22254ade):
PPR X2APIC NX GT IA GA PC GA_vAPIC

The second line is emitted via 'pr_cont', which causes it to have a different ('warn') loglevel compared to the previous line ('info').

Commit 9a295ff0ffc9 attempted to rectify this by removing the newline from the pci_info format string, but this doesn't work, as pci_info calls implicitly append a newline anyway.

Printing the decoded features on the same line would make it quite long. Instead, change pci_info() to pr_info() to omit PCI bus location info, which is also shown in the preceding message. This results in:

pci 0000:00:00.2: AMD-Vi: Found IOMMU cap 0x40
AMD-Vi: Extended features (0x206d73ef22254ade): PPR X2APIC NX GT IA GA PC GA_vAPIC
AMD-Vi: Interrupt remapping enabled

Fixes 9a295ff0ffc9 ("iommu/amd: Print extended features in one line to fix divergent log levels")
Cc Paul Menzel <[email protected]>
Cc Joerg Roedel <[email protected]>
Cc Suravee Suthikulpanit <[email protected]>
---
  drivers/iommu/amd/init.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/amd/init.c +2 -2
index 429a4baa3aee..8f0eb865119a 100644
@@ -1954,8 +1954,8 @@ static void print_iommu_info(void)
  		pci_info(pdev, "Found IOMMU cap 0x%x\n", iommu->cap_ptr);
 
  		if (iommu->cap & (1 << IOMMU_CAP_EFR)) {
-			pci_info(pdev, "Extended features (%#llx):",
-				 iommu->features);
+			pr_info("Extended features (%#llx):", iommu->features);
+
  			for (i = 0; i < ARRAY_SIZE(feat_str); ++i) {
  				if (iommu_feature(iommu, (1ULL << i)))
  					pr_cont(" %s", feat_str[i]);
Quoted 1 line

base-commit: 9f4ad9e425a1d3b6a34617b8ea226d56a119a717

Kind regards,

Paul
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Applied
#2 lore raw
In reply to Alexander Monakov
Quoted 10 lines · Alexander Monakov
Fixes 9a295ff0ffc9 ("iommu/amd: Print extended features in one line to fix divergent log levels")
Cc Paul Menzel <[email protected]>
Cc Joerg Roedel <[email protected]>
Cc Suravee Suthikulpanit <[email protected]>
---
 drivers/iommu/amd/init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks. And sorry for the delay.