Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH 1/1] iommu: DMAR reporting table needs at least one DRHD

12 views
Skip to first unread message

Li, Zhen-Hua

unread,
May 20, 2013, 4:00:02 AM5/20/13
to
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...@hp.com>
---
drivers/iommu/dmar.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
index a7967ce..4739211 100644
--- a/drivers/iommu/dmar.c
+++ b/drivers/iommu/dmar.c
@@ -309,6 +309,7 @@ parse_dmar_table(void)
struct acpi_table_dmar *dmar;
struct acpi_dmar_header *entry_header;
int ret = 0;
+ int drhd_count = 0;

/*
* Do it again, earlier dmar_tbl mapping could be mapped with
@@ -347,6 +348,7 @@ parse_dmar_table(void)

switch (entry_header->type) {
case ACPI_DMAR_TYPE_HARDWARE_UNIT:
+ drhd_count++;
ret = dmar_parse_one_drhd(entry_header);
break;
case ACPI_DMAR_TYPE_RESERVED_MEMORY:
@@ -371,6 +373,8 @@ parse_dmar_table(void)

entry_header = ((void *)entry_header + entry_header->length);
}
+ if (drhd_count == 0)
+ pr_warn("There is no DRHD structure.");
return ret;
}

--
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Joerg Roedel

unread,
Jun 20, 2013, 10:50:03 AM6/20/13
to
On Mon, May 20, 2013 at 03:57:32PM +0800, Li, Zhen-Hua wrote:
> 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...@hp.com>

Tweaked the error message a bit and applied to x86/vt-d, thanks.
0 new messages