diff options
author | David Woodhouse <dwmw2@infradead.org> | 2009-05-05 09:25:28 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-05-08 15:45:10 -0700 |
commit | b68f007ad8ec30e567b42f839268e89ad2cabd63 (patch) | |
tree | 2a9428a9931880e5d6673ffedeef4d627067805a | |
parent | a4392e8b0e6ee266a19f6db90c4d56d267a58b4f (diff) |
intel-iommu: Avoid panic() for DRHD at address zero.
(cherry picked from commit e523b38e2f568af58baa13120a994cbf24e6dee0)
If the BIOS does something obviously stupid, like claiming that the
registers for the IOMMU are at physical address zero, then print a nasty
message and abort, rather than trying to set up the IOMMU and then later
panicking.
It's becoming more and more obvious that trusting this stuff to the BIOS
was a mistake.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/pci/dmar.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c index 26c536b51c5..8a011207b15 100644 --- a/drivers/pci/dmar.c +++ b/drivers/pci/dmar.c @@ -170,12 +170,21 @@ dmar_parse_one_drhd(struct acpi_dmar_header *header) struct dmar_drhd_unit *dmaru; int ret = 0; + drhd = (struct acpi_dmar_hardware_unit *)header; + if (!drhd->address) { + /* Promote an attitude of violence to a BIOS engineer today */ + WARN(1, "Your BIOS is broken; DMAR reported at address zero!\n" + "BIOS vendor: %s; Ver: %s; Product Version: %s\n", + dmi_get_system_info(DMI_BIOS_VENDOR), + dmi_get_system_info(DMI_BIOS_VERSION), + dmi_get_system_info(DMI_PRODUCT_VERSION)); + return -ENODEV; + } dmaru = kzalloc(sizeof(*dmaru), GFP_KERNEL); if (!dmaru) return -ENOMEM; dmaru->hdr = header; - drhd = (struct acpi_dmar_hardware_unit *)header; dmaru->reg_base_addr = drhd->address; dmaru->include_all = drhd->flags & 0x1; /* BIT0: INCLUDE_ALL */ |