* [PATCH] iommu/vt-d: quirk_ioat_snb_local_iommu: replace WARN_TAINT with pr_warn + add_taint
@ 2020-03-09 18:25 Hans de Goede
2020-03-10 1:46 ` Lu Baolu
2020-03-10 10:44 ` Joerg Roedel
0 siblings, 2 replies; 3+ messages in thread
From: Hans de Goede @ 2020-03-09 18:25 UTC (permalink / raw)
To: David Woodhouse, Lu Baolu, Joerg Roedel; +Cc: Hans de Goede, iommu
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.
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=701847
Fixes: 556ab45f9a77 ("ioat2: catch and recover from broken vtd configurations v6")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/iommu/intel-iommu.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 3857a5cd1a75..8fd132f8e885 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -4261,10 +4261,11 @@ static void quirk_ioat_snb_local_iommu(struct pci_dev *pdev)
/* we know that the this iommu should be at offset 0xa000 from vtbar */
drhd = dmar_find_matched_drhd_unit(pdev);
- if (WARN_TAINT_ONCE(!drhd || drhd->reg_base_addr - vtbar != 0xa000,
- TAINT_FIRMWARE_WORKAROUND,
- "BIOS assigned incorrect VT-d unit for Intel(R) QuickData Technology device\n"))
+ if (!drhd || drhd->reg_base_addr - vtbar != 0xa000) {
+ pr_warn_once(FW_BUG "BIOS assigned incorrect VT-d unit for Intel(R) QuickData Technology device\n");
+ add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
pdev->dev.archdata.iommu = DUMMY_DEVICE_DOMAIN_INFO;
+ }
}
DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_SNB, quirk_ioat_snb_local_iommu);
--
2.25.1
_______________________________________________
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/vt-d: quirk_ioat_snb_local_iommu: replace WARN_TAINT with pr_warn + add_taint
2020-03-09 18:25 [PATCH] iommu/vt-d: quirk_ioat_snb_local_iommu: replace WARN_TAINT with pr_warn + add_taint Hans de Goede
@ 2020-03-10 1:46 ` Lu Baolu
2020-03-10 10:44 ` Joerg Roedel
1 sibling, 0 replies; 3+ messages in thread
From: Lu Baolu @ 2020-03-10 1:46 UTC (permalink / raw)
To: Hans de Goede, David Woodhouse, Joerg Roedel; +Cc: iommu
On 2020/3/10 2:25, Hans de Goede wrote:
> 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.
>
> BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=701847
> Fixes: 556ab45f9a77 ("ioat2: catch and recover from broken vtd configurations v6")
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Lu Baolu <baolu.lu@linux.intel.com>
Best regards,
baolu
> ---
> drivers/iommu/intel-iommu.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
> index 3857a5cd1a75..8fd132f8e885 100644
> --- a/drivers/iommu/intel-iommu.c
> +++ b/drivers/iommu/intel-iommu.c
> @@ -4261,10 +4261,11 @@ static void quirk_ioat_snb_local_iommu(struct pci_dev *pdev)
>
> /* we know that the this iommu should be at offset 0xa000 from vtbar */
> drhd = dmar_find_matched_drhd_unit(pdev);
> - if (WARN_TAINT_ONCE(!drhd || drhd->reg_base_addr - vtbar != 0xa000,
> - TAINT_FIRMWARE_WORKAROUND,
> - "BIOS assigned incorrect VT-d unit for Intel(R) QuickData Technology device\n"))
> + if (!drhd || drhd->reg_base_addr - vtbar != 0xa000) {
> + pr_warn_once(FW_BUG "BIOS assigned incorrect VT-d unit for Intel(R) QuickData Technology device\n");
> + add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
> pdev->dev.archdata.iommu = DUMMY_DEVICE_DOMAIN_INFO;
> + }
> }
> DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_SNB, quirk_ioat_snb_local_iommu);
>
>
_______________________________________________
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/vt-d: quirk_ioat_snb_local_iommu: replace WARN_TAINT with pr_warn + add_taint
2020-03-09 18:25 [PATCH] iommu/vt-d: quirk_ioat_snb_local_iommu: replace WARN_TAINT with pr_warn + add_taint Hans de Goede
2020-03-10 1:46 ` Lu Baolu
@ 2020-03-10 10:44 ` Joerg Roedel
1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2020-03-10 10:44 UTC (permalink / raw)
To: Hans de Goede; +Cc: iommu, David Woodhouse
On Mon, Mar 09, 2020 at 07:25:10PM +0100, Hans de Goede wrote:
> 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.
>
> BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=701847
> Fixes: 556ab45f9a77 ("ioat2: catch and recover from broken vtd configurations v6")
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/iommu/intel-iommu.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
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-03-10 10:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-09 18:25 [PATCH] iommu/vt-d: quirk_ioat_snb_local_iommu: replace WARN_TAINT with pr_warn + add_taint Hans de Goede
2020-03-10 1:46 ` Lu Baolu
2020-03-10 10:44 ` Joerg Roedel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).