* [PATCH] iommu/amd: Print extended features in one line to fix divergent log levels
@ 2020-06-16 22:04 Paul Menzel
2020-06-17 9:23 ` Suravee Suthikulpanit
2020-06-30 9:52 ` Jörg Rödel
0 siblings, 2 replies; 3+ messages in thread
From: Paul Menzel @ 2020-06-16 22:04 UTC (permalink / raw)
To: Jörg Rödel; +Cc: Paul Menzel, iommu
Currently, Linux logs the two messages below.
[ 0.979142] pci 0000:00:00.2: AMD-Vi: Extended features (0xf77ef22294ada):
[ 0.979546] PPR NX GT IA GA PC GA_vAPIC
The log level of these lines differs though. The first one has level
*info*, while the second has level *warn*, which is confusing.
$ dmesg -T --level=info | grep "Extended features"
[Tue Jun 16 21:46:58 2020] pci 0000:00:00.2: AMD-Vi: Extended features (0xf77ef22294ada):
$ dmesg -T --level=warn | grep "PPR"
[Tue Jun 16 21:46:58 2020] PPR NX GT IA GA PC GA_vAPIC
The problem is, that commit 3928aa3f57 ("iommu/amd: Detect and enable
guest vAPIC support") introduced a newline, causing `pr_cont()`, used to
print the features, to default back to the default log level.
/**
* pr_cont - Continues a previous log message in the same line.
* @fmt: format string
* @...: arguments for the format string
*
* This macro expands to a printk with KERN_CONT loglevel. It should only be
* used when continuing a log message with no newline ('\n') enclosed. Otherwise
* it defaults back to KERN_DEFAULT loglevel.
*/
#define pr_cont(fmt, ...) \
printk(KERN_CONT fmt, ##__VA_ARGS__)
So, remove the line break, so only one line is logged.
Fixes: 3928aa3f57 ("iommu/amd: Detect and enable guest vAPIC support")
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc: iommu@lists.linux-foundation.org
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
---
drivers/iommu/amd_iommu_init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index 5b81fd16f5faf8..8d9b2c94178c43 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -1844,7 +1844,7 @@ static void print_iommu_info(void)
pci_info(pdev, "Found IOMMU cap 0x%hx\n", iommu->cap_ptr);
if (iommu->cap & (1 << IOMMU_CAP_EFR)) {
- pci_info(pdev, "Extended features (%#llx):\n",
+ pci_info(pdev, "Extended features (%#llx):",
iommu->features);
for (i = 0; i < ARRAY_SIZE(feat_str); ++i) {
if (iommu_feature(iommu, (1ULL << i)))
--
2.26.2
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] iommu/amd: Print extended features in one line to fix divergent log levels
2020-06-16 22:04 [PATCH] iommu/amd: Print extended features in one line to fix divergent log levels Paul Menzel
@ 2020-06-17 9:23 ` Suravee Suthikulpanit
2020-06-30 9:52 ` Jörg Rödel
1 sibling, 0 replies; 3+ messages in thread
From: Suravee Suthikulpanit @ 2020-06-17 9:23 UTC (permalink / raw)
To: Paul Menzel, Jörg Rödel; +Cc: iommu
On 6/17/20 5:04 AM, Paul Menzel wrote:
> Currently, Linux logs the two messages below.
>
> [ 0.979142] pci 0000:00:00.2: AMD-Vi: Extended features (0xf77ef22294ada):
> [ 0.979546] PPR NX GT IA GA PC GA_vAPIC
>
> The log level of these lines differs though. The first one has level
> *info*, while the second has level *warn*, which is confusing.
>
> $ dmesg -T --level=info | grep "Extended features"
> [Tue Jun 16 21:46:58 2020] pci 0000:00:00.2: AMD-Vi: Extended features (0xf77ef22294ada):
> $ dmesg -T --level=warn | grep "PPR"
> [Tue Jun 16 21:46:58 2020] PPR NX GT IA GA PC GA_vAPIC
>
> The problem is, that commit 3928aa3f57 ("iommu/amd: Detect and enable
> guest vAPIC support") introduced a newline, causing `pr_cont()`, used to
> print the features, to default back to the default log level.
>
> /**
> * pr_cont - Continues a previous log message in the same line.
> * @fmt: format string
> * @...: arguments for the format string
> *
> * This macro expands to a printk with KERN_CONT loglevel. It should only be
> * used when continuing a log message with no newline ('\n') enclosed. Otherwise
> * it defaults back to KERN_DEFAULT loglevel.
> */
> #define pr_cont(fmt, ...) \
> printk(KERN_CONT fmt, ##__VA_ARGS__)
>
> So, remove the line break, so only one line is logged.
>
> Fixes: 3928aa3f57 ("iommu/amd: Detect and enable guest vAPIC support")
> Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> Cc: iommu@lists.linux-foundation.org
> Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
> ---
> drivers/iommu/amd_iommu_init.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
> index 5b81fd16f5faf8..8d9b2c94178c43 100644
> --- a/drivers/iommu/amd_iommu_init.c
> +++ b/drivers/iommu/amd_iommu_init.c
> @@ -1844,7 +1844,7 @@ static void print_iommu_info(void)
> pci_info(pdev, "Found IOMMU cap 0x%hx\n", iommu->cap_ptr);
>
> if (iommu->cap & (1 << IOMMU_CAP_EFR)) {
> - pci_info(pdev, "Extended features (%#llx):\n",
> + pci_info(pdev, "Extended features (%#llx):",
> iommu->features);
> for (i = 0; i < ARRAY_SIZE(feat_str); ++i) {
> if (iommu_feature(iommu, (1ULL << i)))
>
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Thanks,
Suravee
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] iommu/amd: Print extended features in one line to fix divergent log levels
2020-06-16 22:04 [PATCH] iommu/amd: Print extended features in one line to fix divergent log levels Paul Menzel
2020-06-17 9:23 ` Suravee Suthikulpanit
@ 2020-06-30 9:52 ` Jörg Rödel
1 sibling, 0 replies; 3+ messages in thread
From: Jörg Rödel @ 2020-06-30 9:52 UTC (permalink / raw)
To: Paul Menzel; +Cc: iommu
On Wed, Jun 17, 2020 at 12:04:20AM +0200, Paul Menzel wrote:
> drivers/iommu/amd_iommu_init.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-06-30 9:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-16 22:04 [PATCH] iommu/amd: Print extended features in one line to fix divergent log levels Paul Menzel
2020-06-17 9:23 ` Suravee Suthikulpanit
2020-06-30 9:52 ` Jörg Rödel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox