1. 31 Jul, 2020 32 commits
  2. 22 Jul, 2020 8 commits
    • Greg Kroah-Hartman's avatar
      Linux 4.9.231 · 79193f36
      Greg Kroah-Hartman authored
      79193f36
    • Suraj Jitindar Singh's avatar
      x86/cpu: Move x86_cache_bits settings · 9e53463c
      Suraj Jitindar Singh authored
      This patch is to fix the backport of the upstream patch:
      cc51e542 x86/speculation/l1tf: Increase l1tf memory limit for Nehalem+
      
      When this was backported to the 4.9 and 4.14 stable branches the line
      +       c->x86_cache_bits = c->x86_phys_bits;
      was applied in the wrong place, being added to the
      identify_cpu_without_cpuid() function instead of the get_cpu_cap()
      function which it was correctly applied to in the 4.4 backport.
      
      This means that x86_cache_bits is not set correctly resulting in the
      following warning due to the cache bits being left uninitalised (zero).
      
       WARNING: CPU: 0 PID: 7566 at arch/x86/kvm/mmu.c:284 kvm_mmu_set_mmio_spte_mask+0x4e/0x60 [kvm
       Modules linked in: kvm_intel(+) kvm irqbypass ipv6 crc_ccitt binfmt_misc evdev lpc_ich mfd_core ioatdma pcc_cpufreq dca ena acpi_power_meter hwmon acpi_pad button ext4 crc16 mbcache jbd2 fscrypto nvme nvme_core dm_mirror dm_region_hash dm_log dm_mod dax
       Hardware name: Amazon EC2 i3.metal/Not Specified, BIOS 1.0 10/16/2017
       task: ffff88ff77704c00 task.stack: ffffc9000edac000
       RIP: 0010:kvm_mmu_set_mmio_spte_mask+0x4e/0x60 [kvm
       RSP: 0018:ffffc9000edafc60 EFLAGS: 00010206
       RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00000000ffffff45
       RDX: 000000000000002e RSI: 0008000000000001 RDI: 0008000000000001
       RBP: ffffffffa036f000 R08: ffffffffffffff80 R09: ffffe8ffffccb3c0
       R10: 0000000000000038 R11: 0000000000000000 R12: 0000000000005b80
       R13: ffffffffa0370e40 R14: 0000000000000001 R15: ffff88bf7c0927e0
       FS:  00007fa316f24740(0000) GS:ffff88bf7f600000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 00007fa316ea0000 CR3: 0000003f7e986004 CR4: 00000000003606f0
       DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
       DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
       Call Trace:
        kvm_mmu_module_init+0x166/0x230 [kvm
        kvm_arch_init+0x5d/0x150 [kvm
        kvm_init+0x1c/0x2d0 [kvm
        ? hardware_setup+0x4a6/0x4a6 [kvm_intel
        vmx_init+0x23/0x6aa [kvm_intel
        ? hardware_setup+0x4a6/0x4a6 [kvm_intel
        do_one_initcall+0x3e/0x15d
        do_init_module+0x5b/0x1e5
        load_module+0x19e6/0x1dc0
        ? SYSC_init_module+0x13b/0x170
        SYSC_init_module+0x13b/0x170
        do_syscall_64+0x67/0x110
        entry_SYSCALL_64_after_hwframe+0x41/0xa6
       RIP: 0033:0x7fa316828f3a
       RSP: 002b:00007ffc9d65c1f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000af
       RAX: ffffffffffffffda RBX: 00007fa316b08849 RCX: 00007fa316828f3a
       RDX: 00007fa316b08849 RSI: 0000000000071328 RDI: 00007fa316e37000
       RBP: 0000000000b47e80 R08: 0000000000000003 R09: 0000000000000000
       R10: 00007fa316822dba R11: 0000000000000246 R12: 0000000000b46340
       R13: 0000000000b464c0 R14: 0000000000000000 R15: 0000000000040000
       Code: e9 65 06 00 75 25 48 b8 00 00 00 00 00 00 00 40 48 09 c6 48 09 c7 48 89 35 f8 65 06 00 48 89 3d f9 65 06 00 c3 0f 0b 0f 0b eb d2 <0f> 0b eb d7 0f 1f 40 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44
      
      Fixes: 4.9.x  ef3d45c9 x86/speculation/l1tf: Increase l1tf memory limit for Nehalem+
      Fixes: 4.14.x ec403483 x86/speculation/l1tf: Increase l1tf memory limit for Nehalem+
      Cc: stable@vger.kernel.org # 4.9.x-4.14.x
      Signed-off-by: default avatarSuraj Jitindar Singh <surajjs@amazon.com>
      Reviewed-by: default avatarSamuel Mendoza-Jonas <samjonas@amazon.com>
      Reviewed-by: default avatarFrank van der Linden <fllinden@amazon.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9e53463c
    • Marc Zyngier's avatar
      irqchip/gic: Atomically update affinity · c50b30f3
      Marc Zyngier authored
      commit 005c34ae upstream.
      
      The GIC driver uses a RMW sequence to update the affinity, and
      relies on the gic_lock_irqsave/gic_unlock_irqrestore sequences
      to update it atomically.
      
      But these sequences only expand into anything meaningful if
      the BL_SWITCHER option is selected, which almost never happens.
      
      It also turns out that using a RMW and locks is just as silly,
      as the GIC distributor supports byte accesses for the GICD_TARGETRn
      registers, which when used make the update atomic by definition.
      
      Drop the terminally broken code and replace it by a byte write.
      
      Fixes: 04c8b0f8 ("irqchip/gic: Make locking a BL_SWITCHER only feature")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      c50b30f3
    • Vincent Guittot's avatar
      sched/fair: handle case of task_h_load() returning 0 · 8b72b56b
      Vincent Guittot authored
      commit 01cfcde9 upstream.
      
      task_h_load() can return 0 in some situations like running stress-ng
      mmapfork, which forks thousands of threads, in a sched group on a 224 cores
      system. The load balance doesn't handle this correctly because
      env->imbalance never decreases and it will stop pulling tasks only after
      reaching loop_max, which can be equal to the number of running tasks of
      the cfs. Make sure that imbalance will be decreased by at least 1.
      
      misfit task is the other feature that doesn't handle correctly such
      situation although it's probably more difficult to face the problem
      because of the smaller number of CPUs and running tasks on heterogenous
      system.
      
      We can't simply ensure that task_h_load() returns at least one because it
      would imply to handle underflow in other places.
      Signed-off-by: default avatarVincent Guittot <vincent.guittot@linaro.org>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Reviewed-by: default avatarValentin Schneider <valentin.schneider@arm.com>
      Reviewed-by: default avatarDietmar Eggemann <dietmar.eggemann@arm.com>
      Tested-by: default avatarDietmar Eggemann <dietmar.eggemann@arm.com>
      Cc: <stable@vger.kernel.org> # v4.4+
      Link: https://lkml.kernel.org/r/20200710152426.16981-1-vincent.guittot@linaro.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      8b72b56b
    • Will Deacon's avatar
      arm64: ptrace: Override SPSR.SS when single-stepping is enabled · c5e7ebb2
      Will Deacon authored
      commit 3a5a4366 upstream.
      
      Luis reports that, when reverse debugging with GDB, single-step does not
      function as expected on arm64:
      
        | I've noticed, under very specific conditions, that a PTRACE_SINGLESTEP
        | request by GDB won't execute the underlying instruction. As a consequence,
        | the PC doesn't move, but we return a SIGTRAP just like we would for a
        | regular successful PTRACE_SINGLESTEP request.
      
      The underlying problem is that when the CPU register state is restored
      as part of a reverse step, the SPSR.SS bit is cleared and so the hardware
      single-step state can transition to the "active-pending" state, causing
      an unexpected step exception to be taken immediately if a step operation
      is attempted.
      
      In hindsight, we probably shouldn't have exposed SPSR.SS in the pstate
      accessible by the GPR regset, but it's a bit late for that now. Instead,
      simply prevent userspace from configuring the bit to a value which is
      inconsistent with the TIF_SINGLESTEP state for the task being traced.
      
      Cc: <stable@vger.kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Keno Fischer <keno@juliacomputing.com>
      Link: https://lore.kernel.org/r/1eed6d69-d53d-9657-1fc9-c089be07f98c@linaro.orgReported-by: default avatarLuis Machado <luis.machado@linaro.org>
      Tested-by: default avatarLuis Machado <luis.machado@linaro.org>
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c5e7ebb2
    • Michał Mirosław's avatar
      misc: atmel-ssc: lock with mutex instead of spinlock · d090d02c
      Michał Mirosław authored
      commit b037d60a upstream.
      
      Uninterruptible context is not needed in the driver and causes lockdep
      warning because of mutex taken in of_alias_get_id(). Convert the lock to
      mutex to avoid the issue.
      
      Cc: stable@vger.kernel.org
      Fixes: 099343c6 ("ARM: at91: atmel-ssc: add device tree support")
      Signed-off-by: default avatarMichał Mirosław <mirq-linux@rere.qmqm.pl>
      Link: https://lore.kernel.org/r/50f0d7fa107f318296afb49477c3571e4d6978c5.1592998403.git.mirq-linux@rere.qmqm.plSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d090d02c
    • Krzysztof Kozlowski's avatar
      dmaengine: fsl-edma: Fix NULL pointer exception in fsl_edma_tx_handler · f6797fe6
      Krzysztof Kozlowski authored
      commit f5e5677c upstream.
      
      NULL pointer exception happens occasionally on serial output initiated
      by login timeout.  This was reproduced only if kernel was built with
      significant debugging options and EDMA driver is used with serial
      console.
      
          col-vf50 login: root
          Password:
          Login timed out after 60 seconds.
          Unable to handle kernel NULL pointer dereference at virtual address 00000044
          Internal error: Oops: 5 [#1] ARM
          CPU: 0 PID: 157 Comm: login Not tainted 5.7.0-next-20200610-dirty #4
          Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
            (fsl_edma_tx_handler) from [<8016eb10>] (__handle_irq_event_percpu+0x64/0x304)
            (__handle_irq_event_percpu) from [<8016eddc>] (handle_irq_event_percpu+0x2c/0x7c)
            (handle_irq_event_percpu) from [<8016ee64>] (handle_irq_event+0x38/0x5c)
            (handle_irq_event) from [<801729e4>] (handle_fasteoi_irq+0xa4/0x160)
            (handle_fasteoi_irq) from [<8016ddcc>] (generic_handle_irq+0x34/0x44)
            (generic_handle_irq) from [<8016e40c>] (__handle_domain_irq+0x54/0xa8)
            (__handle_domain_irq) from [<80508bc8>] (gic_handle_irq+0x4c/0x80)
            (gic_handle_irq) from [<80100af0>] (__irq_svc+0x70/0x98)
          Exception stack(0x8459fe80 to 0x8459fec8)
          fe80: 72286b00 e3359f64 00000001 0000412d a0070013 85c98840 85c98840 a0070013
          fea0: 8054e0d4 00000000 00000002 00000000 00000002 8459fed0 8081fbe8 8081fbec
          fec0: 60070013 ffffffff
            (__irq_svc) from [<8081fbec>] (_raw_spin_unlock_irqrestore+0x30/0x58)
            (_raw_spin_unlock_irqrestore) from [<8056cb48>] (uart_flush_buffer+0x88/0xf8)
            (uart_flush_buffer) from [<80554e60>] (tty_ldisc_hangup+0x38/0x1ac)
            (tty_ldisc_hangup) from [<8054c7f4>] (__tty_hangup+0x158/0x2bc)
            (__tty_hangup) from [<80557b90>] (disassociate_ctty.part.1+0x30/0x23c)
            (disassociate_ctty.part.1) from [<8011fc18>] (do_exit+0x580/0xba0)
            (do_exit) from [<801214f8>] (do_group_exit+0x3c/0xb4)
            (do_group_exit) from [<80121580>] (__wake_up_parent+0x0/0x14)
      
      Issue looks like race condition between interrupt handler fsl_edma_tx_handler()
      (called as result of fsl_edma_xfer_desc()) and terminating the transfer with
      fsl_edma_terminate_all().
      
      The fsl_edma_tx_handler() handles interrupt for a transfer with already freed
      edesc and idle==true.
      
      Fixes: d6be34fb ("dma: Add Freescale eDMA engine driver support")
      Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
      Reviewed-by: default avatarRobin Gong <yibin.gong@nxp.com>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/1591877861-28156-2-git-send-email-krzk@kernel.orgSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f6797fe6
    • Vishwas M's avatar
      hwmon: (emc2103) fix unable to change fan pwm1_enable attribute · 1b6a059e
      Vishwas M authored
      commit 14b0e83d upstream.
      
      This patch fixes a bug which does not let FAN mode to be changed from
      sysfs(pwm1_enable). i.e pwm1_enable can not be set to 3, it will always
      remain at 0.
      
      This is caused because the device driver handles the result of
      "read_u8_from_i2c(client, REG_FAN_CONF1, &conf_reg)" incorrectly. The
      driver thinks an error has occurred if the (result != 0). This has been
      fixed by changing the condition to (result < 0).
      Signed-off-by: default avatarVishwas M <vishwas.reddy.vr@gmail.com>
      Link: https://lore.kernel.org/r/20200707142747.118414-1-vishwas.reddy.vr@gmail.com
      Fixes: 9df7305b ("hwmon: Add driver for SMSC EMC2103 temperature monitor and fan controller")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1b6a059e