19 Jun, 2019

2 commits

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details you should have received a copy of the gnu general
    public license along with this program if not see http www gnu org
    licenses

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 503 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Alexios Zavras
    Reviewed-by: Allison Randal
    Reviewed-by: Enrico Weigelt
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190602204653.811534538@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

14 Jun, 2019

1 commit

  • Pull iommu fixes from Joerg Roedel:

    - three fixes for Intel VT-d to fix a potential dead-lock, a formatting
    fix and a bit setting fix

    - one fix for the ARM-SMMU to make it work on some platforms with
    sub-optimal SMMU emulation

    * tag 'iommu-fixes-v5.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
    iommu/arm-smmu: Avoid constant zero in TLBI writes
    iommu/vt-d: Set the right field for Page Walk Snoop
    iommu/vt-d: Fix lock inversion between iommu->lock and device_domain_lock
    iommu: Add missing new line for dma type

    Linus Torvalds
     

12 Jun, 2019

1 commit

  • Apparently, some Qualcomm arm64 platforms which appear to expose their
    SMMU global register space are still, in fact, using a hypervisor to
    mediate it by trapping and emulating register accesses. Sadly, some
    deployed versions of said trapping code have bugs wherein they go
    horribly wrong for stores using r31 (i.e. XZR/WZR) as the source
    register.

    While this can be mitigated for GCC today by tweaking the constraints
    for the implementation of writel_relaxed(), to avoid any potential
    arms race with future compilers more aggressively optimising register
    allocation, the simple way is to just remove all the problematic
    constant zeros. For the write-only TLB operations, the actual value is
    irrelevant anyway and any old nearby variable will provide a suitable
    GPR to encode. The one point at which we really do need a zero to clear
    a context bank happens before any of the TLB maintenance where crashes
    have been reported, so is apparently not a problem... :/

    Reported-by: AngeloGioacchino Del Regno
    Tested-by: Marc Gonzalez
    Signed-off-by: Robin Murphy
    Signed-off-by: Marc Gonzalez
    Acked-by: Will Deacon
    Cc: stable@vger.kernel.org
    Signed-off-by: Joerg Roedel

    Robin Murphy
     

05 Jun, 2019

6 commits

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms and conditions of the gnu general public license
    version 2 as published by the free software foundation this program
    is distributed in the hope it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details you should have received a copy of the gnu general
    public license along with this program if not write to the free
    software foundation inc 51 franklin st fifth floor boston ma 02110
    1301 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 111 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Alexios Zavras
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190530000436.567572064@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details you should have received a copy of the gnu general
    public license along with this program if not write to the free
    software foundation inc 59 temple place suite 330 boston ma 02111
    1307 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 136 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Alexios Zavras
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190530000436.384967451@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms and conditions of the gnu general public license
    version 2 as published by the free software foundation this program
    is distributed in the hope it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details you should have received a copy of the gnu general
    public license along with this program if not write to the free
    software foundation inc 59 temple place suite 330 boston ma 02111
    1307 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 33 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Reviewed-by: Alexios Zavras
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190530000435.254582722@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms and conditions of the gnu general public license
    version 2 as published by the free software foundation this program
    is distributed in the hope it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 263 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Alexios Zavras
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190529141901.208660670@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 and
    only version 2 as published by the free software foundation this
    program is distributed in the hope that it will be useful but
    without any warranty without even the implied warranty of
    merchantability or fitness for a particular purpose see the gnu
    general public license for more details you should have received a
    copy of the gnu general public license along with this program if
    not write to the free software foundation inc 51 franklin street
    fifth floor boston ma 02110 1301 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 94 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Richard Fontana
    Reviewed-by: Alexios Zavras
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190529141334.043630402@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details you should have received a copy of the gnu general
    public license along with this program if not write to the free
    software foundation 51 franklin street fifth floor boston ma 02110
    1301 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 67 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Richard Fontana
    Reviewed-by: Alexios Zavras
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190529141333.953658117@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

02 Jun, 2019

1 commit

  • Commit cf04eee8bf0e ("iommu/vt-d: Include ACPI devices in iommu=pt")
    added for_each_active_iommu() in iommu_prepare_static_identity_mapping()
    but never used the each element, i.e, "drhd->iommu".

    drivers/iommu/intel-iommu.c: In function
    'iommu_prepare_static_identity_mapping':
    drivers/iommu/intel-iommu.c:3037:22: warning: variable 'iommu' set but
    not used [-Wunused-but-set-variable]
    struct intel_iommu *iommu;

    Fixed the warning by appending a compiler attribute __maybe_unused for it.

    Link: http://lkml.kernel.org/r/20190523013314.2732-1-cai@lca.pw
    Signed-off-by: Qian Cai
    Suggested-by: Andrew Morton
    Cc: Joerg Roedel
    Cc: David Woodhouse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Qian Cai
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 655 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Reviewed-by: Richard Fontana
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070034.575739538@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

27 May, 2019

3 commits

  • Set the page walk snoop to the right bit, otherwise the domain
    id field will be overlapped.

    Reported-by: Dave Jiang
    Fixes: 6f7db75e1c469 ("iommu/vt-d: Add second level page table interface")
    Signed-off-by: Lu Baolu
    Signed-off-by: Joerg Roedel

    Lu Baolu
     
  • Lockdep debug reported lock inversion related with the iommu code
    caused by dmar_insert_one_dev_info() grabbing the iommu->lock and
    the device_domain_lock out of order versus the code path in
    iommu_flush_dev_iotlb(). Expanding the scope of the iommu->lock and
    reversing the order of lock acquisition fixes the issue.

    [ 76.238180] dsa_bus wq0.0: dsa wq wq0.0 disabled
    [ 76.248706]
    [ 76.250486] ========================================================
    [ 76.257113] WARNING: possible irq lock inversion dependency detected
    [ 76.263736] 5.1.0-rc5+ #162 Not tainted
    [ 76.267854] --------------------------------------------------------
    [ 76.274485] systemd-journal/521 just changed the state of lock:
    [ 76.280685] 0000000055b330f5 (device_domain_lock){..-.}, at: iommu_flush_dev_iotlb.part.63+0x29/0x90
    [ 76.290099] but this lock took another, SOFTIRQ-unsafe lock in the past:
    [ 76.297093] (&(&iommu->lock)->rlock){+.+.}
    [ 76.297094]
    [ 76.297094]
    [ 76.297094] and interrupts could create inverse lock ordering between them.
    [ 76.297094]
    [ 76.314257]
    [ 76.314257] other info that might help us debug this:
    [ 76.321448] Possible interrupt unsafe locking scenario:
    [ 76.321448]
    [ 76.328907] CPU0 CPU1
    [ 76.333777] ---- ----
    [ 76.338642] lock(&(&iommu->lock)->rlock);
    [ 76.343165] local_irq_disable();
    [ 76.349422] lock(device_domain_lock);
    [ 76.356116] lock(&(&iommu->lock)->rlock);
    [ 76.363154]
    [ 76.366134] lock(device_domain_lock);
    [ 76.370548]
    [ 76.370548] *** DEADLOCK ***

    Fixes: 745f2586e78e ("iommu/vt-d: Simplify function get_domain_for_dev()")
    Signed-off-by: Dave Jiang
    Reviewed-by: Lu Baolu
    Signed-off-by: Joerg Roedel

    Dave Jiang
     
  • So that all types are printed in the same format.

    Fixes: c52c72d3dee81 ("iommu: Add sysfs attribyte for domain type")
    Signed-off-by: Lu Baolu
    Signed-off-by: Joerg Roedel

    Lu Baolu
     

21 May, 2019

2 commits

  • Add SPDX license identifiers to all Make/Kconfig files which:

    - Have no license information of any form

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Add SPDX license identifiers to all files which:

    - Have no license information of any form

    - Have EXPORT_.*_SYMBOL_GPL inside which was used in the
    initial scan/conversion to ignore the file

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

20 May, 2019

1 commit

  • Pull IRQ chip updates from Ingo Molnar:
    "A late irqchips update:

    - New TI INTR/INTA set of drivers

    - Rewrite of the stm32mp1-exti driver as a platform driver

    - Update the IOMMU MSI mapping API to be RT friendly

    - A number of cleanups and other low impact fixes"

    * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (34 commits)
    iommu/dma-iommu: Remove iommu_dma_map_msi_msg()
    irqchip/gic-v3-mbi: Don't map the MSI page in mbi_compose_m{b, s}i_msg()
    irqchip/ls-scfg-msi: Don't map the MSI page in ls_scfg_msi_compose_msg()
    irqchip/gic-v3-its: Don't map the MSI page in its_irq_compose_msi_msg()
    irqchip/gicv2m: Don't map the MSI page in gicv2m_compose_msi_msg()
    iommu/dma-iommu: Split iommu_dma_map_msi_msg() in two parts
    genirq/msi: Add a new field in msi_desc to store an IOMMU cookie
    arm64: arch_k3: Enable interrupt controller drivers
    irqchip/ti-sci-inta: Add msi domain support
    soc: ti: Add MSI domain bus support for Interrupt Aggregator
    irqchip/ti-sci-inta: Add support for Interrupt Aggregator driver
    dt-bindings: irqchip: Introduce TISCI Interrupt Aggregator bindings
    irqchip/ti-sci-intr: Add support for Interrupt Router driver
    dt-bindings: irqchip: Introduce TISCI Interrupt router bindings
    gpio: thunderx: Use the default parent apis for {request,release}_resources
    genirq: Introduce irq_chip_{request,release}_resource_parent() apis
    firmware: ti_sci: Add helper apis to manage resources
    firmware: ti_sci: Add RM mapping table for am654
    firmware: ti_sci: Add support for IRQ management
    firmware: ti_sci: Add support for RM core ops
    ...

    Linus Torvalds
     

15 May, 2019

3 commits

  • Since commit dccd2304cc90 ("ARM: 7430/1: sizes.h: move from asm-generic
    to "), and are just
    wrappers of .

    This commit replaces all and to
    prepare for the removal.

    Link: http://lkml.kernel.org/r/1553267665-27228-1-git-send-email-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     
  • Pull PCI updates from Bjorn Helgaas:
    "Enumeration changes:

    - Add _HPX Type 3 settings support, which gives firmware more
    influence over device configuration (Alexandru Gagniuc)

    - Support fixed bus numbers from bridge Enhanced Allocation
    capabilities (Subbaraya Sundeep)

    - Add "external-facing" DT property to identify cases where we
    require IOMMU protection against untrusted devices (Jean-Philippe
    Brucker)

    - Enable PCIe services for host controller drivers that use managed
    host bridge alloc (Jean-Philippe Brucker)

    - Log PCIe port service messages with pci_dev, not the pcie_device
    (Frederick Lawler)

    - Convert pciehp from pciehp_debug module parameter to generic
    dynamic debug (Frederick Lawler)

    Peer-to-peer DMA:

    - Add whitelist of Root Complexes that support peer-to-peer DMA
    between Root Ports (Christian König)

    Native controller drivers:

    - Add PCI host bridge DMA ranges for bridges that can't DMA
    everywhere, e.g., iProc (Srinath Mannam)

    - Add Amazon Annapurna Labs PCIe host controller driver (Jonathan
    Chocron)

    - Fix Tegra MSI target allocation so DMA doesn't generate unwanted
    MSIs (Vidya Sagar)

    - Fix of_node reference leaks (Wen Yang)

    - Fix Hyper-V module unload & device removal issues (Dexuan Cui)

    - Cleanup R-Car driver (Marek Vasut)

    - Cleanup Keystone driver (Kishon Vijay Abraham I)

    - Cleanup i.MX6 driver (Andrey Smirnov)

    Significant bug fixes:

    - Reset Lenovo ThinkPad P50 GPU so nouveau works after reboot (Lyude
    Paul)

    - Fix Switchtec firmware update performance issue (Wesley Sheng)

    - Work around Pericom switch link retraining erratum (Stefan Mätje)"

    * tag 'pci-v5.2-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (141 commits)
    MAINTAINERS: Add Karthikeyan Mitran and Hou Zhiqiang for Mobiveil PCI
    PCI: pciehp: Remove pointless MY_NAME definition
    PCI: pciehp: Remove pointless PCIE_MODULE_NAME definition
    PCI: pciehp: Remove unused dbg/err/info/warn() wrappers
    PCI: pciehp: Log messages with pci_dev, not pcie_device
    PCI: pciehp: Replace pciehp_debug module param with dyndbg
    PCI: pciehp: Remove pciehp_debug uses
    PCI/AER: Log messages with pci_dev, not pcie_device
    PCI/DPC: Log messages with pci_dev, not pcie_device
    PCI/PME: Replace dev_printk(KERN_DEBUG) with dev_info()
    PCI/AER: Replace dev_printk(KERN_DEBUG) with dev_info()
    PCI: Replace dev_printk(KERN_DEBUG) with dev_info(), etc
    PCI: Replace printk(KERN_INFO) with pr_info(), etc
    PCI: Use dev_printk() when possible
    PCI: Cleanup setup-bus.c comments and whitespace
    PCI: imx6: Allow asynchronous probing
    PCI: dwc: Save root bus for driver remove hooks
    PCI: dwc: Use devm_pci_alloc_host_bridge() to simplify code
    PCI: dwc: Free MSI in dw_pcie_host_init() error path
    PCI: dwc: Free MSI IRQ page in dw_pcie_free_msi()
    ...

    Linus Torvalds
     
  • Convert to use vm_map_pages() to map range of kernel memory to user vma.

    Link: http://lkml.kernel.org/r/80c3d220fc6ada73a88ce43ca049afb55a889258.1552921225.git.jrdr.linux@gmail.com
    Signed-off-by: Souptick Joarder
    Cc: Boris Ostrovsky
    Cc: David Airlie
    Cc: Heiko Stuebner
    Cc: Joerg Roedel
    Cc: Joonsoo Kim
    Cc: Juergen Gross
    Cc: Kees Cook
    Cc: "Kirill A. Shutemov"
    Cc: Kyungmin Park
    Cc: Marek Szyprowski
    Cc: Matthew Wilcox
    Cc: Mauro Carvalho Chehab
    Cc: Michal Hocko
    Cc: Mike Rapoport
    Cc: Oleksandr Andrushchenko
    Cc: Pawel Osciak
    Cc: Peter Zijlstra
    Cc: Rik van Riel
    Cc: Robin Murphy
    Cc: Russell King
    Cc: Sandy Huang
    Cc: Stefan Richter
    Cc: Stephen Rothwell
    Cc: Thierry Reding
    Cc: Vlastimil Babka
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Souptick Joarder
     

14 May, 2019

1 commit

  • - Add list of legal DMA address ranges to PCI host bridge (Srinath
    Mannam)

    - Reserve inaccessible DMA ranges so IOMMU doesn't allocate them (Srinath
    Mannam)

    - Parse iProc DT dma-ranges to learn what PCI devices can reach via DMA
    (Srinath Mannam)

    * pci/iova-dma-ranges:
    PCI: iproc: Add sorted dma ranges resource entries to host bridge
    iommu/dma: Reserve IOVA for PCIe inaccessible DMA address
    PCI: Add dma_ranges window list

    # Conflicts:
    # drivers/pci/probe.c

    Bjorn Helgaas
     

13 May, 2019

1 commit

  • Pull IOMMU updates from Joerg Roedel:

    - ATS support for ARM-SMMU-v3.

    - AUX domain support in the IOMMU-API and the Intel VT-d driver. This
    adds support for multiple DMA address spaces per (PCI-)device. The
    use-case is to multiplex devices between host and KVM guests in a
    more flexible way than supported by SR-IOV.

    - the rest are smaller cleanups and fixes, two of which needed to be
    reverted after testing in linux-next.

    * tag 'iommu-updates-v5.2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (45 commits)
    Revert "iommu/amd: Flush not present cache in iommu_map_page"
    Revert "iommu/amd: Remove the leftover of bypass support"
    iommu/vt-d: Fix leak in intel_pasid_alloc_table on error path
    iommu/vt-d: Make kernel parameter igfx_off work with vIOMMU
    iommu/vt-d: Set intel_iommu_gfx_mapped correctly
    iommu/amd: Flush not present cache in iommu_map_page
    iommu/vt-d: Cleanup: no spaces at the start of a line
    iommu/vt-d: Don't request page request irq under dmar_global_lock
    iommu/vt-d: Use struct_size() helper
    iommu/mediatek: Fix leaked of_node references
    iommu/amd: Remove amd_iommu_pd_list
    iommu/arm-smmu: Log CBFRSYNRA register on context fault
    iommu/arm-smmu-v3: Don't disable SMMU in kdump kernel
    iommu/arm-smmu-v3: Disable tagged pointers
    iommu/arm-smmu-v3: Add support for PCI ATS
    iommu/arm-smmu-v3: Link domains and devices
    iommu/arm-smmu-v3: Add a master->domain pointer
    iommu/arm-smmu-v3: Store SteamIDs in master
    iommu/arm-smmu-v3: Rename arm_smmu_master_data to arm_smmu_master
    ACPI/IORT: Check ATS capability in root complex nodes
    ...

    Linus Torvalds
     

07 May, 2019

3 commits


06 May, 2019

1 commit

  • This reverts commit 7a5dbf3ab2f04905cf8468c66fcdbfb643068bcb.

    This commit not only removes the leftovers of bypass
    support, it also mostly removes the checking of the return
    value of the get_domain() function. This can lead to silent
    data corruption bugs when a device is not attached to its
    dma_ops domain and a DMA-API function is called for that
    device.

    Signed-off-by: Joerg Roedel

    Joerg Roedel
     

03 May, 2019

7 commits

  • If alloc_pages_node() fails, pasid_table is leaked. Free it.

    Fixes: cc580e41260db ("iommu/vt-d: Per PCI device pasid table interfaces")

    Signed-off-by: Eric Auger
    Signed-off-by: Joerg Roedel

    Eric Auger
     
  • The kernel parameter igfx_off is used by users to disable
    DMA remapping for the Intel integrated graphic device. It
    was designed for bare metal cases where a dedicated IOMMU
    is used for graphic. This doesn't apply to virtual IOMMU
    case where an include-all IOMMU is used. This makes the
    kernel parameter work with virtual IOMMU as well.

    Cc: Ashok Raj
    Cc: Jacob Pan
    Suggested-by: Kevin Tian
    Fixes: c0771df8d5297 ("intel-iommu: Export a flag indicating that the IOMMU is used for iGFX.")
    Signed-off-by: Lu Baolu
    Tested-by: Zhenyu Wang
    Signed-off-by: Joerg Roedel

    Lu Baolu
     
  • The intel_iommu_gfx_mapped flag is exported by the Intel
    IOMMU driver to indicate whether an IOMMU is used for the
    graphic device. In a virtualized IOMMU environment (e.g.
    QEMU), an include-all IOMMU is used for graphic device.
    This flag is found to be clear even the IOMMU is used.

    Cc: Ashok Raj
    Cc: Jacob Pan
    Cc: Kevin Tian
    Reported-by: Zhenyu Wang
    Fixes: c0771df8d5297 ("intel-iommu: Export a flag indicating that the IOMMU is used for iGFX.")
    Suggested-by: Kevin Tian
    Signed-off-by: Lu Baolu
    Signed-off-by: Joerg Roedel

    Lu Baolu
     
  • check if there is a not-present cache present and flush it if there is.

    Signed-off-by: Tom Murphy
    Signed-off-by: Joerg Roedel

    Tom Murphy
     
  • Replace the whitespaces at the start of a line with tabs. No
    functional changes.

    Signed-off-by: Lu Baolu
    Signed-off-by: Joerg Roedel

    Lu Baolu
     
  • A recent change split iommu_dma_map_msi_msg() in two new functions. The
    function was still implemented to avoid modifying all the callers at
    once.

    Now that all the callers have been reworked, iommu_dma_map_msi_msg() can
    be removed.

    Signed-off-by: Julien Grall
    Reviewed-by: Robin Murphy
    Reviewed-by: Eric Auger
    Acked-by: Joerg Roedel
    Signed-off-by: Marc Zyngier

    Julien Grall
     
  • On RT, iommu_dma_map_msi_msg() may be called from non-preemptible
    context. This will lead to a splat with CONFIG_DEBUG_ATOMIC_SLEEP as
    the function is using spin_lock (they can sleep on RT).

    iommu_dma_map_msi_msg() is used to map the MSI page in the IOMMU PT
    and update the MSI message with the IOVA.

    Only the part to lookup for the MSI page requires to be called in
    preemptible context. As the MSI page cannot change over the lifecycle
    of the MSI interrupt, the lookup can be cached and re-used later on.

    iomma_dma_map_msi_msg() is now split in two functions:
    - iommu_dma_prepare_msi(): This function will prepare the mapping
    in the IOMMU and store the cookie in the structure msi_desc. This
    function should be called in preemptible context.
    - iommu_dma_compose_msi_msg(): This function will update the MSI
    message with the IOVA when the device is behind an IOMMU.

    Signed-off-by: Julien Grall
    Reviewed-by: Robin Murphy
    Reviewed-by: Eric Auger
    Acked-by: Joerg Roedel
    Signed-off-by: Marc Zyngier

    Julien Grall
     

30 Apr, 2019

2 commits


26 Apr, 2019

