16 Apr, 2014

1 commit


15 Apr, 2014

4 commits

  • kernel panic happened when iommu_unmap a buffer larger than 2MB,
    more than expected pmd entries got “invalidated”, due to a wrong range
    passed to arm_smmu_alloc_init_pte. it was likely a typo, now we fix
    it, passing the correct "end" address to arm_smmu_alloc_init_pte.

    Signed-off-by: Bin Wang
    Signed-off-by: Will Deacon

    Bin Wang
     
  • The IOMMU core expects the unmap operation to return the number of bytes
    that have been unmapped or 0 on failure, a negative return value being
    treated like a number of bytes.

    Signed-off-by: Laurent Pinchart
    Signed-off-by: Will Deacon

    Laurent Pinchart
     
  • Commit "59ce0515cdaf iommu/vt-d: Update DRHD/RMRR/ATSR device scope
    caches when PCI hotplug happens" introduces a bug, which fails to
    match PCI devices with DMAR device scope entries if PCI path array
    in the entry has more than one level.

    For example, it fails to handle
    [1D2h 0466 1] Device Scope Entry Type : 01
    [1D3h 0467 1] Entry Length : 0A
    [1D4h 0468 2] Reserved : 0000
    [1D6h 0470 1] Enumeration ID : 00
    [1D7h 0471 1] PCI Bus Number : 00
    [1D8h 0472 2] PCI Path : 1C,04
    [1DAh 0474 2] PCI Path : 00,02

    And cause DMA failure on HP DL980 as:
    DMAR:[fault reason 02] Present bit in context entry is clear
    dmar: DRHD: handling fault status reg 602
    dmar: DMAR:[DMA Read] Request device [02:00.2] fault addr 7f61e000

    Reported-and-tested-by: Davidlohr Bueso
    Signed-off-by: Jiang Liu
    Signed-off-by: David Woodhouse

    Jiang Liu
     
  • Commit 146922ec79 ("iommu/vt-d: Make get_domain_for_dev() take struct
    device") introduced new variables bridge_bus and bridge_devfn to
    identify the upstream PCIe to PCI bridge responsible for the given
    target device. Leaving the original bus/devfn variables to identify
    the target device itself, now that it is no longer assumed to be PCI
    and we can no longer trivially find that information.

    However, the patch failed to correctly use the new variables in all
    cases; instead using the as-yet-uninitialised 'bus' and 'devfn'
    variables.

    Reported-by: Alex Williamson
    Signed-off-by: David Woodhouse

    David Woodhouse
     

13 Apr, 2014

1 commit

  • Commit ea8ea46 "iommu/vt-d: Clean up and fix page table clear/free
    behaviour" introduces possible leakage of DMA page tables due to:
    for (pte = page_address(pg); !first_pte_in_page(pte); pte++) {
    if (dma_pte_present(pte) && !dma_pte_superpage(pte))
    freelist = dma_pte_list_pagetables(domain, level - 1,
    pte, freelist);
    }

    For the first pte in a page, first_pte_in_page(pte) will always be true,
    thus dma_pte_list_pagetables() will never be called and leak DMA page
    tables if level is bigger than 1.

    Signed-off-by: Jiang Liu
    Signed-off-by: David Woodhouse

    Jiang Liu
     

06 Apr, 2014

1 commit

  • Pull IOMMU upates from Joerg Roedel:
    "This time a few more updates queued up.

    - Rework VT-d code to support ACPI devices

    - Improvements for memory and PCI hotplug support in the VT-d driver

    - Device-tree support for OMAP IOMMU

    - Convert OMAP IOMMU to use devm_* interfaces

    - Fixed PASID support for AMD IOMMU

    - Other random cleanups and fixes for OMAP, ARM-SMMU and SHMOBILE
    IOMMU

    Most of the changes are in the VT-d driver because some rework was
    necessary for better hotplug and ACPI device support"

    * tag 'iommu-updates-v3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (75 commits)
    iommu/vt-d: Fix error handling in ANDD processing
    iommu/vt-d: returning free pointer in get_domain_for_dev()
    iommu/vt-d: Only call dmar_acpi_dev_scope_init() if DRHD units present
    iommu/vt-d: Check for NULL pointer in dmar_acpi_dev_scope_init()
    iommu/amd: Fix logic to determine and checking max PASID
    iommu/vt-d: Include ACPI devices in iommu=pt
    iommu/vt-d: Finally enable translation for non-PCI devices
    iommu/vt-d: Remove to_pci_dev() in intel_map_page()
    iommu/vt-d: Remove pdev from intel_iommu_attach_device()
    iommu/vt-d: Remove pdev from iommu_no_mapping()
    iommu/vt-d: Make domain_add_dev_info() take struct device
    iommu/vt-d: Make domain_remove_one_dev_info() take struct device
    iommu/vt-d: Rename 'hwdev' variables to 'dev' now that that's the norm
    iommu/vt-d: Remove some pointless to_pci_dev() calls
    iommu/vt-d: Make get_valid_domain_for_dev() take struct device
    iommu/vt-d: Make iommu_should_identity_map() take struct device
    iommu/vt-d: Handle RMRRs for non-PCI devices
    iommu/vt-d: Make get_domain_for_dev() take struct device
    iommu/vt-d: Make domain_context_mapp{ed,ing}() take struct device
    iommu/vt-d: Make device_to_iommu() cope with non-PCI devices
    ...

    Linus Torvalds
     

03 Apr, 2014

2 commits


02 Apr, 2014

1 commit

  • Pull PCI changes from Bjorn Helgaas:
    "Enumeration
    - Increment max correctly in pci_scan_bridge() (Andreas Noever)
    - Clarify the "scan anyway" comment in pci_scan_bridge() (Andreas Noever)
    - Assign CardBus bus number only during the second pass (Andreas Noever)
    - Use request_resource_conflict() instead of insert_ for bus numbers (Andreas Noever)
    - Make sure bus number resources stay within their parents bounds (Andreas Noever)
    - Remove pci_fixup_parent_subordinate_busnr() (Andreas Noever)
    - Check for child busses which use more bus numbers than allocated (Andreas Noever)
    - Don't scan random busses in pci_scan_bridge() (Andreas Noever)
    - x86: Drop pcibios_scan_root() check for bus already scanned (Bjorn Helgaas)
    - x86: Use pcibios_scan_root() instead of pci_scan_bus_with_sysdata() (Bjorn Helgaas)
    - x86: Use pcibios_scan_root() instead of pci_scan_bus_on_node() (Bjorn Helgaas)
    - x86: Merge pci_scan_bus_on_node() into pcibios_scan_root() (Bjorn Helgaas)
    - x86: Drop return value of pcibios_scan_root() (Bjorn Helgaas)

    NUMA
    - x86: Add x86_pci_root_bus_node() to look up NUMA node from PCI bus (Bjorn Helgaas)
    - x86: Use x86_pci_root_bus_node() instead of get_mp_bus_to_node() (Bjorn Helgaas)
    - x86: Remove mp_bus_to_node[], set_mp_bus_to_node(), get_mp_bus_to_node() (Bjorn Helgaas)
    - x86: Use NUMA_NO_NODE, not -1, for unknown node (Bjorn Helgaas)
    - x86: Remove acpi_get_pxm() usage (Bjorn Helgaas)
    - ia64: Use NUMA_NO_NODE, not MAX_NUMNODES, for unknown node (Bjorn Helgaas)
    - ia64: Remove acpi_get_pxm() usage (Bjorn Helgaas)
    - ACPI: Fix acpi_get_node() prototype (Bjorn Helgaas)

    Resource management
    - i2o: Fix and refactor PCI space allocation (Bjorn Helgaas)
    - Add resource_contains() (Bjorn Helgaas)
    - Add %pR support for IORESOURCE_UNSET (Bjorn Helgaas)
    - Mark resources as IORESOURCE_UNSET if we can't assign them (Bjorn Helgaas)
    - Don't clear IORESOURCE_UNSET when updating BAR (Bjorn Helgaas)
    - Check IORESOURCE_UNSET before updating BAR (Bjorn Helgaas)
    - Don't try to claim IORESOURCE_UNSET resources (Bjorn Helgaas)
    - Mark 64-bit resource as IORESOURCE_UNSET if we only support 32-bit (Bjorn Helgaas)
    - Don't enable decoding if BAR hasn't been assigned an address (Bjorn Helgaas)
    - Add "weak" generic pcibios_enable_device() implementation (Bjorn Helgaas)
    - alpha, microblaze, sh, sparc, tile: Use default pcibios_enable_device() (Bjorn Helgaas)
    - s390: Use generic pci_enable_resources() (Bjorn Helgaas)
    - Don't check resource_size() in pci_bus_alloc_resource() (Bjorn Helgaas)
    - Set type in __request_region() (Bjorn Helgaas)
    - Check all IORESOURCE_TYPE_BITS in pci_bus_alloc_from_region() (Bjorn Helgaas)
    - Change pci_bus_alloc_resource() type_mask to unsigned long (Bjorn Helgaas)
    - Log IDE resource quirk in dmesg (Bjorn Helgaas)
    - Revert "[PATCH] Insert GART region into resource map" (Bjorn Helgaas)

    PCI device hotplug
    - Make check_link_active() non-static (Rajat Jain)
    - Use link change notifications for hot-plug and removal (Rajat Jain)
    - Enable link state change notifications (Rajat Jain)
    - Don't disable the link permanently during removal (Rajat Jain)
    - Don't check adapter or latch status while disabling (Rajat Jain)
    - Disable link notification across slot reset (Rajat Jain)
    - Ensure very fast hotplug events are also processed (Rajat Jain)
    - Add hotplug_lock to serialize hotplug events (Rajat Jain)
    - Remove a non-existent card, regardless of "surprise" capability (Rajat Jain)
    - Don't turn slot off when hot-added device already exists (Yijing Wang)

    MSI
    - Keep pci_enable_msi() documentation (Alexander Gordeev)
    - ahci: Fix broken single MSI fallback (Alexander Gordeev)
    - ahci, vfio: Use pci_enable_msi_range() (Alexander Gordeev)
    - Check kmalloc() return value, fix leak of name (Greg Kroah-Hartman)
    - Fix leak of msi_attrs (Greg Kroah-Hartman)
    - Fix pci_msix_vec_count() htmldocs failure (Masanari Iida)

    Virtualization
    - Device-specific ACS support (Alex Williamson)

    Freescale i.MX6
    - Wait for retraining (Marek Vasut)

    Marvell MVEBU
    - Use Device ID and revision from underlying endpoint (Andrew Lunn)
    - Fix incorrect size for PCI aperture resources (Jason Gunthorpe)
    - Call request_resource() on the apertures (Jason Gunthorpe)
    - Fix potential issue in range parsing (Jean-Jacques Hiblot)

    Renesas R-Car
    - Check platform_get_irq() return code (Ben Dooks)
    - Add error interrupt handling (Ben Dooks)
    - Fix bridge logic configuration accesses (Ben Dooks)
    - Register each instance independently (Magnus Damm)
    - Break out window size handling (Magnus Damm)
    - Make the Kconfig dependencies more generic (Magnus Damm)

    Synopsys DesignWare
    - Fix RC BAR to be single 64-bit non-prefetchable memory (Mohit Kumar)

    Miscellaneous
    - Remove unused SR-IOV VF Migration support (Bjorn Helgaas)
    - Enable INTx if BIOS left them disabled (Bjorn Helgaas)
    - Fix hex vs decimal typo in cpqhpc_probe() (Dan Carpenter)
    - Clean up par-arch object file list (Liviu Dudau)
    - Set IORESOURCE_ROM_SHADOW only for the default VGA device (Sander Eikelenboom)
    - ACPI, ARM, drm, powerpc, pcmcia, PCI: Use list_for_each_entry() for bus traversal (Yijing Wang)
    - Fix pci_bus_b() build failure (Paul Gortmaker)"

    * tag 'pci-v3.15-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (108 commits)
    Revert "[PATCH] Insert GART region into resource map"
    PCI: Log IDE resource quirk in dmesg
    PCI: Change pci_bus_alloc_resource() type_mask to unsigned long
    PCI: Check all IORESOURCE_TYPE_BITS in pci_bus_alloc_from_region()
    resources: Set type in __request_region()
    PCI: Don't check resource_size() in pci_bus_alloc_resource()
    s390/PCI: Use generic pci_enable_resources()
    tile PCI RC: Use default pcibios_enable_device()
    sparc/PCI: Use default pcibios_enable_device() (Leon only)
    sh/PCI: Use default pcibios_enable_device()
    microblaze/PCI: Use default pcibios_enable_device()
    alpha/PCI: Use default pcibios_enable_device()
    PCI: Add "weak" generic pcibios_enable_device() implementation
    PCI: Don't enable decoding if BAR hasn't been assigned an address
    PCI: Enable INTx in pci_reenable_device() only when MSI/MSI-X not enabled
    PCI: Mark 64-bit resource as IORESOURCE_UNSET if we only support 32-bit
    PCI: Don't try to claim IORESOURCE_UNSET resources
    PCI: Check IORESOURCE_UNSET before updating BAR
    PCI: Don't clear IORESOURCE_UNSET when updating BAR
    PCI: Mark resources as IORESOURCE_UNSET if we can't assign them
    ...

    Conflicts:
    arch/x86/include/asm/topology.h
    drivers/ata/ahci.c

    Linus Torvalds
     

01 Apr, 2014

1 commit

  • If we failed to find an ACPI device to correspond to an ANDD record, we
    would fail to increment our pointer and would just process the same record
    over and over again, with predictable results.

    Turn it from a while() loop into a for() loop to let the 'continue' in
    the error paths work correctly.

    Signed-off-by: David Woodhouse

    David Woodhouse
     

28 Mar, 2014

2 commits


26 Mar, 2014

1 commit

  • When ir_dev_scope_init() is called via a rootfs initcall it
    will check for irq_remapping_enabled before it calls
    (indirectly) into dmar_acpi_dev_scope_init() which uses the
    dmar_tbl pointer without any checks.

    The AMD IOMMU driver also sets the irq_remapping_enabled
    flag which causes the dmar_acpi_dev_scope_init() function to
    be called on systems with AMD IOMMU hardware too, causing a
    boot-time kernel crash.

    Signed-off-by: Joerg Roedel

    Joerg Roedel
     

24 Mar, 2014

26 commits