1. 21 Aug, 2020 2 commits
    • Will Deacon's avatar
      KVM: arm64: Only reschedule if MMU_NOTIFIER_RANGE_BLOCKABLE is not set · b5331379
      Will Deacon authored
      When an MMU notifier call results in unmapping a range that spans multiple
      PGDs, we end up calling into cond_resched_lock() when crossing a PGD boundary,
      since this avoids running into RCU stalls during VM teardown. Unfortunately,
      if the VM is destroyed as a result of OOM, then blocking is not permitted
      and the call to the scheduler triggers the following BUG():
       | BUG: sleeping function called from invalid context at arch/arm64/kvm/mmu.c:394
       | in_atomic(): 1, irqs_disabled(): 0, non_block: 1, pid: 36, name: oom_reaper
       | INFO: lockdep is turned off.
       | CPU: 3 PID: 36 Comm: oom_reaper Not tainted 5.8.0 #1
       | Hardware name: QEMU QEMU Virtual Machine, BIOS 0.0.0 02/06/2015
       | Call trace:
       |  dump_backtrace+0x0/0x284
       |  show_stack+0x1c/0x28
       |  dump_stack+0xf0/0x1a4
       |  ___might_sleep+0x2bc/0x2cc
       |  unmap_stage2_range+0x160/0x1ac
       |  kvm_unmap_hva_range+0x1a0/0x1c8
       |  kvm_mmu_notifier_invalidate_range_start+0x8c/0xf8
       |  __mmu_notifier_invalidate_range_start+0x218/0x31c
       |  mmu_notifier_invalidate_range_start_nonblock+0x78/0xb0
       |  __oom_reap_task_mm+0x128/0x268
       |  oom_reap_task+0xac/0x298
       |  oom_reaper+0x178/0x17c
       |  kthread+0x1e4/0x1fc
       |  ret_from_fork+0x10/0x30
      Use the new 'flags' argument to kvm_unmap_hva_range() to ensure that we
      only reschedule if MMU_NOTIFIER_RANGE_BLOCKABLE is set in the notifier
      Cc: <stable@vger.kernel.org>
      Fixes: 8b3405e3
       ("kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd")
      Cc: Marc Zyngier <maz@kernel.org>
      Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
      Cc: James Morse <james.morse@arm.com>
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      Message-Id: <20200811102725.7121-3-will@kernel.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    • Will Deacon's avatar
      KVM: Pass MMU notifier range flags to kvm_unmap_hva_range() · fdfe7cbd
      Will Deacon authored
      The 'flags' field of 'struct mmu_notifier_range' is used to indicate
      whether invalidate_range_{start,end}() are permitted to block. In the
      case of kvm_mmu_notifier_invalidate_range_start(), this field is not
      forwarded on to the architecture-specific implementation of
      kvm_unmap_hva_range() and therefore the backend cannot sensibly decide
      whether or not to block.
      Add an extra 'flags' parameter to kvm_unmap_hva_range() so that
      architectures are aware as to whether or not they are permitted to block.
      Cc: <stable@vger.kernel.org>
      Cc: Marc Zyngier <maz@kernel.org>
      Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
      Cc: James Morse <james.morse@arm.com>
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      Message-Id: <20200811102725.7121-2-will@kernel.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
  2. 17 Aug, 2020 4 commits
    • Jim Mattson's avatar
      kvm: x86: Toggling CR4.PKE does not load PDPTEs in PAE mode · cb957adb
      Jim Mattson authored
      See the SDM, volume 3, section 4.4.1:
      If PAE paging would be in use following an execution of MOV to CR0 or
      MOV to CR4 (see Section 4.1.1) and the instruction is modifying any of
      CR0.CD, CR0.NW, CR0.PG, CR4.PAE, CR4.PGE, CR4.PSE, or CR4.SMEP; then
      the PDPTEs are loaded from the address in CR3.
      Fixes: b9baba86
       ("KVM, pkeys: expose CPUID/CR4 to guest")
      Cc: Huaitong Han <huaitong.han@intel.com>
      Signed-off-by: default avatarJim Mattson <jmattson@google.com>
      Reviewed-by: default avatarPeter Shier <pshier@google.com>
      Reviewed-by: default avatarOliver Upton <oupton@google.com>
      Message-Id: <20200817181655.3716509-1-jmattson@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    • Jim Mattson's avatar
      kvm: x86: Toggling CR4.SMAP does not load PDPTEs in PAE mode · 427890af
      Jim Mattson authored
      See the SDM, volume 3, section 4.4.1:
      If PAE paging would be in use following an execution of MOV to CR0 or
      MOV to CR4 (see Section 4.1.1) and the instruction is modifying any of
      CR0.CD, CR0.NW, CR0.PG, CR4.PAE, CR4.PGE, CR4.PSE, or CR4.SMEP; then
      the PDPTEs are loaded from the address in CR3.
      Fixes: 0be0226f
       ("KVM: MMU: fix SMAP virtualization")
      Cc: Xiao Guangrong <guangrong.xiao@linux.intel.com>
      Signed-off-by: default avatarJim Mattson <jmattson@google.com>
      Reviewed-by: default avatarPeter Shier <pshier@google.com>
      Reviewed-by: default avatarOliver Upton <oupton@google.com>
      Message-Id: <20200817181655.3716509-2-jmattson@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    • Paolo Bonzini's avatar
      KVM: x86: fix access code passed to gva_to_gpa · 19cf4b7e
      Paolo Bonzini authored
      The PK bit of the error code is computed dynamically in permission_fault
      and therefore need not be passed to gva_to_gpa: only the access bits
      (fetch, user, write) need to be passed down.
      Not doing so causes a splat in the pku test:
         WARNING: CPU: 25 PID: 5465 at arch/x86/kvm/mmu.h:197 paging64_walk_addr_generic+0x594/0x750 [kvm]
         Hardware name: Intel Corporation WilsonCity/WilsonCity, BIOS WLYDCRB1.SYS.0014.D62.2001092233 01/09/2020
         RIP: 0010:paging64_walk_addr_generic+0x594/0x750 [kvm]
         Code: <0f> 0b e9 db fe ff ff 44 8b 43 04 4c 89 6c 24 30 8b 13 41 39 d0 89
         RSP: 0018:ff53778fc623fb60 EFLAGS: 00010202
         RAX: 0000000000000001 RBX: ff53778fc623fbf0 RCX: 0000000000000007
         RDX: 0000000000000001 RSI: 0000000000000002 RDI: ff4501efba818000
         RBP: 0000000000000020 R08: 0000000000000005 R09: 00000000004000e7
         R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000007
         R13: ff4501efba818388 R14: 10000000004000e7 R15: 0000000000000000
         FS:  00007f2dcf31a700(0000) GS:ff4501f1c8040000(0000) knlGS:0000000000000000
         CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
         CR2: 0000000000000000 CR3: 0000001dea475005 CR4: 0000000000763ee0
         DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
         DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
         PKRU: 55555554
         Call Trace:
          paging64_gva_to_gpa+0x3f/0xb0 [kvm]
          kvm_fixup_and_inject_pf_error+0x48/0xa0 [kvm]
          handle_exception_nmi+0x4fc/0x5b0 [kvm_intel]
          kvm_arch_vcpu_ioctl_run+0x911/0x1c10 [kvm]
          kvm_vcpu_ioctl+0x23e/0x5d0 [kvm]
         ---[ end trace d17eb998aee991da ]---
      Reported-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
      Fixes: 89786147
       ("KVM: x86: Add helper functions for illegal GPA checking and page fault injection")
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    • Yang Weijiang's avatar
      selftests: kvm: Use a shorter encoding to clear RAX · 98b0bf02
      Yang Weijiang authored
      If debug_regs.c is built with newer binutils, the resulting binary is "optimized"
      by the assembler:
      asm volatile("ss_start: "
                   "xor %%rax,%%rax\n\t"
                   "movl $0x1a0,%%ecx\n\t"
                   : : : "rax", "ecx");
      is translated to :
        000000000040194e <ss_start>:
        40194e:       31 c0                   xor    %eax,%eax     <----- rax->eax?
        401950:       0f a2                   cpuid
        401952:       b9 a0 01 00 00          mov    $0x1a0,%ecx
        401957:       0f 32                   rdmsr
      As you can see rax is replaced with eax in target binary code.
      This causes a difference is the length of xor instruction (2 Byte vs 3 Byte),
      and makes the hard-coded instruction length check fail:
              /* Instruction lengths starting at ss_start */
              int ss_size[4] = {
                      3,              /* xor */   <-------- 2 or 3?
                      2,              /* cpuid */
                      5,              /* mov */
                      2,              /* rdmsr */
      Encode the shorter version directly and, while at it, fix the "clobbers"
      of the asm.
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarYang Weijiang <weijiang.yang@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
  3. 11 Aug, 2020 1 commit
    • Xingxing Su's avatar
      KVM: MIPS/VZ: Fix build error caused by 'kvm_run' cleanup · e792415c
      Xingxing Su authored
      Commit c34b26b9
       ("KVM: MIPS: clean up redundant 'kvm_run'
      parameters") remove the 'kvm_run' parameter in kvm_vz_gpsi_lwc2.
      The following build error:
      arch/mips/kvm/vz.c: In function 'kvm_trap_vz_handle_gpsi':
      arch/mips/kvm/vz.c:1243:43: error: 'run' undeclared (first use in this function)
         er = kvm_vz_gpsi_lwc2(inst, opc, cause, run, vcpu);
      arch/mips/kvm/vz.c:1243:43: note: each undeclared identifier is reported only
      once for each function it appears in
      scripts/Makefile.build:283: recipe for target 'arch/mips/kvm/vz.o' failed
      make[2]: *** [arch/mips/kvm/vz.o] Error 1
      scripts/Makefile.build:500: recipe for target 'arch/mips/kvm' failed
      make[1]: *** [arch/mips/kvm] Error 2
      Makefile:1785: recipe for target 'arch/mips' failed
      make: *** [arch/mips] Error 2
      Signed-off-by: default avatarXingxing Su <suxingxing@loongson.cn>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
  4. 10 Aug, 2020 2 commits
  5. 09 Aug, 2020 5 commits
  6. 08 Aug, 2020 10 commits
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 06a81c1c
      Linus Torvalds authored
      Pull arm64 fixes from Catalin Marinas:
       - Fix tegra194-cpufreq module build failure caused by __cpu_logical_map
         not being exported.
       - Improve fixed_addresses comment regarding the fixmap buffer sizes.
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: Fix __cpu_logical_map undefined issue
        arm64/fixmap: make notes of fixed_addresses more precisely
    • Kefeng Wang's avatar
      arm64: Fix __cpu_logical_map undefined issue · eaecca9e
      Kefeng Wang authored
      The __cpu_logical_map undefined issue occued when the new
      tegra194-cpufreq drvier building as a module.
      ERROR: modpost: "__cpu_logical_map" [drivers/cpufreq/tegra194-cpufreq.ko] undefined!
      The driver using cpu_logical_map() macro which will expand to
      __cpu_logical_map, we can't access it in a drvier. Let's turn
      cpu_logical_map() into a C wrapper and export it to fix the
      build issue.
      Also create a function set_cpu_logical_map(cpu, hwid) when assign
      a value to cpu_logical_map(cpu).
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
    • Pingfan Liu's avatar
      arm64/fixmap: make notes of fixed_addresses more precisely · 489577d7
      Pingfan Liu authored
      These 'compile-time allocated' memory buffers can occupy more than one
      page and each enum increment is page-sized. So improve the note about it.
      Signed-off-by: default avatarPingfan Liu <kernelfans@gmail.com>
      Cc: Will Deacon <will@kernel.org>
      Link: https://lore.kernel.org/r/1596460720-19243-1-git-send-email-kernelfans@gmail.com
      To: linux-arm-kernel@lists.infradead.org
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.9-1' of git://github.com/cminyard/linux-ipmi · 11030fe9
      Linus Torvalds authored
      Pull IPMI updates from Corey Minyard:
       "Minor cleanups to the IPMI driver for 5.9
        Nothing of any major consequence. Duplicate code, some missing \n's in
        sysfs files, some documentation and comment changes"
      * tag 'for-linus-5.9-1' of git://github.com/cminyard/linux-ipmi:
        ipmi/watchdog: add missing newlines when printing parameters by sysfs
        ipmi: remve duplicate code in __ipmi_bmc_register()
        ipmi: ssif: Remove finished TODO comment about SMBus alert
        Doc: driver-api: ipmi: Add description of alerts_broken module param
    • Linus Torvalds's avatar
      Merge tag 'for-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply · 449dc8c9
      Linus Torvalds authored
      Pull power supply and reset updates from Sebastian Reichel:
       "Power-supply core:
         - add COOL/WARM/HOT state from JEITA JISC8712:2015 specification
         - convert simple-battery DT binding to YAML
         - add long-life charging mode
       Battery/charger drivers:
         - bq25150: new charger driver
         - bq27xxx: add support for BQ27z561 and BQ28z610
         - max17040: support CAPACITY_ALERT_MIN
         - sbs-battery: add PEC support
         - wilco-ec: support long-life charging mode
         - bq25890: fix DT binding
         - misc. fixes and cleanups
       Reset drivers:
         - linkstation: new reset driver"
      * tag 'for-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (32 commits)
        power: supply: wilco_ec: Add long life charging mode
        power: supply: bq27xxx_battery: Add the BQ28z610 Battery monitor
        dt-bindings: power: Add BQ28z610 compatible
        power: supply: bq27xxx_battery: Add the BQ27Z561 Battery monitor
        dt-bindings: power: Add BQ27Z561 compatible
        power: supply: test_power: Fix battery_current initial value
        power: supply: Fix kerneldoc of power_supply_temp2resist_simple()
        power: supply: cpcap-battery: Fix kerneldoc of cpcap_battery_read_accumulated()
        dt-bindings: power: Convert battery.txt to battery.yaml
        power: supply: rt5033_battery: Fix error code in rt5033_battery_probe()
        power: supply: max17040: Add POWER_SUPPLY_PROP_CAPACITY_ALERT_MIN
        power: supply: check if calc_soc succeeded in pm860x_init_battery
        power: supply: bq2xxxx: Replace HTTP links with HTTPS ones
        power: reset: add driver for LinkStation power off
        power: supply: sc27xx: prevent adc * 1000 from overflow
        math64: New DIV_S64_ROUND_CLOSEST helper
        power: fix duplicated words in bq2415x_charger.h
        power: Convert to DEFINE_SHOW_ATTRIBUTE
        power: reset: keystone-reset: Replace HTTP links with HTTPS ones
        power: supply: bq25150 introduce the bq25150
    • Linus Torvalds's avatar
      Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · b79675e1
      Linus Torvalds authored
      Pull misc vfs updates from Al Viro:
       "No common topic whatsoever in those, sorry"
      * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        fs: define inode flags using bit numbers
        iov_iter: Move unnecessary inclusion of crypto/hash.h
        dlmfs: clean up dlmfs_file_{read,write}() a bit
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · d57b2b5b
      Linus Torvalds authored
      Pull mount leak fix from Al Viro:
       "Regression fix for the syscalls-for-init series - fix a leak of a 'struct path'"
      * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        fs: fix a struct path leak in path_umount
    • Linus Torvalds's avatar
      Merge tag 'pci-v5.9-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · 049eb096
      Linus Torvalds authored
      Pull PCI updates from Bjorn Helgaas:
         - Fix pci_cfg_wait queue locking problem (Bjorn Helgaas)
         - Convert PCIe capability PCIBIOS errors to errno (Bolarinwa Olayemi
         - Align PCIe capability and PCI accessor return values (Bolarinwa
           Olayemi Saheed)
         - Fix pci_create_slot() reference count leak (Qiushi Wu)
         - Announce device after early fixups (Tiezhu Yang)
        PCI device hotplug:
         - Make rpadlpar functions static (Wei Yongjun)
        Driver binding:
         - Add device even if driver attach failed (Rajat Jain)
         - xen: Remove redundant initialization of irq (Colin Ian King)
         - Add pci_pri_supported() to check device or associated PF (Ashok Raj)
         - Release IVRS table in AMD ACS quirk (Hanjun Guo)
         - Mark AMD Navi10 GPU rev 0x00 ATS as broken (Kai-Heng Feng)
         - Treat "external-facing" devices themselves as internal (Rajat Jain)
         - Forwar...
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 32663c78
      Linus Torvalds authored
      Pull tracing updates from Steven Rostedt:
       - The biggest news in that the tracing ring buffer can now time events
         that interrupted other ring buffer events.
         Before this change, if an interrupt came in while recording another
         event, and that interrupt also had an event, those events would all
         have the same time stamp as the event it interrupted.
         Now, with the new design, those events will have a unique time stamp
         and rightfully display the time for those events that were recorded
         while interrupting another event.
       - Bootconfig how has an "override" operator that lets the users have a
         default config, but then add options to override the default.
       - A fix was made to properly filter function graph tracing to the
         ftrace PIDs. This came in at the end of the -rc cycle, and needs to
         be backported.
       - Several clean ups, performance updates, and minor fixes as well.
      * tag 'trace-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (39 commits)
        tracing: Add trace_array_init_printk() to initialize instance trace_printk() buffers
        kprobes: Fix compiler warning for !CONFIG_KPROBES_ON_FTRACE
        tracing: Use trace_sched_process_free() instead of exit() for pid tracing
        bootconfig: Fix to find the initargs correctly
        Documentation: bootconfig: Add bootconfig override operator
        tools/bootconfig: Add testcases for value override operator
        lib/bootconfig: Add override operator support
        kprobes: Remove show_registers() function prototype
        tracing/uprobe: Remove dead code in trace_uprobe_register()
        kprobes: Fix NULL pointer dereference at kprobe_ftrace_handler
        ftrace: Fix ftrace_trace_task return value
        tracepoint: Use __used attribute definitions from compiler_attributes.h
        tracepoint: Mark __tracepoint_string's __used
        trace : Have tracing buffer info use kvzalloc instead of kzalloc
        tracing: Remove outdated comment in stack handling
        ftrace: Do not let direct or IPMODIFY ftrace_ops be added to module and set trampolines
        ftrace: Setup correct FTRACE_FL_REGS flags for module
        tracing/hwlat: Honor the tracing_cpumask
        tracing/hwlat: Drop the duplicate assignment in start_kthread()
        tracing: Save one trace_event->type by using __TRACE_LAST_TYPE
    • Michael Ellerman's avatar
      powerpc/ptrace: Fix build error in pkey_get() · 7b9de977
      Michael Ellerman authored
      The merge resolution in commit 25d8d4ee left ret no longer used,
      leading to:
        arch/powerpc/kernel/ptrace/ptrace-view.c: In function ‘pkey_get’:
        arch/powerpc/kernel/ptrace/ptrace-view.c:473:6: error: unused variable ‘ret’
          473 |  int ret;
      Fix it by removing ret.
      Fixes: 25d8d4ee ("Merge tag 'powerpc-5.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux"
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  7. 07 Aug, 2020 16 commits
    • Christoph Hellwig's avatar
      fs: fix a struct path leak in path_umount · 25ccd24f
      Christoph Hellwig authored
      Make sure we also put the dentry and vfsmnt in the illegal flags
      and !may_umount cases.
      Fixes: 41525f56
       ("fs: refactor ksys_umount")
      Reported-by: default avatarVikas Kumar <vikas.kumar2@arm.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    • Steven Rostedt (VMware)'s avatar
      tracing: Add trace_array_init_printk() to initialize instance trace_printk() buffers · 38ce2a9e
      Steven Rostedt (VMware) authored
      As trace_array_printk() used with not global instances will not add noise to
      the main buffer, they are OK to have in the kernel (unlike trace_printk()).
      This require the subsystem to create their own tracing instance, and the
      trace_array_printk() only writes into those instances.
      Add trace_array_init_printk() to initialize the trace_printk() buffers
      without printing out the WARNING message.
      Reported-by: default avatarSean Paul <sean@poorly.run>
      Reviewed-by: default avatarSean Paul <sean@poorly.run>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
    • Linus Torvalds's avatar
      Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · 30185b69
      Linus Torvalds authored
      Pull clk updates from Stephen Boyd:
       "It looks like a smaller batch of clk updates this time around.
        In the core framework we just have some minor tweaks and a debugfs
        feature, so not much to see there. The driver updates are fairly well
        split between AT91 and Qualcomm clk support. Adding those two drivers
        together equals about 50% of the diffstat.
        Otherwise, the big amount of work this time was on supporting
        Broadcom's Raspberry Pi firmware clks.
         - Document clk_hw_round_rate() so it gets some more use
         - Remove unused __clk_get_flags()
         - Add a prepare/enable debugfs feature similar to rate setting
        New Drivers:
         - Add support for SAMA7G5 SoC clks
         - Enable CPU clks on Qualcomm IPQ6018 SoCs
         - Enable CPU clks on Qualcomm MSM8996 SoCs
         - GPU clk support for Qualcomm SM8150 and SM8250 SoCs
         - Audio clks on Qualcomm SC7180 SoCs
         - Microchip Sparx5 DPLL clk
         - Add support for the new Renesas RZ/G2H (R8A774E1) SoC
         - Make defines for bcm63xx-gate clks to use in DT
         - Support BCM2711 SoC firmware clks
         - Add HDMI clks for BCM2711 SoCs
         - Add RTC related clks on Ingenic SoCs
         - Support USB PHY clks on Ingenic SoCs
         - Support gate clks on BCM6318 SoCs
         - RMU and DMAC/GPIO clock support for Actions Semi S500 SoCs
         - Use poll_timeout functions in Rockchip clk driver
         - Support Rockchip rk3288w SoC variant
         - Mark mac_lbtest critical on Rockchip rk3188
         - Add CAAM clock support for i.MX vf610 driver
         - Add MU root clock support for i.MX imx8mp driver
         - Amlogic g12: add neural network accelerator clock sources
         - Amlogic meson8: remove critical flag for main PLL divider
         - Amlogic meson8: add video decoder clock gates
         - Convert one more Renesas DT binding to json-schema
         - Enhance critical clock handling on Renesas platforms to only
           consider clocks that were enabled at boot time"
      * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (79 commits)
        clk: qcom: gcc: Make disp gpll0 branch aon for sc7180/sdm845
        ipq806x: gcc: add support for child probe
        clk: qcom: msm8996: Make symbol 'cpu_msm8996_clks' static
        clk: qcom: ipq8074: Add correct index for PCIe clocks
        clk: <linux/clk-provider.h>: drop a duplicated word
        clk: renesas: cpg-mssr: Add r8a774e1 support
        dt-bindings: clock: renesas,cpg-mssr: Document r8a774e1
        clk: Drop duplicate selection in Kconfig
        clk: qcom: smd: Add support for MSM8992/4 rpm clocks
        clk: qcom: ipq8074: Add missing clocks for pcie
        dt-bindings: clock: qcom: ipq8074: Add missing bindings for PCIe
        Replace HTTP links with HTTPS ones: Common CLK framework
        clk: qcom: Add CPU clock driver for msm8996
        dt-bindings: clk: qcom: Add bindings for CPU clock for msm8996
        soc: qcom: Separate kryo l2 accessors from PMU driver
        clk: meson: meson8b: add the vclk2_en gate clock
        clk: meson: meson8b: add the vclk_en gate clock
        clk: qcom: Fix return value check in apss_ipq6018_probe()
        clk: bcm: dvp: Add missing module informations
        clk: meson: meson8b: Drop CLK_IS_CRITICAL from fclk_div2
    • Linus Torvalds's avatar
      Merge branch 'work.fdpic' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 0f43283b
      Linus Torvalds authored
      Pull fdpick coredump update from Al Viro:
       "Switches fdpic coredumps away from original aout dumping primitives to
        the same kind of regset use as regular elf coredumps do"
      * 'work.fdpic' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        [elf-fdpic] switch coredump to regsets
        [elf-fdpic] use elf_dump_thread_status() for the dumper thread as well
        [elf-fdpic] move allocation of elf_thread_status into elf_dump_thread_status()
        [elf-fdpic] coredump: don't bother with cyclic list for per-thread objects
        kill elf_fpxregs_t
        take fdpic-related parts of elf_prstatus out
        unexport linux/elfcore.h
    • Linus Torvalds's avatar
      Merge tag 'kallsyms_show_value-fix-v5.9-rc1' of... · 6ba0d2e4
      Linus Torvalds authored
      Merge tag 'kallsyms_show_value-fix-v5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
      Pull sysfs module section fix from Kees Cook:
       "Fix sysfs module section output overflow.
        About a month after my kallsyms_show_value() refactoring landed, 0day
        noticed that there was a path through the kernfs binattr read handlers
        that did not have PAGE_SIZEd buffers, and the module "sections" read
        handler made a bad assumption about this, resulting in it stomping on
        memory when reached through small-sized splice() calls.
        I've added a set of tests to find these kinds of regressions more
        quickly in the future as well"
      Sefltests-acked-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      * tag 'kallsyms_show_value-fix-v5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        selftests: splice: Check behavior of full and short splices
        module: Correctly truncate sysfs sections output
    • Linus Torvalds's avatar
      Merge tag 'seccomp-v5.9-rc1-fix1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · 1fa2c0a0
      Linus Torvalds authored
      Pull seccomp fix from Kees Cook:
       "This fixes my typo in the SCM_RIGHTS refactoring that broke compat
        Thanks to Thadeu Lima de Souza Cascardo for tracking it down, and to
        Christian Zigotzky and Alex Xu for their reports"
      * tag 'seccomp-v5.9-rc1-fix1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        net/scm: Fix typo in SCM_RIGHTS compat refactoring
    • Linus Torvalds's avatar
      Merge tag 'pm-5.9-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · f6235eb1
      Linus Torvalds authored
      Pull more power management updates from Rafael Wysocki:
       "These are mostly ARM cpufreq driver updates plus a cpufreq core
        cleanup, an ARM-wide change to make schedutil the default scaling
        governor, an intel_pstate driver fix and some runtime PM changes
        regarding kerneldoc comments.
         - Add adaptive voltage scaling (AVS) support to the brcmstb cpufreq
           driver and clean it up (Florian Fainelli, Markus Mayer).
         - Add a new Tegra cpufreq driver and clean up the existing one (Jon
           Hunter, Sumit Gupta).
         - Add bandwidth level support to the Qcom cpufreq driver along with
           OPP changes (Sibi Sankar).
         - Clean up the sti, cpufreq-dt, ap806, CPPC cpufreq drivers (Viresh
           Kumar, Lee Jones, Ivan Kokshaysky, Sven Auhagen, Xin Hao).
         - Make schedutil the default governor for ARM (Valentin Schneider).
         - Fix dependency issues for the imx cpufreq driver (Walter Lozano).
         - Clean up cached_resolved_idx handlihng in the cpufreq core (Viresh
         - Fix the intel_pstate driver to use the correct maximum frequency
           value when MSR_TURBO_RATIO_LIMIT is 0 (Srinivas Pandruvada).
         - Provide kenrneldoc comments for multiple runtime PM helpers and
           improve the pm_runtime_get_if_active() kerneldoc (Rafael Wysocki)"
      * tag 'pm-5.9-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (22 commits)
        cpufreq: intel_pstate: Fix cpuinfo_max_freq when MSR_TURBO_RATIO_LIMIT is 0
        PM: runtime: Improve kerneldoc of pm_runtime_get_if_active()
        PM: runtime: Add kerneldoc comments to multiple helpers
        cpufreq: make schedutil the default for arm and arm64
        cpufreq: cached_resolved_idx can not be negative
        cpufreq: Add Tegra194 cpufreq driver
        dt-bindings: arm: Add NVIDIA Tegra194 CPU Complex binding
        cpufreq: imx: Select NVMEM_IMX_OCOTP
        cpufreq: sti-cpufreq: Fix some formatting and misspelling issues
        cpufreq: tegra186: Simplify probe return path
        cpufreq: CPPC: Reuse caps variable in few routines
        cpufreq: ap806: fix cpufreq driver needs ap cpu clk
        cpufreq: cppc: Reorder code and remove apply_hisi_workaround variable
        cpufreq: dt: fix oops on armada37xx
        cpufreq: brcmstb-avs-cpufreq: send S2_ENTER / S2_EXIT commands to AVS
        cpufreq: brcmstb-avs-cpufreq: Support polling AVS firmware
        cpufreq: brcmstb-avs-cpufreq: more flexible interface for __issue_avs_command()
        cpufreq: qcom: Disable fast switch when scaling DDR/L3
        cpufreq: qcom: Update the bandwidth levels on frequency change
        OPP: Add and export helper to set bandwidth
    • Linus Torvalds's avatar
      Merge tag 'for-5.9/dm-changes' of... · 2f12d440
      Linus Torvalds authored
      Merge tag 'for-5.9/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
      Pull device mapper updates from Mike Snitzer:
       - DM multipath locking fixes around m->flags tests and improvements to
         bio-based code so that it follows patterns established by
         request-based code.
       - Request-based DM core improvement to eliminate unnecessary call to
       - Add "panic_on_corruption" error handling mode to DM verity target.
       - DM bufio fix to to perform buffer cleanup from a workqueue rather
         than wait for IO in reclaim context from shrinker.
       - DM crypt improvement to optionally avoid async processing via
         workqueues for reads and/or writes -- via "no_read_workqueue" and
         "no_write_workqueue" features. This more direct IO processing
         improves latency and throughput with faster storage. Avoiding
         workqueue IO submission for writes (DM_CRYPT_NO_WRITE_WORKQUEUE) is a
         requirement for adding zoned block device support to DM crypt.
       - Add zoned block device support to DM crypt. Makes use of
         DM_CRYPT_NO_WRITE_WORKQUEUE and a new optional feature
         (DM_CRYPT_WRITE_INLINE) that allows write completion to wait for
         encryption to complete. This allows write ordering to be preserved,
         which is needed for zoned block devices.
       - Fix DM ebs target's check for REQ_OP_FLUSH.
       - Fix DM core's report zones support to not report more zones than were
       - A few small compiler warning fixes.
       - DM dust improvements to return output directly to the user rather
         than require they scrape the system log for output.
      * tag 'for-5.9/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
        dm: don't call report zones for more than the user requested
        dm ebs: Fix incorrect checking for REQ_OP_FLUSH
        dm init: Set file local variable static
        dm ioctl: Fix compilation warning
        dm raid: Remove empty if statement
        dm verity: Fix compilation warning
        dm crypt: Enable zoned block device support
        dm crypt: add flags to optionally bypass kcryptd workqueues
        dm bufio: do buffer cleanup from a workqueue
        dm rq: don't call blk_mq_queue_stopped() in dm_stop_queue()
        dm dust: add interface to list all badblocks
        dm dust: report some message results directly back to user
        dm verity: add "panic_on_corruption" error handling mode
        dm mpath: use double checked locking in fast path
        dm mpath: rename current_pgpath to pgpath in multipath_prepare_ioctl
        dm mpath: rework __map_bio()
        dm mpath: factor out multipath_queue_bio
        dm mpath: push locking down to must_push_back_rq()
        dm mpath: take m->lock spinlock when testing QUEUE_IF_NO_PATH
        dm mpath: changes from initial m->flags locking audit
    • Linus Torvalds's avatar
      Merge tag 'media/v5.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media · fa73e212
      Linus Torvalds authored
      Pull media updates from Mauro Carvalho Chehab:
       - Legacy soc_camera driver was removed from staging
       - New I2C sensor related drivers: dw9768, ch7322, max9271, rdacm20
       - TI vpe driver code was re-organized and had new features added
       - Added Xilinx MIPI CSI-2 Rx Subsystem driver
       - Added support for Infrared Toy and IR Droid devices
       - Lots of random driver fixes, new features and cleanups
      * tag 'media/v5.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (318 commits)
        media: camss: fix memory leaks on error handling paths in probe
        media: davinci: vpif_capture: fix potential double free
        media: radio: remove redundant assignment to variable retval
        media: allegro: fix potential null dereference on header
        media: mtk-mdp: Fix a refcounting bug on error in init
        media: allegro: fix an error pointer vs NULL check
        media: meye: fix missing pm_mchip_mode field
        media: cafe-driver: use generic power management
        media: saa7164: use generic power management
        media: v4l2-dev/ioctl: Fix document for VIDIOC_QUERYCAP
        media: v4l2: Correct kernel-doc inconsistency
        media: v4l2: Correct kernel-doc inconsistency
        media: dvbdev.h: keep * together with the type
        media: v4l2-subdev.h: keep * together with the type
        media: videobuf2: Print videobuf2 buffer state by name
        media: colorspaces-details.rst: fix V4L2_COLORSPACE_JPEG description
        media: tw68: use generic power management
        media: meye: use generic power management
        media: cx88: use generic power management
        media: cx25821: use generic power management
    • Linus Torvalds's avatar
      Merge tag 'mailbox-v5.9' of git://git.linaro.org/landing-teams/working/fujitsu/integration · 75dee3b6
      Linus Torvalds authored
      Pull mailbox updates from Jassi Brar:
         - add support for mt6779 gce
         - shutdown cleanup and address shift support
         - add msm8994 apcs and sdm660 hmss compatibility
         - mark PM funcs __maybe
         - put acpi table before bailout
         - replace http with https links"
      * tag 'mailbox-v5.9' of git://git.linaro.org/landing-teams/working/fujitsu/integration:
        mailbox: mediatek: cmdq: clear task in channel before shutdown
        mailbox: cmdq: support mt6779 gce platform definition
        mailbox: cmdq: variablize address shift in platform
        dt-binding: gce: add gce header file for mt6779
        mailbox: qcom: Add msm8994 apcs compatible
        mailbox: qcom: Add sdm660 hmss compatible
        mailbox: imx: Mark PM functions as __maybe_unused
        mailbox: pcc: Put the PCCT table for error path
        mailbox: Replace HTTP links with HTTPS ones
    • Kees Cook's avatar
      net/scm: Fix typo in SCM_RIGHTS compat refactoring · 16b89f69
      Kees Cook authored
      When refactoring the SCM_RIGHTS code, I accidentally mis-merged my
      native/compat diffs, which entirely broke using SCM_RIGHTS in compat
      mode. Use the correct helper.
      Reported-by: default avatarChristian Zigotzky <chzigotzky@xenosoft.de>
      Link: https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-August/216156.html
      Reported-by: default avatar"Alex Xu (Hello71)" <alex_y_xu@yahoo.ca>
      Link: https://lore.kernel.org/lkml/1596812929.lz7fuo8r2w.none@localhost/
      Suggested-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
      Fixes: c0029de5
       ("net/scm: Regularize compat handling of scm_detach_fds()")
      Tested-by: default avatarAlex Xu (Hello71) <alex_y_xu@yahoo.ca>
      Acked-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
    • Linus Torvalds's avatar
      Merge tag 'dmaengine-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine · ce615f5c
      Linus Torvalds authored
      Pull dmaengine updates from Vinod Koul:
         - Support out of order dma completion
         - Support for repeating transaction
        New controllers:
         - Support for Actions S700 DMA engine
         - Renesas R8A774E1, r8a7742 controller binding
         - New driver for Xilinx DPDMA controller
         - Support of out of order dma completion in idxd driver
         - W=1 warning cleanup of subsystem
         - Updates to ti-k3-dma, dw, idxd drivers"
      * tag 'dmaengine-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: (68 commits)
        dmaengine: dw: Don't include unneeded header to platform data header
        dmaengine: Actions: Add support for S700 DMA engine
        dmaengine: Actions: get rid of bit fields from dma descriptor
        dt-bindings: dmaengine: convert Actions Semi Owl SoCs bindings to yaml
        dmaengine: idxd: add missing invalid flags field to completion
        dmaengine: dw: Initialize max_sg_burst capability
        dmaengine: dw: Introduce max burst length hw config
        dmaengine: dw: Initialize min and max burst DMA device capability
        dmaengine: dw: Set DMA device max segment size parameter
        dmaengine: dw: Take HC_LLP flag into account for noLLP auto-config
        dmaengine: Introduce DMA-device device_caps callback
        dmaengine: Introduce max SG burst capability
        dmaengine: Introduce min burst length capability
        dt-bindings: dma: dw: Add max burst transaction length property
        dt-bindings: dma: dw: Convert DW DMAC to DT binding
        dmaengine: ti: k3-udma: Query throughput level information from hardware
        dmaengine: ti: k3-udma: Use defines for capabilities register parsing
        dmaengine: xilinx: dpdma: Fix kerneldoc warning
        dmaengine: xilinx: dpdma: add missing kernel doc
        dmaengine: xilinx: dpdma: remove comparison of unsigned expression
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 81e11336
      Linus Torvalds authored
      Merge misc updates from Andrew Morton:
       - a few MM hotfixes
       - kthread, tools, scripts, ntfs and ocfs2
       - some of MM
      Subsystems affected by this patch series: kthread, tools, scripts, ntfs,
      ocfs2 and mm (hofixes, pagealloc, slab-generic, slab, slub, kcsan,
      debug, pagecache, gup, swap, shmem, memcg, pagemap, mremap, mincore,
      sparsemem, vmalloc, kasan, pagealloc, hugetlb and vmscan).
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (162 commits)
        mm: vmscan: consistent update to pgrefill
        mm/vmscan.c: fix typo
        khugepaged: khugepaged_test_exit() check mmget_still_valid()
        khugepaged: retract_page_tables() remember to test exit
        khugepaged: collapse_pte_mapped_thp() protect the pmd lock
        khugepaged: collapse_pte_mapped_thp() flush the right range
        mm/hugetlb: fix calculation of adjust_range_if_pmd_sharing_possible
        mm: thp: replace HTTP links with HTTPS ones
        mm/page_alloc: fix memalloc_nocma_{save/restore} APIs
        mm/page_alloc.c: skip setting nodemask when we are in interrupt
        mm/page_alloc: fallbacks at most has 3 elements
        mm/page_alloc: silence a KASAN false positive
        mm/page_alloc.c: remove unnecessary end_bitidx for [set|get]_pfnblock_flags_mask()
        mm/page_alloc.c: simplify pageblock bitmap access
        mm/page_alloc.c: extract the common part in pfn_to_bitidx()
        mm/page_alloc.c: replace the definition of NR_MIGRATETYPE_BITS with PB_migratetype_bits
        mm/shuffle: remove dynamic reconfiguration
        mm/memory_hotplug: document why shuffle_zone() is relevant
        mm/page_alloc: remove nr_free_pagecache_pages()
        mm: remove vm_total_pages
    • Shakeel Butt's avatar
      mm: vmscan: consistent update to pgrefill · 912c0572
      Shakeel Butt authored
      The vmstat pgrefill is useful together with pgscan and pgsteal stats to
      measure the reclaim efficiency.  However vmstat's pgrefill is not updated
      consistently at system level.  It gets updated for both global and memcg
      reclaim however pgscan and pgsteal are updated for only global reclaim.
      So, update pgrefill only for global reclaim.  If someone is interested in
      the stats representing both system level as well as memcg level reclaim,
      then consult the root memcg's memory.stat instead of /proc/vmstat.
      Signed-off-by: default avatarShakeel Butt <shakeelb@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarYafang Shao <laoar.shao@gmail.com>
      Acked-by: default avatarRoman Gushchin <guro@fb.com>
      Acked-by: default avatarChris Down <chris@chrisdown.name>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Michal Hocko <mhocko@kernel.org>
      Link: http://lkml.kernel.org/r/20200711011459.1159929-1-shakeelb@google.com
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    • dylan-meiners's avatar
    • Hugh Dickins's avatar
      khugepaged: khugepaged_test_exit() check mmget_still_valid() · bbe98f9c
      Hugh Dickins authored
      Move collapse_huge_page()'s mmget_still_valid() check into
      khugepaged_test_exit() itself.  collapse_huge_page() is used for anon THP
      only, and earned its mmget_still_valid() check because it inserts a huge
      pmd entry in place of the page table's pmd entry; whereas
      collapse_file()'s retract_page_tables() or collapse_pte_mapped_thp()
      merely clears the page table's pmd entry.  But core dumping without mmap
      lock must have been as open to mistaking a racily cleared pmd entry for a
      page table at physical page 0, as exit_mmap() was.  And we certainly have
      no interest in mapping as a THP once dumping core.
      Fixes: 59ea6d06
       ("coredump: fix race condition between collapse_huge_page() and core dumping")
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Mike Kravetz <mike.kravetz@oracle.com>
      Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: <stable@vger.kernel.org>	[4.8+]
      Link: http://lkml.kernel.org/r/alpine.LSU.2.11.2008021217020.27773@eggly.anvils
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>