[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] VT-d: don't reject possibly valid DRHD or RMRR
# HG changeset patch # User Jan Beulich <jbeulich@xxxxxxxx> # Date 1318002650 -7200 # Node ID 6a9466e1753df115a91d32214af124f04a99cfdd # Parent eec5d0b44f76ebe748a6279f5c847d719bdc72e6 VT-d: don't reject possibly valid DRHD or RMRR If a non-zero PCI segment isn't accessible during Xen boot (because firmware decided to not enter the necessary MMIO space into the E820 table), devices referred to on those segments through DRHD or RMRR structures should not be rejected just because the devices can't be found. This is in line with what is being done in at least one other case already: Systems with more than one PCI segment (usually high end ones) are assumed to have valid firmware provided data, while systems with just segment 0 continue to have their firmware tables validated. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> Acked-by: "Kay, Allen M" <allen.m.kay@xxxxxxxxx> --- diff -r eec5d0b44f76 -r 6a9466e1753d xen/drivers/passthrough/pci.c --- a/xen/drivers/passthrough/pci.c Fri Oct 07 14:33:15 2011 +0100 +++ b/xen/drivers/passthrough/pci.c Fri Oct 07 17:50:50 2011 +0200 @@ -53,6 +53,11 @@ return radix_tree_lookup(&pci_segments, seg); } +bool_t pci_known_segment(u16 seg) +{ + return get_pseg(seg) != NULL; +} + static struct pci_seg *alloc_pseg(u16 seg) { struct pci_seg *pseg = get_pseg(seg); diff -r eec5d0b44f76 -r 6a9466e1753d xen/drivers/passthrough/vtd/dmar.c --- a/xen/drivers/passthrough/vtd/dmar.c Fri Oct 07 14:33:15 2011 +0100 +++ b/xen/drivers/passthrough/vtd/dmar.c Fri Oct 07 17:50:50 2011 +0200 @@ -442,10 +442,14 @@ else { u8 b, d, f; - int i, invalid_cnt = 0; + unsigned int i = 0, invalid_cnt = 0; void *p; - for ( i = 0, p = dev_scope_start; i < dmaru->scope.devices_cnt; + /* Skip checking if segment is not accessible yet. */ + if ( !pci_known_segment(drhd->segment) ) + i = UINT_MAX; + + for ( p = dev_scope_start; i < dmaru->scope.devices_cnt; i++, p += ((struct acpi_dev_scope *)p)->length ) { if ( ((struct acpi_dev_scope *)p)->dev_type == ACPI_DEV_IOAPIC || @@ -546,7 +550,12 @@ else { u8 b, d, f; - int i, ignore = 0; + bool_t ignore = 0; + unsigned int i = 0; + + /* Skip checking if segment is not accessible yet. */ + if ( !pci_known_segment(rmrr->segment) ) + i = UINT_MAX; for ( i = 0; i < rmrru->scope.devices_cnt; i++ ) { diff -r eec5d0b44f76 -r 6a9466e1753d xen/include/xen/pci.h --- a/xen/include/xen/pci.h Fri Oct 07 14:33:15 2011 +0100 +++ b/xen/include/xen/pci.h Fri Oct 07 17:50:50 2011 +0200 @@ -82,6 +82,7 @@ DEV_TYPE_PCI, }; +bool_t pci_known_segment(u16 seg); int pci_device_detect(u16 seg, u8 bus, u8 dev, u8 func); int scan_pci_devices(void); int pdev_type(u16 seg, u8 bus, u8 devfn); _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |