Merge branch 'ecam-accessors' into guard (ECAM page identity check)
This commit is contained in:
@@ -276,6 +276,23 @@ static void __iomem *imc_map_ecam(struct pci_dev *pdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
acpi_put_table(&mcfg->header);
|
acpi_put_table(&mcfg->header);
|
||||||
|
if (!map)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A wrong page here would make every engine write land on some other
|
||||||
|
* function - the exact failure mode this path exists to remove.
|
||||||
|
* Word 0 is the one register whose value is known in advance; require
|
||||||
|
* it before trusting the mapping with writes.
|
||||||
|
*/
|
||||||
|
if (readl(map) != (PCU_DEVICE << 16 | PCI_VENDOR_ID_INTEL)) {
|
||||||
|
dev_warn(&pdev->dev,
|
||||||
|
"ECAM page does not identify as %04x:%04x; not using it\n",
|
||||||
|
PCI_VENDOR_ID_INTEL, PCU_DEVICE);
|
||||||
|
devm_iounmap(&pdev->dev, map);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user