aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorLi, Zhen-Hua <zhen-hual@hp.com>2013-05-20 03:57:32 -0400
committerJoerg Roedel <joro@8bytes.org>2013-06-20 10:39:28 -0400
commit7cef33471a35c6973ddad2926e9e88c52e9e1c1b (patch)
tree9ff69be5ade7bb02c85f67a04992986c80c16072 /drivers/iommu
parentd01140df6a32554728ab055f2d82f8028a73d2f5 (diff)
iommu/vt-d: DMAR reporting table needs at least one DRHD
In intel vt-d spec , chapter 8.1 , DMA Remapping Reporting Structure. In the end of the table, it says: Remapping Structures[] - A list of structures. The list will contain one or more DMA Remapping Hardware Unit Definition (DRHD) structures, and zero or more Reserved Memory Region Reporting (RMRR) and Root Port ATS Capability Reporting (ATSR) structures. These structures are described below. So, there should be at least one DRHD structure in DMA Remapping reporting table. If there is no DRHD found, a warning is necessary. Signed-off-by: Li, Zhen-Hua <zhen-hual@hp.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/dmar.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
index a7967ceb79e6..785675a56a10 100644
--- a/drivers/iommu/dmar.c
+++ b/drivers/iommu/dmar.c
@@ -309,6 +309,7 @@ parse_dmar_table(void)
309 struct acpi_table_dmar *dmar; 309 struct acpi_table_dmar *dmar;
310 struct acpi_dmar_header *entry_header; 310 struct acpi_dmar_header *entry_header;
311 int ret = 0; 311 int ret = 0;
312 int drhd_count = 0;
312 313
313 /* 314 /*
314 * Do it again, earlier dmar_tbl mapping could be mapped with 315 * Do it again, earlier dmar_tbl mapping could be mapped with
@@ -347,6 +348,7 @@ parse_dmar_table(void)
347 348
348 switch (entry_header->type) { 349 switch (entry_header->type) {
349 case ACPI_DMAR_TYPE_HARDWARE_UNIT: 350 case ACPI_DMAR_TYPE_HARDWARE_UNIT:
351 drhd_count++;
350 ret = dmar_parse_one_drhd(entry_header); 352 ret = dmar_parse_one_drhd(entry_header);
351 break; 353 break;
352 case ACPI_DMAR_TYPE_RESERVED_MEMORY: 354 case ACPI_DMAR_TYPE_RESERVED_MEMORY:
@@ -371,6 +373,8 @@ parse_dmar_table(void)
371 373
372 entry_header = ((void *)entry_header + entry_header->length); 374 entry_header = ((void *)entry_header + entry_header->length);
373 } 375 }
376 if (drhd_count == 0)
377 pr_warn(FW_BUG "No DRHD structure found in DMAR table\n");
374 return ret; 378 return ret;
375} 379}
376 380