intel-iommu: Check for an RMRR which ends before it starts.
Some HP BIOSes report an RMRR region (a region which needs a 1:1 mapping in the IOMMU for a given device) which has an end address lower than its start address. Detect that and warn, rather than triggering the BUG() in dma_pte_clear_range(). Cc: stable@kernel.org Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
parent
6ecbf01c7c
commit
5595b528b4
|
@ -2000,6 +2000,16 @@ static int iommu_prepare_identity_map(struct pci_dev *pdev,
|
||||||
"IOMMU: Setting identity map for device %s [0x%Lx - 0x%Lx]\n",
|
"IOMMU: Setting identity map for device %s [0x%Lx - 0x%Lx]\n",
|
||||||
pci_name(pdev), start, end);
|
pci_name(pdev), start, end);
|
||||||
|
|
||||||
|
if (end < start) {
|
||||||
|
WARN(1, "Your BIOS is broken; RMRR ends before it starts!\n"
|
||||||
|
"BIOS vendor: %s; Ver: %s; Product Version: %s\n",
|
||||||
|
dmi_get_system_info(DMI_BIOS_VENDOR),
|
||||||
|
dmi_get_system_info(DMI_BIOS_VERSION),
|
||||||
|
dmi_get_system_info(DMI_PRODUCT_VERSION));
|
||||||
|
ret = -EIO;
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
if (end >> agaw_to_width(domain->agaw)) {
|
if (end >> agaw_to_width(domain->agaw)) {
|
||||||
WARN(1, "Your BIOS is broken; RMRR exceeds permitted address width (%d bits)\n"
|
WARN(1, "Your BIOS is broken; RMRR exceeds permitted address width (%d bits)\n"
|
||||||
"BIOS vendor: %s; Ver: %s; Product Version: %s\n",
|
"BIOS vendor: %s; Ver: %s; Product Version: %s\n",
|
||||||
|
|
Loading…
Reference in a new issue