1. 26 4月, 2017 1 次提交
  2. 25 4月, 2017 1 次提交
  3. 08 4月, 2017 1 次提交
  4. 06 4月, 2017 14 次提交
    • R
      iommu/io-pgtable-arm: Avoid shift overflow in block size · 022f4e4f
      Robin Murphy 提交于
      The recursive nature of __arm_lpae_{map,unmap}() means that
      ARM_LPAE_BLOCK_SIZE() is evaluated for every level, including those
      where block mappings aren't possible. This in itself is harmless enough,
      as we will only ever be called with valid sizes from the pgsize_bitmap,
      and thus always recurse down past any imaginary block sizes. The only
      problem is that most of those imaginary sizes overflow the type used for
      the calculation, and thus trigger warnings under UBsan:
      
      [   63.020939] ================================================================================
      [   63.021284] UBSAN: Undefined behaviour in drivers/iommu/io-pgtable-arm.c:312:22
      [   63.021602] shift exponent 39 is too large for 32-bit type 'int'
      [   63.021909] CPU: 0 PID: 1119 Comm: lkvm Not tainted 4.7.0-rc3+ #819
      [   63.022163] Hardware name: FVP Base (DT)
      [   63.022345] Call trace:
      [   63.022629] [<ffffff900808f258>] dump_backtrace+0x0/0x3a8
      [   63.022975] [<ffffff900808f614>] show_stack+0x14/0x20
      [   63.023294] [<ffffff90086bc9dc>] dump_stack+0x104/0x148
      [   63.023609] [<ffffff9008713ce8>] ubsan_epilogue+0x18/0x68
      [   63.023956] [<ffffff9008714410>] __ubsan_handle_shift_out_of_bounds+0x18c/0x1bc
      [   63.024365] [<ffffff900890fcb0>] __arm_lpae_map+0x720/0xae0
      [   63.024732] [<ffffff9008910170>] arm_lpae_map+0x100/0x190
      [   63.025049] [<ffffff90089183d8>] arm_smmu_map+0x78/0xc8
      [   63.025390] [<ffffff9008906c18>] iommu_map+0x130/0x230
      [   63.025763] [<ffffff9008bf7564>] vfio_iommu_type1_attach_group+0x4bc/0xa00
      [   63.026156] [<ffffff9008bf3c78>] vfio_fops_unl_ioctl+0x320/0x580
      [   63.026515] [<ffffff9008377420>] do_vfs_ioctl+0x140/0xd28
      [   63.026858] [<ffffff9008378094>] SyS_ioctl+0x8c/0xa0
      [   63.027179] [<ffffff9008086e70>] el0_svc_naked+0x24/0x28
      [   63.027412] ================================================================================
      
      Perform the shift in a 64-bit type to prevent the theoretical overflow
      and keep the peace. As it turns out, this generates identical code for
      32-bit ARM, and marginally shorter AArch64 code, so it's good all round.
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      022f4e4f
    • W
      iommu: Allow default domain type to be set on the kernel command line · fccb4e3b
      Will Deacon 提交于
      The IOMMU core currently initialises the default domain for each group
      to IOMMU_DOMAIN_DMA, under the assumption that devices will use
      IOMMU-backed DMA ops by default. However, in some cases it is desirable
      for the DMA ops to bypass the IOMMU for performance reasons, reserving
      use of translation for subsystems such as VFIO that require it for
      enforcing device isolation.
      
      Rather than modify each IOMMU driver to provide different semantics for
      DMA domains, instead we introduce a command line parameter that can be
      used to change the type of the default domain. Passthrough can then be
      specified using "iommu.passthrough=1" on the kernel command line.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      fccb4e3b
    • W
      iommu/arm-smmu-v3: Install bypass STEs for IOMMU_DOMAIN_IDENTITY domains · beb3c6a0
      Will Deacon 提交于
      In preparation for allowing the default domain type to be overridden,
      this patch adds support for IOMMU_DOMAIN_IDENTITY domains to the
      ARM SMMUv3 driver.
      
      An identity domain is created by placing the corresponding stream table
      entries into "bypass" mode, which allows transactions to flow through
      the SMMU without any translation.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      beb3c6a0
    • W
      iommu/arm-smmu-v3: Make arm_smmu_install_ste_for_dev return void · 67560edc
      Will Deacon 提交于
      arm_smmu_install_ste_for_dev cannot fail and always returns 0, however
      the fact that it returns int means that callers end up implementing
      redundant error handling code which complicates STE tracking and is
      never executed.
      
      This patch changes the return type of arm_smmu_install_ste_for_dev
      to void, to make it explicit that it cannot fail.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      67560edc
    • W
      iommu/arm-smmu: Install bypass S2CRs for IOMMU_DOMAIN_IDENTITY domains · 61bc6711
      Will Deacon 提交于
      In preparation for allowing the default domain type to be overridden,
      this patch adds support for IOMMU_DOMAIN_IDENTITY domains to the
      ARM SMMU driver.
      
      An identity domain is created by placing the corresponding S2CR
      registers into "bypass" mode, which allows transactions to flow through
      the SMMU without any translation.
      Reviewed-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      61bc6711
    • W
      iommu/arm-smmu: Restrict domain attributes to UNMANAGED domains · 0834cc28
      Will Deacon 提交于
      The ARM SMMU drivers provide a DOMAIN_ATTR_NESTING domain attribute,
      which allows callers of the IOMMU API to request that the page table
      for a domain is installed at stage-2, if supported by the hardware.
      
      Since setting this attribute only makes sense for UNMANAGED domains,
      this patch returns -ENODEV if the domain_{get,set}_attr operations are
      called on other domain types.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      0834cc28
    • R
      iommu/arm-smmu: Add global SMR masking property · 56fbf600
      Robin Murphy 提交于
      The current SMR masking support using a 2-cell iommu-specifier is
      primarily intended to handle individual masters with large and/or
      complex Stream ID assignments; it quickly gets a bit clunky in other SMR
      use-cases where we just want to consistently mask out the same part of
      every Stream ID (e.g. for MMU-500 configurations where the appended TBU
      number gets in the way unnecessarily). Let's add a new property to allow
      a single global mask value to better fit the latter situation.
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      Tested-by: NNipun Gupta <nipun.gupta@nxp.com>
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      56fbf600
    • R
      iommu/arm-smmu: Poll for TLB sync completion more effectively · 8513c893
      Robin Murphy 提交于
      On relatively slow development platforms and software models, the
      inefficiency of our TLB sync loop tends not to show up - for instance on
      a Juno r1 board I typically see the TLBI has completed of its own accord
      by the time we get to the sync, such that the latter finishes instantly.
      
      However, on larger systems doing real I/O, it's less realistic for the
      TLBs to go idle immediately, and at that point falling into the 1MHz
      polling loop turns out to throw away performance drastically. Let's
      strike a balance by polling more than once between pauses, such that we
      have much more chance of catching normal operations completing before
      committing to the fixed delay, but also backing off exponentially, since
      if a sync really hasn't completed within one or two "reasonable time"
      periods, it becomes increasingly unlikely that it ever will.
      Reviewed-by: NJordan Crouse <jcrouse@codeaurora.org>
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      8513c893
    • R
      iommu/arm-smmu: Use per-context TLB sync as appropriate · 11febfca
      Robin Murphy 提交于
      TLB synchronisation typically involves the SMMU blocking all incoming
      transactions until the TLBs report completion of all outstanding
      operations. In the common SMMUv2 configuration of a single distributed
      SMMU serving multiple peripherals, that means that a single unmap
      request has the potential to bring the hammer down on the entire system
      if synchronised globally. Since stage 1 contexts, and stage 2 contexts
      under SMMUv2, offer local sync operations, let's make use of those
      wherever we can in the hope of minimising global disruption.
      
      To that end, rather than add any more branches to the already unwieldy
      monolithic TLB maintenance ops, break them up into smaller, neater,
      functions which we can then mix and match as appropriate.
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      11febfca
    • R
      iommu/arm-smmu: Tidy up context bank indexing · 452107c7
      Robin Murphy 提交于
      ARM_AMMU_CB() is calculated relative to ARM_SMMU_CB_BASE(), but the
      latter is never of use on its own, and what we end up with is the same
      ARM_SMMU_CB_BASE() + ARM_AMMU_CB() expression being duplicated at every
      callsite. Folding the two together gives us a self-contained context
      bank accessor which is much more pleasant to work with.
      
      Secondly, we might as well simplify CB_BASE itself at the same time.
      We use the address space size for its own sake precisely once, at probe
      time, and every other usage is to dynamically calculate CB_BASE over
      and over and over again. Let's flip things around so that we just
      maintain the CB_BASE address directly.
      Reviewed-by: NJordan Crouse <jcrouse@codeaurora.org>
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      452107c7
    • R
      iommu/arm-smmu: Simplify ASID/VMID handling · 280b683c
      Robin Murphy 提交于
      Calculating ASIDs/VMIDs dynamically from arm_smmu_cfg was a neat trick,
      but the global uniqueness workaround makes it somewhat more awkward, and
      means we end up having to pass extra state around in certain cases just
      to keep a handle on the offset.
      
      We already have 16 bits going spare in arm_smmu_cfg; let's just
      precalculate an ASID/VMID, plop it in there, and tidy up the users
      accordingly. We'd also need something like this anyway if we ever get
      near to thinking about SVM, so it's no bad thing.
      Reviewed-by: NJordan Crouse <jcrouse@codeaurora.org>
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      280b683c
    • S
      iommu/arm-smmu: Fix 16-bit ASID configuration · 125458ab
      Sunil Goutham 提交于
      16-bit ASID should be enabled before initializing TTBR0/1,
      otherwise only LSB 8-bit ASID will be considered. Hence
      moving configuration of TTBCR register ahead of TTBR0/1
      while initializing context bank.
      Signed-off-by: NSunil Goutham <sgoutham@cavium.com>
      [will: rewrote comment]
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      125458ab
    • R
      iommu/arm-smmu: Print message when Cavium erratum 27704 was detected · 53c35dce
      Robert Richter 提交于
      Firmware is responsible for properly enabling smmu workarounds. Print
      a message for better diagnostics when Cavium erratum 27704 was
      detected.
      Reviewed-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NRobert Richter <rrichter@cavium.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      53c35dce
    • R
      iommu: Better document the IOMMU_PRIV flag · adf5e516
      Robin Murphy 提交于
      This is a fairly subtle thing - let's make sure it's described as
      clearly as possible to avoid potential misunderstandings.
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      adf5e516
  5. 03 4月, 2017 8 次提交
  6. 02 4月, 2017 10 次提交
    • L
      Merge branch 'parisc-4.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux · 346ce1d7
      Linus Torvalds 提交于
      Pull parisc fixes from Helge Deller:
       "Al Viro reported that - in case of read faults - our copy_from_user()
        implementation may claim to have copied more bytes than it actually
        did. In order to fix this bug and because of the way how gcc optimizes
        register usage for inline assembly in C code, we had to replace our
        pa_memcpy() function with a pure assembler implementation.
      
        While fixing the memcpy bug we noticed some other issues with our
        get_user() and put_user() functions, e.g. nested faults may return
        wrong data. This is now fixed by a common fixup handler for
        get_user/put_user in the exception handler which additionally makes
        generated code smaller and faster.
      
        The third patch is a trivial one-line fix for a patch which went in
        during 4.11-rc and which avoids stalled CPU warnings after power
        shutdown (for parisc machines which can't plug power off themselves).
      
        Due to the rewrite of pa_memcpy() into assembly this patch got bigger
        than what I wanted to have sent at this stage.
      
        Those patches have been running in production during the last few days
        on our debian build servers without any further issues"
      
      * 'parisc-4.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
        parisc: Avoid stalled CPU warnings after system shutdown
        parisc: Clean up fixup routines for get_user()/put_user()
        parisc: Fix access fault handling in pa_memcpy()
      346ce1d7
    • L
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 7d34ddbe
      Linus Torvalds 提交于
      Pull SCSI fixes from James Bottomley:
       "Thirteen small fixes: The hopefully final effort to get the lpfc nvme
        kconfig problems sorted, there's one important sg fix (user can induce
        read after end of buffer) and one minor enhancement (adding an extra
        PCI ID to qedi). The rest are a set of minor fixes, which mostly occur
        as user visible in error legs or on specific devices"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: ufs: remove the duplicated checking for supporting clkscaling
        scsi: lpfc: fix building without debugfs support
        scsi: lpfc: Fix PT2PT PRLI reject
        scsi: hpsa: fix volume offline state
        scsi: libsas: fix ata xfer length
        scsi: scsi_dh_alua: Warn if the first argument of alua_rtpg_queue() is NULL
        scsi: scsi_dh_alua: Ensure that alua_activate() calls the completion function
        scsi: scsi_dh_alua: Check scsi_device_get() return value
        scsi: sg: check length passed to SG_NEXT_CMD_LEN
        scsi: ufshcd-platform: remove the useless cast in ERR_PTR/IS_ERR
        scsi: qedi: Add PCI device-ID for QL41xxx adapters.
        scsi: aacraid: Fix potential null access
        scsi: qla2xxx: Fix crash in qla2xxx_eh_abort on bad ptr
      7d34ddbe
    • L
      Merge branch 'akpm' (patches from Andrew) · 978e0f92
      Linus Torvalds 提交于
      Merge misc fixes from Andrew Morton:
       "11 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        kasan: do not sanitize kexec purgatory
        drivers/rapidio/devices/tsi721.c: make module parameter variable name unique
        mm/hugetlb.c: don't call region_abort if region_chg fails
        kasan: report only the first error by default
        hugetlbfs: initialize shared policy as part of inode allocation
        mm: fix section name for .data..ro_after_init
        mm, hugetlb: use pte_present() instead of pmd_present() in follow_huge_pmd()
        mm: workingset: fix premature shadow node shrinking with cgroups
        mm: rmap: fix huge file mmap accounting in the memcg stats
        mm: move mm_percpu_wq initialization earlier
        mm: migrate: fix remove_migration_pte() for ksm pages
      978e0f92
    • L
      Merge tag 'usb-4.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · a9f6b6b8
      Linus Torvalds 提交于
      Pull USB fixes from Greg KH:
       "Here are some small USB fixes for 4.11-rc5.
      
        The usual xhci fixes are here, as well as a fix for yet-another-bug-
        found-by-KASAN, those developers are doing great stuff here.
      
        And there's a phy build warning fix that showed up in 4.11-rc1.
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'usb-4.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        usb: phy: isp1301: Fix build warning when CONFIG_OF is disabled
        xhci: Manually give back cancelled URB if we can't queue it for cancel
        xhci: Set URB actual length for stopped control transfers
        xhci: plat: Register shutdown for xhci_plat
        USB: fix linked-list corruption in rh_call_control()
      a9f6b6b8
    • L
      Merge tag 'tty-4.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · b3ff4fac
      Linus Torvalds 提交于
      Pull tty/serial fixes from Greg KH:
       "Here are some small fixes for some serial drivers and Kconfig help
        text for 4.11-rc5. Nothing major here at all, a few things resolving
        reported bugs in some random serial drivers.
      
        I don't think these made the last linux-next due to me getting to them
        yesterday, but I am not sure, they might have snuck in. The patches
        only affect drivers that the maintainers of sent me these patches for,
        so we should be safe here :)"
      
      * tag 'tty-4.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        tty: pl011: fix earlycon work-around for QDF2400 erratum 44
        serial: 8250_EXAR: fix duplicate Kconfig text and add missing help text
        tty/serial: atmel: fix TX path in atmel_console_write()
        tty/serial: atmel: fix race condition (TX+DMA)
        serial: mxs-auart: Fix baudrate calculation
      b3ff4fac
    • L
      Merge tag 'acpi-4.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 7ece03b0
      Linus Torvalds 提交于
      Pull ACPI fixes from Rafael Wysocki:
       "These fix two issues related to IOAPIC hotplug, an overzealous build
        optimization that prevents the function graph tracer from working with
        the ACPI subsystem correctly and an RCU synchronization issue in the
        ACPI APEI code.
      
        Specifics:
      
         - drop the unconditional setting of the '-Os' gcc flag from the ACPI
           Makefile to make the function graph tracer work correctly with the
           ACPI subsystem (Josh Poimboeuf).
      
         - add missing synchronize_rcu() to ghes_remove() which removes an
           element from an RCU-protected list, but fails to synchronize it
           properly afterward (James Morse).
      
         - fix two problems related to IOAPIC hotplug, a local variable
           initialization in setup_res() and the creation of platform device
           objects for IO(x)APICs which are (a) unused and (b) leaked on
           hot-removal (Joerg Roedel)"
      
      * tag 'acpi-4.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: Fix incompatibility with mcount-based function graph tracing
        ACPI / APEI: Add missing synchronize_rcu() on NOTIFY_SCI removal
        ACPI: Do not create a platform_device for IOAPIC/IOxAPIC
        ACPI: ioapic: Clear on-stack resource before using it
      7ece03b0
    • L
      Merge tag 'pm-4.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 0d2ceec6
      Linus Torvalds 提交于
      Pull power management fixes from Rafael Wysocki:
       "These fix a cpufreq core issue with the initialization of the cpufreq
        sysfs interface and a cpuidle powernv driver initialization issue.
      
        Specifics:
      
         - symbolic links from CPU directories to the corresponding cpufreq
           policy directories in sysfs are not created during initialization
           in some cases which confuses user space, so prevent that from
           happening (Rafael Wysocki).
      
         - the powernv cpuidle driver fails to pass a correct cpumaks to the
           cpuidle core in some cases which causes subsequent failures to
           occur, so fix it (Vaidyanathan Srinivasan)"
      
      * tag 'pm-4.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpuidle: powernv: Pass correct drv->cpumask for registration
        cpufreq: Fix creation of symbolic links to policy directories
      0d2ceec6
    • L
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 1300dc68
      Linus Torvalds 提交于
      Pull i2c fixes from Wolfram Sang:
       "Two bugfixes from I2C, specifically the I2C mux section. Thanks to
        peda for collecting them"
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: mux: pca954x: Add missing pca9546 definition to chip_desc
        Revert "i2c: mux: pca954x: Add ACPI support for pca954x"
      1300dc68
    • L
      Merge tag 'arc-4.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc · dcbcb491
      Linus Torvalds 提交于
      Pull ARC fixes from Vineet Gupta:
       "Accumulated fixes for ARC which I've been been sitting on for a while:
      
         - reading clk from driver vs device tree [Vlad]
      
         - fix support for UIO in VDK platform [Alexey]
      
         - SLC busy bit reading workaround
      
         - build warning with kprobes header reorg"
      
      * tag 'arc-4.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
        ARC: fix build warnings with !CONFIG_KPROBES
        ARCv2: SLC: Make sure busy bit is set properly on SLC flushing
        ARC: vdk: Fix support of UIO
        ARCv2: make unimplemented vectors as no-ops rather than halt core
        ARC: get rate from clk driver instead of reading device tree
        ARC: [dts] add cpu nodes to ARCHS SMP device tree
        ARC: [dts] add input clocks for cpu nodes
      dcbcb491
    • L
      Merge tag 'nfsd-4.11-1' of git://linux-nfs.org/~bfields/linux · 09c8b3d1
      Linus Torvalds 提交于
      Pull nfsd fixes from Bruce Fields:
       "The restriction of NFSv4 to TCP went overboard and also broke the
        backchannel; fix.
      
        Also some minor refinements to the nfsd version-setting interface that
        we'd like to get fixed before release"
      
      * tag 'nfsd-4.11-1' of git://linux-nfs.org/~bfields/linux:
        svcrdma: set XPT_CONG_CTRL flag for bc xprt
        NFSD: fix nfsd_reset_versions for NFSv4.
        NFSD: fix nfsd_minorversion(.., NFSD_AVAIL)
        NFSD: further refinement of content of /proc/fs/nfsd/versions
        nfsd: map the ENOKEY to nfserr_perm for avoiding warning
        SUNRPC/backchanel: set XPT_CONG_CTRL flag for bc xprt
      09c8b3d1
  7. 01 4月, 2017 5 次提交