mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-24 01:41:39 +00:00
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>
This commit is contained in:
parent
d01140df6a
commit
7cef33471a
1 changed files with 4 additions and 0 deletions
|
@ -309,6 +309,7 @@ parse_dmar_table(void)
|
||||||
struct acpi_table_dmar *dmar;
|
struct acpi_table_dmar *dmar;
|
||||||
struct acpi_dmar_header *entry_header;
|
struct acpi_dmar_header *entry_header;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
int drhd_count = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Do it again, earlier dmar_tbl mapping could be mapped with
|
* Do it again, earlier dmar_tbl mapping could be mapped with
|
||||||
|
@ -347,6 +348,7 @@ parse_dmar_table(void)
|
||||||
|
|
||||||
switch (entry_header->type) {
|
switch (entry_header->type) {
|
||||||
case ACPI_DMAR_TYPE_HARDWARE_UNIT:
|
case ACPI_DMAR_TYPE_HARDWARE_UNIT:
|
||||||
|
drhd_count++;
|
||||||
ret = dmar_parse_one_drhd(entry_header);
|
ret = dmar_parse_one_drhd(entry_header);
|
||||||
break;
|
break;
|
||||||
case ACPI_DMAR_TYPE_RESERVED_MEMORY:
|
case ACPI_DMAR_TYPE_RESERVED_MEMORY:
|
||||||
|
@ -371,6 +373,8 @@ parse_dmar_table(void)
|
||||||
|
|
||||||
entry_header = ((void *)entry_header + entry_header->length);
|
entry_header = ((void *)entry_header + entry_header->length);
|
||||||
}
|
}
|
||||||
|
if (drhd_count == 0)
|
||||||
|
pr_warn(FW_BUG "No DRHD structure found in DMAR table\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue