Skip to content

Commit 5983369

Browse files
jwrdegoedejoergroedel
authored andcommitted
iommu/vt-d: dmar: replace WARN_TAINT with pr_warn + add_taint
Quoting from the comment describing the WARN functions in include/asm-generic/bug.h: * WARN(), WARN_ON(), WARN_ON_ONCE, and so on can be used to report * significant kernel issues that need prompt attention if they should ever * appear at runtime. * * Do not use these macros when checking for invalid external inputs The (buggy) firmware tables which the dmar code was calling WARN_TAINT for really are invalid external inputs. They are not under the kernel's control and the issues in them cannot be fixed by a kernel update. So logging a backtrace, which invites bug reports to be filed about this, is not helpful. Some distros, e.g. Fedora, have tools watching for the kernel backtraces logged by the WARN macros and offer the user an option to file a bug for this when these are encountered. The WARN_TAINT in warn_invalid_dmar() + another iommu WARN_TAINT, addressed in another patch, have lead to over a 100 bugs being filed this way. This commit replaces the WARN_TAINT("...") calls, with pr_warn(FW_BUG "...") + add_taint(TAINT_FIRMWARE_WORKAROUND, ...) calls avoiding the backtrace and thus also avoiding bug-reports being filed about this against the kernel. Fixes: fd0c889 ("intel-iommu: Set a more specific taint flag for invalid BIOS DMAR tables") Fixes: e625b4a ("iommu/vt-d: Parse ANDD records") Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Joerg Roedel <[email protected]> Acked-by: Lu Baolu <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1564895
1 parent f515241 commit 5983369

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/iommu/dmar.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -441,12 +441,13 @@ static int __init dmar_parse_one_andd(struct acpi_dmar_header *header,
441441

442442
/* Check for NUL termination within the designated length */
443443
if (strnlen(andd->device_name, header->length - 8) == header->length - 8) {
444-
WARN_TAINT(1, TAINT_FIRMWARE_WORKAROUND,
444+
pr_warn(FW_BUG
445445
"Your BIOS is broken; ANDD object name is not NUL-terminated\n"
446446
"BIOS vendor: %s; Ver: %s; Product Version: %s\n",
447447
dmi_get_system_info(DMI_BIOS_VENDOR),
448448
dmi_get_system_info(DMI_BIOS_VERSION),
449449
dmi_get_system_info(DMI_PRODUCT_VERSION));
450+
add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
450451
return -EINVAL;
451452
}
452453
pr_info("ANDD device: %x name: %s\n", andd->device_number,
@@ -472,14 +473,14 @@ static int dmar_parse_one_rhsa(struct acpi_dmar_header *header, void *arg)
472473
return 0;
473474
}
474475
}
475-
WARN_TAINT(
476-
1, TAINT_FIRMWARE_WORKAROUND,
476+
pr_warn(FW_BUG
477477
"Your BIOS is broken; RHSA refers to non-existent DMAR unit at %llx\n"
478478
"BIOS vendor: %s; Ver: %s; Product Version: %s\n",
479479
drhd->reg_base_addr,
480480
dmi_get_system_info(DMI_BIOS_VENDOR),
481481
dmi_get_system_info(DMI_BIOS_VERSION),
482482
dmi_get_system_info(DMI_PRODUCT_VERSION));
483+
add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
483484

484485
return 0;
485486
}
@@ -828,14 +829,14 @@ int __init dmar_table_init(void)
828829

829830
static void warn_invalid_dmar(u64 addr, const char *message)
830831
{
831-
WARN_TAINT_ONCE(
832-
1, TAINT_FIRMWARE_WORKAROUND,
832+
pr_warn_once(FW_BUG
833833
"Your BIOS is broken; DMAR reported at address %llx%s!\n"
834834
"BIOS vendor: %s; Ver: %s; Product Version: %s\n",
835835
addr, message,
836836
dmi_get_system_info(DMI_BIOS_VENDOR),
837837
dmi_get_system_info(DMI_BIOS_VERSION),
838838
dmi_get_system_info(DMI_PRODUCT_VERSION));
839+
add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
839840
}
840841

841842
static int __ref

0 commit comments

Comments
 (0)