4 commits

  • Joerg Roedel
     
  • Requesting page reqest irq under dmar_global_lock could cause
    potential lock race condition (caught by lockdep).

    [ 4.100055] ======================================================
    [ 4.100063] WARNING: possible circular locking dependency detected
    [ 4.100072] 5.1.0-rc4+ #2169 Not tainted
    [ 4.100078] ------------------------------------------------------
    [ 4.100086] swapper/0/1 is trying to acquire lock:
    [ 4.100094] 000000007dcbe3c3 (dmar_lock){+.+.}, at: dmar_alloc_hwirq+0x35/0x140
    [ 4.100112] but task is already holding lock:
    [ 4.100120] 0000000060bbe946 (dmar_global_lock){++++}, at: intel_iommu_init+0x191/0x1438
    [ 4.100136] which lock already depends on the new lock.
    [ 4.100146] the existing dependency chain (in reverse order) is:
    [ 4.100155]
    -> #2 (dmar_global_lock){++++}:
    [ 4.100169] down_read+0x44/0xa0
    [ 4.100178] intel_irq_remapping_alloc+0xb2/0x7b0
    [ 4.100186] mp_irqdomain_alloc+0x9e/0x2e0
    [ 4.100195] __irq_domain_alloc_irqs+0x131/0x330
    [ 4.100203] alloc_isa_irq_from_domain.isra.4+0x9a/0xd0
    [ 4.100212] mp_map_pin_to_irq+0x244/0x310
    [ 4.100221] setup_IO_APIC+0x757/0x7ed
    [ 4.100229] x86_late_time_init+0x17/0x1c
    [ 4.100238] start_kernel+0x425/0x4e3
    [ 4.100247] secondary_startup_64+0xa4/0xb0
    [ 4.100254]
    -> #1 (irq_domain_mutex){+.+.}:
    [ 4.100265] __mutex_lock+0x7f/0x9d0
    [ 4.100273] __irq_domain_add+0x195/0x2b0
    [ 4.100280] irq_domain_create_hierarchy+0x3d/0x40
    [ 4.100289] msi_create_irq_domain+0x32/0x110
    [ 4.100297] dmar_alloc_hwirq+0x111/0x140
    [ 4.100305] dmar_set_interrupt.part.14+0x1a/0x70
    [ 4.100314] enable_drhd_fault_handling+0x2c/0x6c
    [ 4.100323] apic_bsp_setup+0x75/0x7a
    [ 4.100330] x86_late_time_init+0x17/0x1c
    [ 4.100338] start_kernel+0x425/0x4e3
    [ 4.100346] secondary_startup_64+0xa4/0xb0
    [ 4.100352]
    -> #0 (dmar_lock){+.+.}:
    [ 4.100364] lock_acquire+0xb4/0x1c0
    [ 4.100372] __mutex_lock+0x7f/0x9d0
    [ 4.100379] dmar_alloc_hwirq+0x35/0x140
    [ 4.100389] intel_svm_enable_prq+0x61/0x180
    [ 4.100397] intel_iommu_init+0x1128/0x1438
    [ 4.100406] pci_iommu_init+0x16/0x3f
    [ 4.100414] do_one_initcall+0x5d/0x2be
    [ 4.100422] kernel_init_freeable+0x1f0/0x27c
    [ 4.100431] kernel_init+0xa/0x110
    [ 4.100438] ret_from_fork+0x3a/0x50
    [ 4.100444]
    other info that might help us debug this:

    [ 4.100454] Chain exists of:
    dmar_lock --> irq_domain_mutex --> dmar_global_lock
    [ 4.100469] Possible unsafe locking scenario:

    [ 4.100476] CPU0 CPU1
    [ 4.100483] ---- ----
    [ 4.100488] lock(dmar_global_lock);
    [ 4.100495] lock(irq_domain_mutex);
    [ 4.100503] lock(dmar_global_lock);
    [ 4.100512] lock(dmar_lock);
    [ 4.100518]
    *** DEADLOCK ***

    Cc: Ashok Raj
    Cc: Jacob Pan
    Cc: Kevin Tian
    Reported-by: Dave Jiang
    Fixes: a222a7f0bb6c9 ("iommu/vt-d: Implement page request handling")
    Signed-off-by: Lu Baolu
    Signed-off-by: Joerg Roedel

    Lu Baolu
     
  • Make use of the struct_size() helper instead of an open-coded version
    in order to avoid any potential type mistakes, in particular in the
    context in which this code is being used.

    So, replace code of the following form:

    size = sizeof(*info) + level * sizeof(info->path[0]);

    with:

    size = struct_size(info, path, level);

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Joerg Roedel

    Gustavo A. R. Silva
     
  • …kernel/git/will/linux into arm/smmu

    Joerg Roedel