From: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
To: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>,
Ingo Molnar <mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org,
x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>,
Jiang Liu <jiang.liu-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
Borislav Petkov <bp-Gina5bIWoIWzQB+pC5nmwQ@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
Joerg Roedel <jroedel-l3A5Bk7waGM@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 3/5] iommu/vt-d: Move supported-checks to intel_prepare_irq_remapping()
Date: Mon, 15 Dec 2014 16:13:22 +0100 [thread overview]
Message-ID: <1418656404-28575-4-git-send-email-joro@8bytes.org> (raw)
In-Reply-To: <1418656404-28575-1-git-send-email-joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
From: Joerg Roedel <jroedel-l3A5Bk7waGM@public.gmane.org>
The checks for IRQ remapping support rely on ordering with
dmar_table_init(), which is called in
intel_prepare_irq_remapping(). Move the checks for IRQ
remapping support to this function to ensure the right
ordering.
Signed-off-by: Joerg Roedel <jroedel-l3A5Bk7waGM@public.gmane.org>
---
drivers/iommu/intel_irq_remapping.c | 39 +++++++++++++++++++++----------------
1 file changed, 22 insertions(+), 17 deletions(-)
diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c
index 45223ea..0c9226f 100644
--- a/drivers/iommu/intel_irq_remapping.c
+++ b/drivers/iommu/intel_irq_remapping.c
@@ -512,23 +512,6 @@ static int __init dmar_x2apic_optout(void)
static int __init intel_irq_remapping_supported(void)
{
- if (disable_irq_remap)
- return 0;
- if (irq_remap_broken) {
- printk(KERN_WARNING
- "This system BIOS has enabled interrupt remapping\n"
- "on a chipset that contains an erratum making that\n"
- "feature unstable. To maintain system stability\n"
- "interrupt remapping is being disabled. Please\n"
- "contact your BIOS vendor for an update\n");
- add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
- disable_irq_remap = 1;
- return 0;
- }
-
- if (!dmar_ir_support())
- return 0;
-
return 1;
}
@@ -553,6 +536,24 @@ static int __init intel_prepare_irq_remapping(void)
struct dmar_drhd_unit *drhd;
struct intel_iommu *iommu;
+ /* First check whether IRQ remapping should be enabled */
+ if (disable_irq_remap)
+ return -1;
+
+ /* Are we running on sane hardware? */
+ if (irq_remap_broken) {
+ printk(KERN_WARNING
+ "This system BIOS has enabled interrupt remapping\n"
+ "on a chipset that contains an erratum making that\n"
+ "feature unstable. To maintain system stability\n"
+ "interrupt remapping is being disabled. Please\n"
+ "contact your BIOS vendor for an update\n");
+ add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
+ disable_irq_remap = 1;
+ return -1;
+ }
+
+ /* Everthing seems fine so far, parse the DMAR table */
if (dmar_table_init() < 0)
return -1;
@@ -561,6 +562,10 @@ static int __init intel_prepare_irq_remapping(void)
goto error;
}
+ /* Is interrupt remapping supported by hardware? */
+ if (!dmar_ir_support())
+ return 0;
+
/* First make sure all IOMMUs support IRQ remapping */
for_each_iommu(iommu, drhd)
if (!ecap_ir_support(iommu->ecap))
--
1.9.1
WARNING: multiple messages have this Message-ID (diff)
From: Joerg Roedel <joro@8bytes.org>
To: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
hpa@zytor.com, x86@kernel.org, Joerg Roedel <joro@8bytes.org>,
Jiang Liu <jiang.liu@linux.intel.com>,
Borislav Petkov <bp@alien8.de>
Cc: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
Joerg Roedel <jroedel@suse.de>
Subject: [PATCH 3/5] iommu/vt-d: Move supported-checks to intel_prepare_irq_remapping()
Date: Mon, 15 Dec 2014 16:13:22 +0100 [thread overview]
Message-ID: <1418656404-28575-4-git-send-email-joro@8bytes.org> (raw)
In-Reply-To: <1418656404-28575-1-git-send-email-joro@8bytes.org>
From: Joerg Roedel <jroedel@suse.de>
The checks for IRQ remapping support rely on ordering with
dmar_table_init(), which is called in
intel_prepare_irq_remapping(). Move the checks for IRQ
remapping support to this function to ensure the right
ordering.
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
drivers/iommu/intel_irq_remapping.c | 39 +++++++++++++++++++++----------------
1 file changed, 22 insertions(+), 17 deletions(-)
diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c
index 45223ea..0c9226f 100644
--- a/drivers/iommu/intel_irq_remapping.c
+++ b/drivers/iommu/intel_irq_remapping.c
@@ -512,23 +512,6 @@ static int __init dmar_x2apic_optout(void)
static int __init intel_irq_remapping_supported(void)
{
- if (disable_irq_remap)
- return 0;
- if (irq_remap_broken) {
- printk(KERN_WARNING
- "This system BIOS has enabled interrupt remapping\n"
- "on a chipset that contains an erratum making that\n"
- "feature unstable. To maintain system stability\n"
- "interrupt remapping is being disabled. Please\n"
- "contact your BIOS vendor for an update\n");
- add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
- disable_irq_remap = 1;
- return 0;
- }
-
- if (!dmar_ir_support())
- return 0;
-
return 1;
}
@@ -553,6 +536,24 @@ static int __init intel_prepare_irq_remapping(void)
struct dmar_drhd_unit *drhd;
struct intel_iommu *iommu;
+ /* First check whether IRQ remapping should be enabled */
+ if (disable_irq_remap)
+ return -1;
+
+ /* Are we running on sane hardware? */
+ if (irq_remap_broken) {
+ printk(KERN_WARNING
+ "This system BIOS has enabled interrupt remapping\n"
+ "on a chipset that contains an erratum making that\n"
+ "feature unstable. To maintain system stability\n"
+ "interrupt remapping is being disabled. Please\n"
+ "contact your BIOS vendor for an update\n");
+ add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
+ disable_irq_remap = 1;
+ return -1;
+ }
+
+ /* Everthing seems fine so far, parse the DMAR table */
if (dmar_table_init() < 0)
return -1;
@@ -561,6 +562,10 @@ static int __init intel_prepare_irq_remapping(void)
goto error;
}
+ /* Is interrupt remapping supported by hardware? */
+ if (!dmar_ir_support())
+ return 0;
+
/* First make sure all IOMMUs support IRQ remapping */
for_each_iommu(iommu, drhd)
if (!ecap_ir_support(iommu->ecap))
--
1.9.1
next prev parent reply other threads:[~2014-12-15 15:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-15 15:13 [PATCH 0/5] Fix Intel IRQ remapping initialization order Joerg Roedel
2014-12-15 15:13 ` Joerg Roedel
[not found] ` <1418656404-28575-1-git-send-email-joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2014-12-15 15:13 ` [PATCH 1/5] iommu/vt-d: Allocate IRQ remapping data structures only for all IOMMUs Joerg Roedel
2014-12-15 15:13 ` Joerg Roedel
2014-12-15 15:13 ` [PATCH 2/5] iommu/vt-d: Don't check for ecap_ir_support in intel_irq_remapping_supported Joerg Roedel
2014-12-15 15:13 ` Joerg Roedel
2014-12-15 15:13 ` Joerg Roedel [this message]
2014-12-15 15:13 ` [PATCH 3/5] iommu/vt-d: Move supported-checks to intel_prepare_irq_remapping() Joerg Roedel
2014-12-15 15:13 ` [PATCH 4/5] iommu/amd: Check for irq-remap support amd_iommu_prepare() Joerg Roedel
2014-12-15 15:13 ` Joerg Roedel
2014-12-15 15:13 ` [PATCH 5/5] iommu, x86, apic: Remove irq_remapping_supported() Joerg Roedel
2014-12-15 15:13 ` Joerg Roedel
2014-12-15 15:30 ` [PATCH 0/5] Fix Intel IRQ remapping initialization order Jiang Liu
2014-12-15 15:30 ` Jiang Liu
[not found] ` <548EFE88.3000307-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2014-12-15 19:54 ` Thomas Gleixner
2014-12-15 19:54 ` Thomas Gleixner
2014-12-16 1:45 ` Jiang Liu
2014-12-16 1:45 ` Jiang Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1418656404-28575-4-git-send-email-joro@8bytes.org \
--to=joro-zlv9swrftaidnm+yrofe0a@public.gmane.org \
--cc=bp-Gina5bIWoIWzQB+pC5nmwQ@public.gmane.org \
--cc=hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=jiang.liu-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=jroedel-l3A5Bk7waGM@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
--cc=x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.