[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1183540736.7054.7.camel@twins>
Date: Wed, 04 Jul 2007 11:18:56 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: "Keshavamurthy, Anil S" <anil.s.keshavamurthy@...el.com>
Cc: akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
ak@...e.de, gregkh@...e.de, muli@...ibm.com,
suresh.b.siddha@...el.com, arjan@...ux.intel.com,
ashok.raj@...el.com, davem@...emloft.net, clameter@....com
Subject: Re: [Intel IOMMU 01/10] DMAR detection and parsing logic
On Tue, 2007-06-19 at 14:37 -0700, Keshavamurthy, Anil S wrote:
> plain text document attachment (dmar_detection.patch)
> +/**
> + * parse_dmar_table - parses the DMA reporting table
> + */
> +static int __init
> +parse_dmar_table(void)
> +{
> + struct acpi_table_dmar *dmar;
> + struct acpi_dmar_header *entry_header;
> + int ret = 0;
> +
> + dmar = (struct acpi_table_dmar *)dmar_tbl;
> +
> + if (!dmar->width) {
^^^^^^^^^^^^^^^^^^^
That goes *splat* on my opteron box.
> + printk (KERN_WARNING PREFIX "Zero: Invalid DMAR haw\n");
> + return -EINVAL;
> + }
> +
> + printk (KERN_INFO PREFIX "Host address width %d\n",
> + dmar->width + 1);
> +
> + entry_header = (struct acpi_dmar_header *)(dmar + 1);
> + while (((unsigned long)entry_header) <
> + (((unsigned long)dmar) + dmar_tbl->length)) {
> + dmar_table_print_dmar_entry(entry_header);
> +
> + switch (entry_header->type) {
> + case ACPI_DMAR_TYPE_HARDWARE_UNIT:
> + ret = dmar_parse_one_drhd(entry_header);
> + break;
> + case ACPI_DMAR_TYPE_RESERVED_MEMORY:
> + ret = dmar_parse_one_rmrr(entry_header);
> + break;
> + default:
> + printk(KERN_WARNING PREFIX
> + "Unknown DMAR structure type\n");
> + ret = 0; /* for forward compatibility */
> + break;
> + }
> + if (ret)
> + break;
> +
> + entry_header = ((void *)entry_header + entry_header->length);
> + }
> + return ret;
> +}
> +
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists