Skip to content

Commit 96788c7

Browse files
jwrdegoedejoergroedel
authored andcommitted
iommu/vt-d: dmar_parse_one_rmrr: 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 dmar_parse_one_rmrr + 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("...") call, with a pr_warn(FW_BUG "...") + add_taint(TAINT_FIRMWARE_WORKAROUND, ...) call avoiding the backtrace and thus also avoiding bug-reports being filed about this against the kernel. Fixes: f5a68bb ("iommu/vt-d: Mark firmware tainted if RMRR fails sanity check") Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Joerg Roedel <[email protected]> Acked-by: Lu Baolu <[email protected]> Cc: [email protected] Cc: Barret Rhoden <[email protected]> Link: https://lore.kernel.org/r/[email protected] BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1808874
1 parent 5983369 commit 96788c7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/iommu/intel-iommu.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4460,14 +4460,16 @@ int __init dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg)
44604460
struct dmar_rmrr_unit *rmrru;
44614461

44624462
rmrr = (struct acpi_dmar_reserved_memory *)header;
4463-
if (rmrr_sanity_check(rmrr))
4464-
WARN_TAINT(1, TAINT_FIRMWARE_WORKAROUND,
4463+
if (rmrr_sanity_check(rmrr)) {
4464+
pr_warn(FW_BUG
44654465
"Your BIOS is broken; bad RMRR [%#018Lx-%#018Lx]\n"
44664466
"BIOS vendor: %s; Ver: %s; Product Version: %s\n",
44674467
rmrr->base_address, rmrr->end_address,
44684468
dmi_get_system_info(DMI_BIOS_VENDOR),
44694469
dmi_get_system_info(DMI_BIOS_VERSION),
44704470
dmi_get_system_info(DMI_PRODUCT_VERSION));
4471+
add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
4472+
}
44714473

44724474
rmrru = kzalloc(sizeof(*rmrru), GFP_KERNEL);
44734475
if (!rmrru)

0 commit comments

Comments
 (0)