X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fpci%2Fdmar.c;h=f941f609dbf399edfd389b4ace85a07816a5e633;hb=cce3ce89c1abde1298dd0e769ab9c14ea95d7384;hp=5dfdfdac92e1bc83862707aab71d356d47a36eff;hpb=43cd73658d8077ee6899b0b5029aad0cba1e9f92;p=linux-2.6 diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c index 5dfdfdac92..f941f609db 100644 --- a/drivers/pci/dmar.c +++ b/drivers/pci/dmar.c @@ -14,17 +14,20 @@ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307 USA. * - * Copyright (C) Ashok Raj - * Copyright (C) Shaohua Li - * Copyright (C) Anil S Keshavamurthy + * Copyright (C) 2006-2008 Intel Corporation + * Author: Ashok Raj + * Author: Shaohua Li + * Author: Anil S Keshavamurthy * - * This file implements early detection/parsing of DMA Remapping Devices + * This file implements early detection/parsing of DMA Remapping Devices * reported to OS through BIOS via DMA remapping reporting (DMAR) ACPI * tables. */ #include #include +#include "iova.h" +#include "intel-iommu.h" #undef PREFIX #define PREFIX "DMAR:" @@ -263,8 +266,8 @@ parse_dmar_table(void) if (!dmar) return -ENODEV; - if (!dmar->width) { - printk (KERN_WARNING PREFIX "Zero: Invalid DMAR haw\n"); + if (dmar->width < PAGE_SHIFT_4K - 1) { + printk(KERN_WARNING PREFIX "Invalid DMAR haw\n"); return -EINVAL; } @@ -301,11 +304,24 @@ parse_dmar_table(void) int __init dmar_table_init(void) { - parse_dmar_table(); + int ret; + + ret = parse_dmar_table(); + if (ret) { + printk(KERN_INFO PREFIX "parse DMAR table failure.\n"); + return ret; + } + if (list_empty(&dmar_drhd_units)) { printk(KERN_INFO PREFIX "No DMAR devices found\n"); return -ENODEV; } + + if (list_empty(&dmar_rmrr_units)) { + printk(KERN_INFO PREFIX "No RMRR found\n"); + return -ENODEV; + } + return 0; }