1. 21 Mar, 2019 3 commits
  2. 20 Mar, 2019 1 commit
  3. 11 Mar, 2019 1 commit
  4. 04 Mar, 2019 1 commit
    • Arnd Bergmann's avatar
      irqchip/imx-irqsteer: Fix of_property_read_u32() error handling · 7d3a5eb7
      Arnd Bergmann authored
      gcc points out that irqs_num is not initialized when of_property_read_u32()
      is an empty stub function:
      
                       Included from drivers/irqchip/irq-imx-irqsteer.c:7:
      drivers/irqchip/irq-imx-irqsteer.c: In function 'imx_irqsteer_probe':
      include/uapi/linux/kernel.h:13:49: error: 'irqs_num' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      
      The same can actually happen with CONFIG_OF=y as well, though we don't
      get a warning then.
      
      Add error checking here that lets the code deal with missing or
      invalid properties as well as avoid the warning.
      
      Fixes: 28528fca ("irqchip/imx-irqsteer: Add multi output interrupts support")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      7d3a5eb7
  5. 22 Feb, 2019 4 commits
  6. 21 Feb, 2019 7 commits
    • Doug Berger's avatar
      irqchip/brcmstb-l2: Use _irqsave locking variants in non-interrupt code · 33517881
      Doug Berger authored
      Using the irq_gc_lock/irq_gc_unlock functions in the suspend and
      resume functions creates the opportunity for a deadlock during
      suspend, resume, and shutdown. Using the irq_gc_lock_irqsave/
      irq_gc_unlock_irqrestore variants prevents this possible deadlock.
      
      Cc: stable@vger.kernel.org
      Fixes: 7f646e92 ("irqchip: brcmstb-l2: Add Broadcom Set Top Box Level-2 interrupt controller")
      Signed-off-by: default avatarDoug Berger <opendmb@gmail.com>
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      [maz: tidied up $SUBJECT]
      Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      33517881
    • Shanker Donthineni's avatar
      irqchip/gicv3-its: Use NUMA aware memory allocation for ITS tables · 539d3782
      Shanker Donthineni authored
      The NUMA node information is visible to ITS driver but not being used
      other than handling hardware errata. ITS/GICR hardware accesses to the
      local NUMA node is usually quicker than the remote NUMA node. How slow
      the remote NUMA accesses are depends on the implementation details.
      
      This patch allocates memory for ITS management tables and command
      queue from the corresponding NUMA node using the appropriate NUMA
      aware functions. This change improves the performance of the ITS
      tables read latency on systems where it has more than one ITS block,
      and with the slower inter node accesses.
      
      Apache Web server benchmarking using ab tool on a HiSilicon D06
      board with multiple numa mem nodes shows Time per request and
      Transfer rate improvements of ~3.6% with this patch.
      Signed-off-by: default avatarShanker Donthineni <shankerd@codeaurora.org>
      Signed-off-by: default avatarHanjun Guo <guohanjun@huawei.com>
      Signed-off-by: default avatarShameer Kolothum <shameerali.kolothum.thodi@huawei.com>
      Reviewed-by: default avatarGanapatrao Kulkarni <gkulkarni@marvell.com>
      Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      539d3782
    • Marc Zyngier's avatar
      irqdomain: Allow the default irq domain to be retrieved · 9f199dd3
      Marc Zyngier authored
      The default irq domain allows legacy code to create irqdomain
      mappings without having to track the domain it is allocating
      from. Setting the default domain is a one shot, fire and forget
      operation, and no effort was made to be able to retrieve this
      information at a later point in time.
      
      Newer irqdomain APIs (the hierarchical stuff) relies on both
      the irqchip code to track the irqdomain it is allocating from,
      as well as some form of firmware abstraction to easily identify
      which piece of HW maps to which irq domain (DT, ACPI).
      
      For systems without such firmware (or legacy platform that are
      getting dragged into the 21st century), things are a bit harder.
      For these cases (and these cases only!), let's provide a way
      to retrieve the default domain, allowing the use of the v2 API
      without having to resort to platform-specific hacks.
      Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      9f199dd3
    • Anup Patel's avatar
      irqchip/sifive-plic: Implement irq_set_affinity() for SMP host · cc9f04f9
      Anup Patel authored
      Currently on SMP host, all CPUs take external interrupts routed via
      PLIC. All CPUs will try to claim a given external interrupt but only
      one of them will succeed while other CPUs would simply resume whatever
      they were doing before. This means if we have N CPUs then for every
      external interrupt N-1 CPUs will always fail to claim it and waste
      their CPU time.
      
      Instead of above, external interrupts should be taken by only one CPU
      and we should have provision to explicitly specify IRQ affinity from
      kernel-space or user-space.
      
      This patch provides irq_set_affinity() implementation for PLIC driver.
      It also updates irq_enable() such that PLIC interrupts are only enabled
      for one of CPUs specified in IRQ affinity mask.
      
      With this patch in-place, we can change IRQ affinity at any-time from
      user-space using procfs.
      
      Example:
      
      / # cat /proc/interrupts
                 CPU0       CPU1       CPU2       CPU3
        8:         44          0          0          0  SiFive PLIC   8  virtio0
       10:         48          0          0          0  SiFive PLIC  10  ttyS0
      IPI0:        55        663         58        363  Rescheduling interrupts
      IPI1:         0          1          3         16  Function call interrupts
      / #
      / #
      / # echo 4 > /proc/irq/10/smp_affinity
      / #
      / # cat /proc/interrupts
                 CPU0       CPU1       CPU2       CPU3
        8:         45          0          0          0  SiFive PLIC   8  virtio0
       10:        160          0         17          0  SiFive PLIC  10  ttyS0
      IPI0:        68        693         77        410  Rescheduling interrupts
      IPI1:         0          2          3         16  Function call interrupts
      Signed-off-by: default avatarAnup Patel <anup@brainfault.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      cc9f04f9
    • Anup Patel's avatar
      irqchip/sifive-plic: Differentiate between PLIC handler and context · 6adfe8d2
      Anup Patel authored
      We explicitly differentiate between PLIC handler and context because
      PLIC context is for given mode of HART whereas PLIC handler is per-CPU
      software construct meant for handling interrupts from a particular
      PLIC context.
      
      To achieve this differentiation, we rename "nr_handlers" to "nr_contexts"
      and "nr_mapped" to "nr_handlers" in plic_init().
      Signed-off-by: default avatarAnup Patel <anup@brainfault.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      6adfe8d2
    • Anup Patel's avatar
      irqchip/sifive-plic: Add warning in plic_init() if handler already present · 3fecb5aa
      Anup Patel authored
      We have two enteries (one for M-mode and another for S-mode) in the
      interrupts-extended DT property of PLIC DT node for each HART. It is
      expected that firmware/bootloader will set M-mode HWIRQ line of each
      HART to 0xffffffff (i.e. -1) in interrupts-extended DT property
      because Linux runs in S-mode only.
      
      If firmware/bootloader is buggy then it will not correctly update
      interrupts-extended DT property which might result in a plic_handler
      configured twice. This patch adds a warning in plic_init() if a
      plic_handler is already marked present. This warning provides us
      a hint about incorrectly updated interrupts-extended DT property.
      Signed-off-by: default avatarAnup Patel <anup@brainfault.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      3fecb5aa
    • Anup Patel's avatar
      irqchip/sifive-plic: Pre-compute context hart base and enable base · 86c7cbf1
      Anup Patel authored
      This patch does following optimizations:
      1. Pre-compute hart base for each context handler
      2. Pre-compute enable base for each context handler
      3. Have enable lock for each context handler instead
      of global plic_toggle_lock
      Signed-off-by: default avatarAnup Patel <anup@brainfault.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      86c7cbf1
  7. 14 Feb, 2019 6 commits
  8. 05 Feb, 2019 4 commits
  9. 21 Jan, 2019 3 commits
  10. 20 Jan, 2019 10 commits
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 7d0ae236
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix endless loop in nf_tables, from Phil Sutter.
      
       2) Fix cross namespace ip6_gre tunnel hash list corruption, from
          Olivier Matz.
      
       3) Don't be too strict in phy_start_aneg() otherwise we might not allow
          restarting auto negotiation. From Heiner Kallweit.
      
       4) Fix various KMSAN uninitialized value cases in tipc, from Ying Xue.
      
       5) Memory leak in act_tunnel_key, from Davide Caratti.
      
       6) Handle chip errata of mv88e6390 PHY, from Andrew Lunn.
      
       7) Remove linear SKB assumption in fou/fou6, from Eric Dumazet.
      
       8) Missing udplite rehash callbacks, from Alexey Kodanev.
      
       9) Log dirty pages properly in vhost, from Jason Wang.
      
      10) Use consume_skb() in neigh_probe() as this is a normal free not a
          drop, from Yang Wei. Likewise in macvlan_process_broadcast().
      
      11) Missing device_del() in mdiobus_register() error paths, from Thomas
          Petazzoni.
      
      12) Fix checksum handling of short packets in mlx5, from Cong Wang.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (96 commits)
        bpf: in __bpf_redirect_no_mac pull mac only if present
        virtio_net: bulk free tx skbs
        net: phy: phy driver features are mandatory
        isdn: avm: Fix string plus integer warning from Clang
        net/mlx5e: Fix cb_ident duplicate in indirect block register
        net/mlx5e: Fix wrong (zero) TX drop counter indication for representor
        net/mlx5e: Fix wrong error code return on FEC query failure
        net/mlx5e: Force CHECKSUM_UNNECESSARY for short ethernet frames
        tools: bpftool: Cleanup license mess
        bpf: fix inner map masking to prevent oob under speculation
        bpf: pull in pkt_sched.h header for tooling to fix bpftool build
        selftests: forwarding: Add a test case for externally learned FDB entries
        selftests: mlxsw: Test FDB offload indication
        mlxsw: spectrum_switchdev: Do not treat static FDB entries as sticky
        net: bridge: Mark FDB entries that were added by user as such
        mlxsw: spectrum_fid: Update dummy FID index
        mlxsw: pci: Return error on PCI reset timeout
        mlxsw: pci: Increase PCI SW reset timeout
        mlxsw: pci: Ring CQ's doorbell before RDQ's
        MAINTAINERS: update email addresses of liquidio driver maintainers
        ...
      7d0ae236
    • Kees Cook's avatar
      pstore/ram: Avoid allocation and leak of platform data · 5631e857
      Kees Cook authored
      Yue Hu noticed that when parsing device tree the allocated platform data
      was never freed. Since it's not used beyond the function scope, this
      switches to using a stack variable instead.
      Reported-by: default avatarYue Hu <huyue2@yulong.com>
      Fixes: 35da6094 ("pstore/ram: add Device Tree bindings")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      5631e857
    • Ard Biesheuvel's avatar
      gcc-plugins: arm_ssp_per_task_plugin: fix for GCC 9+ · 2c88c742
      Ard Biesheuvel authored
      GCC 9 reworks the way the references to the stack canary are
      emitted, to prevent the value from being spilled to the stack
      before the final comparison in the epilogue, defeating the
      purpose, given that the spill slot is under control of the
      attacker that we are protecting ourselves from.
      
      Since our canary value address is obtained without accessing
      memory (as opposed to pre-v7 code that will obtain it from a
      literal pool), it is unlikely (although not guaranteed) that
      the compiler will spill the canary value in the same way, so
      let's just disable this improvement when building with GCC9+.
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      2c88c742
    • Ard Biesheuvel's avatar
      gcc-plugins: arm_ssp_per_task_plugin: sign extend the SP mask · 560706d5
      Ard Biesheuvel authored
      The ARM per-task stack protector GCC plugin hits an assert in
      the compiler in some case, due to the fact the the SP mask
      expression is not sign-extended as it should be. So fix that.
      Suggested-by: default avatarKugan Vivekanandarajah <kugan.vivekanandarajah@linaro.org>
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      560706d5
    • Linus Torvalds's avatar
      Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost · bb617b9b
      Linus Torvalds authored
      Pull virtio/vhost fixes and cleanups from Michael Tsirkin:
       "Fixes and cleanups all over the place"
      
      * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
        vhost/scsi: Use copy_to_iter() to send control queue response
        vhost: return EINVAL if iovecs size does not match the message size
        virtio-balloon: tweak config_changed implementation
        virtio: don't allocate vqs when names[i] = NULL
        virtio_pci: use queue idx instead of array idx to set up the vq
        virtio: document virtio_config_ops restrictions
        virtio: fix virtio_config_ops description
      bb617b9b
    • Linus Torvalds's avatar
      Merge tag 'for-5.0-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 1be969f4
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
       "A handful of fixes (some of them in testing for a long time):
      
         - fix some test failures regarding cleanup after transaction abort
      
         - revert of a patch that could cause a deadlock
      
         - delayed iput fixes, that can help in ENOSPC situation when there's
           low space and a lot data to write"
      
      * tag 'for-5.0-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: wakeup cleaner thread when adding delayed iput
        btrfs: run delayed iputs before committing
        btrfs: wait on ordered extents on abort cleanup
        btrfs: handle delayed ref head accounting cleanup in abort
        Revert "btrfs: balance dirty metadata pages in btrfs_finish_ordered_io"
      1be969f4
    • Linus Torvalds's avatar
      Merge tags 'compiler-attributes-for-linus-v5.0-rc3' and... · 315a6d85
      Linus Torvalds authored
      Merge tags 'compiler-attributes-for-linus-v5.0-rc3' and 'clang-format-for-linus-v5.0-rc3' of git://github.com/ojeda/linux
      
      Pull misc clang fixes from Miguel Ojeda:
      
        - A fix for OPTIMIZER_HIDE_VAR from Michael S Tsirkin
      
        - Update clang-format with the latest for_each macro list from Jason
          Gunthorpe
      
      * tag 'compiler-attributes-for-linus-v5.0-rc3' of git://github.com/ojeda/linux:
        include/linux/compiler*.h: fix OPTIMIZER_HIDE_VAR
      
      * tag 'clang-format-for-linus-v5.0-rc3' of git://github.com/ojeda/linux:
        clang-format: Update .clang-format with the latest for_each macro list
      315a6d85
    • Florian La Roche's avatar
      fix int_sqrt64() for very large numbers · fbfaf851
      Florian La Roche authored
      If an input number x for int_sqrt64() has the highest bit set, then
      fls64(x) is 64.  (1UL << 64) is an overflow and breaks the algorithm.
      
      Subtracting 1 is a better guess for the initial value of m anyway and
      that's what also done in int_sqrt() implicitly [*].
      
      [*] Note how int_sqrt() uses __fls() with two underscores, which already
          returns the proper raw bit number.
      
          In contrast, int_sqrt64() used fls64(), and that returns bit numbers
          illogically starting at 1, because of error handling for the "no
          bits set" case. Will points out that he bug probably is due to a
          copy-and-paste error from the regular int_sqrt() case.
      Signed-off-by: default avatarFlorian La Roche <Florian.LaRoche@googlemail.com>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fbfaf851
    • Will Deacon's avatar
      x86: uaccess: Inhibit speculation past access_ok() in user_access_begin() · 6e693b3f
      Will Deacon authored
      Commit 594cc251 ("make 'user_access_begin()' do 'access_ok()'")
      makes the access_ok() check part of the user_access_begin() preceding a
      series of 'unsafe' accesses.  This has the desirable effect of ensuring
      that all 'unsafe' accesses have been range-checked, without having to
      pick through all of the callsites to verify whether the appropriate
      checking has been made.
      
      However, the consolidated range check does not inhibit speculation, so
      it is still up to the caller to ensure that they are not susceptible to
      any speculative side-channel attacks for user addresses that ultimately
      fail the access_ok() check.
      
      This is an oversight, so use __uaccess_begin_nospec() to ensure that
      speculation is inhibited until the access_ok() check has passed.
      Reported-by: default avatarJulien Thierry <julien.thierry@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6e693b3f
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · b0f3e768
      Linus Torvalds authored
      Pull arm64 fixes from Will Deacon:
       "Three arm64 fixes for -rc3.
      
        We've plugged a couple of nasty issues involving KASLR-enabled
        kernels, and removed a redundant #define that was introduced as part
        of the KHWASAN fixes from akpm at -rc2.
      
         - Fix broken kpti page-table rewrite in bizarre KASLR configuration
      
         - Fix module loading with KASLR
      
         - Remove redundant definition of ARCH_SLAB_MINALIGN"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        kasan, arm64: remove redundant ARCH_SLAB_MINALIGN define
        arm64: kaslr: ensure randomized quantities are clean to the PoC
        arm64: kpti: Update arm64_kernel_use_ng_mappings() when forced on
      b0f3e768