Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176890
b: refs/heads/master
c: 2c99220
h: refs/heads/master
v: v3
  • Loading branch information
Chris Wright authored and David Woodhouse committed Dec 8, 2009
1 parent 28ea567 commit dbc107a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ec208491936d6adb8a70c3dd4a517cdfe54e823d
refs/heads/master: 2c99220810c1c79322034628b993573b088ff2da
34 changes: 29 additions & 5 deletions trunk/drivers/pci/dmar.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,9 @@ int __init check_zero_address(void)
}

if (entry_header->type == ACPI_DMAR_TYPE_HARDWARE_UNIT) {
void __iomem *addr;
u64 cap, ecap;

drhd = (void *)entry_header;
if (!drhd->address) {
/* Promote an attitude of violence to a BIOS engineer today */
Expand All @@ -640,17 +643,38 @@ int __init check_zero_address(void)
dmi_get_system_info(DMI_BIOS_VENDOR),
dmi_get_system_info(DMI_BIOS_VERSION),
dmi_get_system_info(DMI_PRODUCT_VERSION));
#ifdef CONFIG_DMAR
dmar_disabled = 1;
#endif
return 0;
goto failed;
}

addr = early_ioremap(drhd->address, VTD_PAGE_SIZE);
if (!addr ) {
printk("IOMMU: can't validate: %llx\n", drhd->address);
goto failed;
}
cap = dmar_readq(addr + DMAR_CAP_REG);
ecap = dmar_readq(addr + DMAR_ECAP_REG);
early_iounmap(addr, VTD_PAGE_SIZE);
if (cap == (uint64_t)-1 && ecap == (uint64_t)-1) {
/* Promote an attitude of violence to a BIOS engineer today */
WARN(1, "Your BIOS is broken; DMAR reported at address %llx returns all ones!\n"
"BIOS vendor: %s; Ver: %s; Product Version: %s\n",
drhd->address,
dmi_get_system_info(DMI_BIOS_VENDOR),
dmi_get_system_info(DMI_BIOS_VERSION),
dmi_get_system_info(DMI_PRODUCT_VERSION));
goto failed;
}
break;
}

entry_header = ((void *)entry_header + entry_header->length);
}
return 1;

failed:
#ifdef CONFIG_DMAR
dmar_disabled = 1;
#endif
return 0;
}

void __init detect_intel_iommu(void)
Expand Down

0 comments on commit dbc107a

Please sign in to comment.