Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge git://git.infradead.org/iommu-2.6

* git://git.infradead.org/iommu-2.6:
intel-iommu: Avoid panic() for DRHD at address zero.
Intel-IOMMU Alignment Issue in dma_pte_clear_range()

+12 -3
+10 -1
drivers/pci/dmar.c
··· 173 173 struct dmar_drhd_unit *dmaru; 174 174 int ret = 0; 175 175 176 + drhd = (struct acpi_dmar_hardware_unit *)header; 177 + if (!drhd->address) { 178 + /* Promote an attitude of violence to a BIOS engineer today */ 179 + WARN(1, "Your BIOS is broken; DMAR reported at address zero!\n" 180 + "BIOS vendor: %s; Ver: %s; Product Version: %s\n", 181 + dmi_get_system_info(DMI_BIOS_VENDOR), 182 + dmi_get_system_info(DMI_BIOS_VERSION), 183 + dmi_get_system_info(DMI_PRODUCT_VERSION)); 184 + return -ENODEV; 185 + } 176 186 dmaru = kzalloc(sizeof(*dmaru), GFP_KERNEL); 177 187 if (!dmaru) 178 188 return -ENOMEM; 179 189 180 190 dmaru->hdr = header; 181 - drhd = (struct acpi_dmar_hardware_unit *)header; 182 191 dmaru->reg_base_addr = drhd->address; 183 192 dmaru->segment = drhd->segment; 184 193 dmaru->include_all = drhd->flags & 0x1; /* BIT0: INCLUDE_ALL */
+2 -2
drivers/pci/intel-iommu.c
··· 733 733 start &= (((u64)1) << addr_width) - 1; 734 734 end &= (((u64)1) << addr_width) - 1; 735 735 /* in case it's partial page */ 736 - start = PAGE_ALIGN(start); 737 - end &= PAGE_MASK; 736 + start &= PAGE_MASK; 737 + end = PAGE_ALIGN(end); 738 738 npages = (end - start) / VTD_PAGE_SIZE; 739 739 740 740 /* we don't need lock here, nobody else touches the iova range */