mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org, andi@firstfloor.org,
	arjan@infradead.org, torvalds@linux-foundation.org,
	sfr@canb.auug.org.au, Jesse Barnes <jbarnes@virtuousgeek.org>
Subject: Re: [PATCH] Blacklist DMAR on Intel G31/G33 chipsets
Date: Fri, 05 Sep 2008 19:47:09 +0100	[thread overview]
Message-ID: <1220640430.2985.389.camel@pmac.infradead.org> (raw)
In-Reply-To: <20080905183459.GC14258@elte.hu>

On Fri, 2008-09-05 at 20:34 +0200, Ingo Molnar wrote:
> * David Woodhouse <dwmw2@infradead.org> wrote:
> 
> > Some BIOSes (the Intel DG33BU, for example) wrongly claim to have DMAR
> > when they don't. Avoid the resulting crashes when it doesn't work as
> > expected.
> > 
> > Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
> > ---
> > 
> > This time, I build-tested it with CONFIG_DMAR actually enabled. Sorry. 
> > I'd still be grateful if someone could test it on a DG33BU with the 
> > old BIOS though, since I've killed mine. I tested the DMI version, but 
> > not this one.
> 
> ok - fixing this makes sense. I have two worries about this patch.
> 
> Firstly, the quirk is keyed off an ACPI capability which is quite bad if 
> someone boots with ACPI off. (which is still quite possible) The DMAR is 
> PCI enumerated so there's nothing inherently ACPI about this. A DMI 
> quirk (which will work even if ACPI is disabled) looks more robust.

No, the intel-iommu code is isn't PCI-enumerated -- it all depends on
that ACPI table, unfortunately. That's why we're have this problem in
the first place and why I'm left with a dead board; apparently they
still drag crack-smoking hobos in off the street to write BIOSes, and
we're trusting more and more of our system to this crap every day.

I'm perfectly happy to go back to my original DMI-based version though.
Here it is...

Subject: Blacklist DMAR on Intel G31/G33 chipsets
    
Some BIOSes (the Intel DG33BU, for example) wrongly claim to have DMAR
when they don't. Avoid the resulting crashes when it doesn't work as
expected.
    
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>


diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 8d0e60a..c3edcdc 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -2348,11 +2348,34 @@ static void __init iommu_exit_mempool(void)
 
 }
 
+static int blacklist_iommu(const struct dmi_system_id *id)
+{
+	printk(KERN_INFO "%s detected; disabling IOMMU\n",
+	       id->ident);
+	dmar_disabled = 1;
+	return 0;
+}
+
+static struct dmi_system_id __initdata intel_iommu_dmi_table[] = {
+	{	/* Some DG33BU BIOS revisions advertised non-existent VT-d */
+		.callback = blacklist_iommu,
+		.ident = "Intel DG33BU",
+		{	DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
+			DMI_MATCH(DMI_BOARD_NAME, "DG33BU"),
+		}
+	},
+	{ }
+};
+
+
 void __init detect_intel_iommu(void)
 {
 	if (swiotlb || no_iommu || iommu_detected || dmar_disabled)
 		return;
 	if (early_dmar_detect()) {
+		dmi_check_system(intel_iommu_dmi_table);
+		if (dmar_disabled)
+			return;
 		iommu_detected = 1;
 	}
 }


-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation




  reply	other threads:[~2008-09-05 18:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-01 20:14 Misc fixes for 2.6.27 David Woodhouse
2008-09-01 22:32 ` Andi Kleen
2008-09-01 22:35   ` Arjan van de Ven
2008-09-01 23:01     ` Andi Kleen
2008-09-01 23:16       ` Arjan van de Ven
2008-09-02  6:19         ` Andi Kleen
2008-09-02  8:23           ` David Woodhouse
2008-09-03 10:53           ` Blacklist DMAR on Intel G31/G33 chipsets David Woodhouse
2008-09-03 12:09             ` Andi Kleen
2008-09-03 12:22               ` David Woodhouse
2008-09-04  8:54             ` [PATCH] " David Woodhouse
2008-09-05 18:34               ` Ingo Molnar
2008-09-05 18:47                 ` David Woodhouse [this message]
2008-09-06 15:49                   ` Ingo Molnar
2008-09-07  8:20                     ` David Woodhouse
2008-09-07 15:35                 ` [2.6.27 PATCH] " David Woodhouse
2008-09-09 18:39                   ` Jesse Barnes

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=1220640430.2985.389.camel@pmac.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=andi@firstfloor.org \
    --cc=arjan@infradead.org \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=sfr@canb.auug.org.au \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®