1. 06 Dec, 2019 2 commits
    • Vincenzo Frascino's avatar
      ARM: 8947/1: Fix __arch_get_hw_counter() access to CNTVCT · 04bb9642
      Vincenzo Frascino authored
      __arch_get_hw_counter() should check clock_mode to see if it can access
      CNTVCT. With the conversion to unified vDSO this check has been left out.
      
      This causes on imx v6 and v7 (imx_v6_v7_defconfig) and other platforms to
      hang at boot during the execution of the init process as per below:
      
      [   19.976852] Run /sbin/init as init process
      [   20.044931] Kernel panic - not syncing: Attempted to kill init!
      exitcode=0x00000004
      
      Fix the problem verifying that clock_mode is set coherently before
      accessing CNTVCT.
      Investigated-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      04bb9642
    • Dietmar Eggemann's avatar
      ARM: 8943/1: Fix topology setup in case of CPU hotplug for CONFIG_SCHED_MC · ff98a5f6
      Dietmar Eggemann authored
      Commit ca74b316 ("arm: Use common cpu_topology structure and
      functions.") changed cpu_coregroup_mask() from the ARM32 specific
      implementation in arch/arm/include/asm/topology.h to the one shared
      with ARM64 and RISCV in drivers/base/arch_topology.c.
      
      Currently on ARM32 (TC2 w/ CONFIG_SCHED_MC) the task scheduler setup
      code (w/ CONFIG_SCHED_DEBUG) shows this during CPU hotplug:
      
        ERROR: groups don't span domain->span
      
      It happens to CPUs of the cluster of the CPU which gets hot-plugged
      out on scheduler domain MC.
      
      Turns out that the shared cpu_coregroup_mask() requires that the
      hot-plugged CPU is removed from the core_sibling mask via
      remove_cpu_topology(). Otherwise the 'is core_sibling subset of
      cpumask_of_node()' doesn't work. In this case the task scheduler has to
      deal with cpumask_of_node instead of core_sibling which is wrong on
      scheduler domain MC.
      
      e.g. CPU3 hot-plugged out on TC2 [cluster0: 0,3-4 cluster1: 1-2]:
      
        cpu_coregroup_mask(): CPU3 cpumask_of_node=0-2,4 core_sibling=0,3-4
                                                                        ^
      should be:
      
        cpu_coregroup_mask(): CPU3 cpumask_of_node=0-2,4 core_sibling=0,4
      
      Add remove_cpu_topology() to __cpu_disable() to remove the CPU from the
      topology masks in case of a CPU hotplug out operation.
      
      At the same time tweak store_cpu_topology() slightly so it will call
      update_siblings_masks() in case of CPU hotplug in operation via
      secondary_start_kernel()->smp_store_cpu_info().
      
      This aligns the ARM32 implementation with the ARM64 one.
      
      Guarding remove_cpu_topology() with CONFIG_GENERIC_ARCH_TOPOLOGY is
      necessary since some Arm32 defconfigs (aspeed_g5_defconfig,
      milbeaut_m10v_defconfig, spear13xx_defconfig) specify an explicit
      
       # CONFIG_ARM_CPU_TOPOLOGY is not set
      
      w/ ./arch/arm/Kconfig: select GENERIC_ARCH_TOPOLOGY if ARM_CPU_TOPOLOGY
      
      Fixes: ca74b316 ("arm: Use common cpu_topology structure and functions")
      Reviewed-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      Reviewed-by: default avatarLukasz Luba <lukasz.luba@arm.com>
      Tested-by: default avatarLukasz Luba <lukasz.luba@arm.com>
      Tested-by: default avatarOndrej Jirman <megous@megous.com>
      Signed-off-by: default avatarDietmar Eggemann <dietmar.eggemann@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      ff98a5f6
  2. 22 Nov, 2019 2 commits
  3. 16 Nov, 2019 2 commits
    • Benjamin Gaignard's avatar
      ARM: 8938/1: kernel: initialize broadcast hrtimer based clock event device · 022eb8ae
      Benjamin Gaignard authored
      On platforms implementing CPU power management, the CPUidle subsystem
      can allow CPUs to enter idle states where local timers logic is lost on power
      down. To keep the software timers functional the kernel relies on an
      always-on broadcast timer to be present in the platform to relay the
      interrupt signalling the timer expiries.
      
      For platforms implementing CPU core gating that do not implement an always-on
      HW timer or implement it in a broken way, this patch adds code to initialize
      the kernel hrtimer based clock event device upon boot (which can be chosen as
      tick broadcast device by the kernel).
      It relies on a dynamically chosen CPU to be always powered-up. This CPU then
      relays the timer interrupt to CPUs in deep-idle states through its HW local
      timer device.
      
      Having a CPU always-on has implications on power management platform
      capabilities and makes CPUidle suboptimal, since at least a CPU is kept
      always in a shallow idle state by the kernel to relay timer interrupts,
      but at least leaves the kernel with a functional system with some working
      power management capabilities.
      
      The hrtimer based clock event device is unconditionally registered, but
      has the lowest possible rating such that any broadcast-capable HW clock
      event device present will be chosen in preference as the tick broadcast
      device.
      Signed-off-by: default avatarBenjamin Gaignard <benjamin.gaignard@st.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      022eb8ae
    • Doug Berger's avatar
      ARM: 8937/1: spectre-v2: remove Brahma-B53 from hardening · 4ae5061a
      Doug Berger authored
      When the default processor handling was added to the function
      cpu_v7_spectre_init() it only excluded other ARM implemented processor
      cores. The Broadcom Brahma B53 core is not implemented by ARM so it
      ended up falling through into the set of processors that attempt to use
      the ARM_SMCCC_ARCH_WORKAROUND_1 service to harden the branch predictor.
      
      Since this workaround is not necessary for the Brahma-B53 this commit
      explicitly checks for it and prevents it from applying a branch
      predictor hardening workaround.
      
      Fixes: 10115105 ("ARM: spectre-v2: add firmware based hardening")
      Signed-off-by: default avatarDoug Berger <opendmb@gmail.com>
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      4ae5061a
  4. 15 Nov, 2019 7 commits
  5. 31 Oct, 2019 7 commits
  6. 27 Oct, 2019 15 commits
    • Ben Dooks (Codethink)'s avatar
      ARM: 8917/1: mm: include <asm/set_memory.h> · 9110f3e7
      Ben Dooks (Codethink) authored
      The definitions of set_kernel_text_rw() and
      set_kernel_text_ro() are in <asm/set_memory.h>
      but this is not included in init.c which defines
      these. Silence the following warnings by including
      the <asm/set_memory.h> header.
      
      arch/arm/mm/init.c:669:6: warning: symbol 'set_kernel_text_rw' was not declared. Should it be static?
      arch/arm/mm/init.c:678:6: warning: symbol 'set_kernel_text_ro' was not declared. Should it be static?
      Signed-off-by: default avatarBen Dooks <ben.dooks@codethink.co.uk>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      9110f3e7
    • Ben Dooks (Codethink)'s avatar
      ARM: 8916/1: mm: make set_section_perms() static · ea5379be
      Ben Dooks (Codethink) authored
      The set_section_perms() is not defined outside of the
      init.c file, so make it static to avoid the following
      warning:
      
      arch/arm/mm/init.c:596:6: warning: symbol 'set_section_perms' was not declared. Should it be static?
      Signed-off-by: default avatarBen Dooks <ben.dooks@codethink.co.uk>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      ea5379be
    • Ben Dooks (Codethink)'s avatar
      ARM: 8915/1: zImage: atags_to_fdt: fix __be32 and __be64 types · 43fa593e
      Ben Dooks (Codethink) authored
      There are some sparse warnings about type conversion in
      the atags_to_fdt.c code, due to __be32 and __be64, so
      fix the following:
      
      - Change _be32 and __be64 where appropriate
      - Change setprop() to take a 'void *'
      - Change incorrect fdt32_to_cpu() on FDT_MAGIC
      
      Fixes the following sparse warnings:
      
      arch/arm/boot/compressed/atags_to_fdt.c:66:29: warning: cast to restricted __be32
      arch/arm/boot/compressed/atags_to_fdt.c:66:29: warning: cast to restricted __be32
      arch/arm/boot/compressed/atags_to_fdt.c:66:29: warning: cast to restricted __be32
      arch/arm/boot/compressed/atags_to_fdt.c:66:29: warning: cast to restricted __be32
      arch/arm/boot/compressed/atags_to_fdt.c:66:29: warning: cast to restricted __be32
      arch/arm/boot/compressed/atags_to_fdt.c:66:29: warning: cast to restricted __be32
      arch/arm/boot/compressed/atags_to_fdt.c:141:34: warning: cast to restricted __be32
      arch/arm/boot/compressed/atags_to_fdt.c:141:34: warning: cast to restricted __be32
      arch/arm/boot/compressed/atags_to_fdt.c:141:34: warning: cast to restricted __be32
      arch/arm/boot/compressed/atags_to_fdt.c:141:34: warning: cast to restricted __be32
      arch/arm/boot/compressed/atags_to_fdt.c:141:34: warning: cast to restricted __be32
      arch/arm/boot/compressed/atags_to_fdt.c:141:34: warning: cast to restricted __be32
      arch/arm/boot/compressed/atags_to_fdt.c:182:60: warning: incorrect type in assignment (different base types)
      arch/arm/boot/compressed/atags_to_fdt.c:182:60:    expected unsigned long long [usertype]
      arch/arm/boot/compressed/atags_to_fdt.c:182:60:    got restricted __be64 [usertype]
      arch/arm/boot/compressed/atags_to_fdt.c:184:60: warning: incorrect type in assignment (different base types)
      arch/arm/boot/compressed/atags_to_fdt.c:184:60:    expected unsigned long long [usertype]
      arch/arm/boot/compressed/atags_to_fdt.c:184:60:    got restricted __be64 [usertype]
      arch/arm/boot/compressed/atags_to_fdt.c:187:62: warning: incorrect type in assignment (different base types)
      arch/arm/boot/compressed/atags_to_fdt.c:187:62:    expected unsigned int
      arch/arm/boot/compressed/atags_to_fdt.c:187:62:    got restricted __be32 [usertype]
      arch/arm/boot/compressed/atags_to_fdt.c:189:62: warning: incorrect type in assignment (different base types)
      arch/arm/boot/compressed/atags_to_fdt.c:189:62:    expected unsigned int
      arch/arm/boot/compressed/atags_to_fdt.c:189:62:    got restricted __be32 [usertype]
      Signed-off-by: default avatarBen Dooks <ben.dooks@codethink.co.uk>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      43fa593e
    • Ben Dooks's avatar
      ARM: 8913/1: arch_timer: include <asm/arch_timer.h> · 05b1fd8b
      Ben Dooks authored
      The arch_timer_arch_init is defined in <asm/arch_timer.h> so include
      that to fix the following sparse error:
      
      arch/arm/kernel/arch_timer.c:31:12: warning: symbol 'arch_timer_arch_init' was not declared. Should it be static?
      Signed-off-by: default avatarBen Dooks <ben.dooks@codethink.co.uk>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      05b1fd8b
    • Ben Dooks's avatar
      ARM: 8911/1: move pcibios_report_status to <asm/pci.h> · e3c5b361
      Ben Dooks authored
      Move the pcibios_report_status to <asm/pci.h> include to remove the
      following sparse warning and to remove the extra definition in the
      footbrdige dc21285.c driver:
      
      arch/arm/kernel/bios32.c:59:6: warning: symbol 'pcibios_report_status' was not declared. Should it be static?
      Signed-off-by: default avatarBen Dooks <ben.dooks@codethink.co.uk>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      e3c5b361
    • Ben Dooks's avatar
      ARM: 8910/1: fix missing declartion of module_frob_arch_sections · a959f887
      Ben Dooks authored
      The module_frob_arch_sections function is missing the header declaration
      which is in <linux/moduleloader.h> so include that to fix the following
      sparse warning:
      
      arch/arm/kernel/module-plts.c:188:5: warning: symbol 'module_frob_arch_sections' was not declared. Should it be static?
      Signed-off-by: default avatarBen Dooks <ben.dooks@codethink.co.uk>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      a959f887
    • Ben Dooks's avatar
      ARM: 8909/1: make unexported items static · 17fe8684
      Ben Dooks authored
      Fixup the following sparse warnings by making the functions and structures
      static.
      
      arch/arm/mm/dma-mapping.c:1562:6: warning: symbol '__arm_iommu_free_attrs' was not declared. Should it be static?
      arch/arm/mm/dma-mapping.c:1586:6: warning: symbol 'arm_iommu_free_attrs' was not declared. Should it be static?
      arch/arm/mm/dma-mapping.c:1592:6: warning: symbol 'arm_coherent_iommu_free_attrs' was not declared. Should it be static?
      arch/arm/mm/dma-mapping.c:1716:5: warning: symbol 'arm_coherent_iommu_map_sg' was not declared. Should it be static?
      arch/arm/mm/dma-mapping.c:1734:5: warning: symbol 'arm_iommu_map_sg' was not declared. Should it be static?
      arch/arm/mm/dma-mapping.c:1767:6: warning: symbol 'arm_coherent_iommu_unmap_sg' was not declared. Should it be static?
      arch/arm/mm/dma-mapping.c:1784:6: warning: symbol 'arm_iommu_unmap_sg' was not declared. Should it be static?
      arch/arm/mm/dma-mapping.c:1798:6: warning: symbol 'arm_iommu_sync_sg_for_cpu' was not declared. Should it be static?
      arch/arm/mm/dma-mapping.c:1816:6: warning: symbol 'arm_iommu_sync_sg_for_device' was not declared. Should it be static?
      arch/arm/mm/dma-mapping.c:2018:26: warning: symbol 'iommu_ops' was not declared. Should it be static?
      arch/arm/mm/dma-mapping.c:2040:26: warning: symbol 'iommu_coherent_ops' was not declared. Should it be static?
      Signed-off-by: default avatarBen Dooks <ben.dooks@codethink.co.uk>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      17fe8684
    • Clemens Gruber's avatar
      ARM: 8907/1: arch: reuse addr variable in pfn_valid · 032be728
      Clemens Gruber authored
      Avoid calling __pfn_to_phys twice.
      Signed-off-by: default avatarClemens Gruber <clemens.gruber@pqgruber.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      032be728
    • Linus Torvalds's avatar
      Linux 5.4-rc5 · d6d5df1d
      Linus Torvalds authored
      d6d5df1d
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 153a971f
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "Two fixes for the VMWare guest support:
      
         - Unbreak VMWare platform detection which got wreckaged by converting
           an integer constant to a string constant.
      
         - Fix the clang build of the VMWAre hypercall by explicitely
           specifying the ouput register for INL instead of using the short
           form"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/cpu/vmware: Fix platform detection VMWARE_PORT macro
        x86/cpu/vmware: Use the full form of INL in VMWARE_HYPERCALL, for clang/llvm
      153a971f
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 2b776b54
      Linus Torvalds authored
      Pull timer fixes from Thomas Gleixner:
       "A small set of fixes for time(keeping):
      
         - Add a missing include to prevent compiler warnings.
      
         - Make the VDSO implementation of clock_getres() POSIX compliant
           again. A recent change dropped the NULL pointer guard which is
           required as NULL is a valid pointer value for this function.
      
         - Fix two function documentation typos"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        posix-cpu-timers: Fix two trivial comments
        timers/sched_clock: Include local timekeeping.h for missing declarations
        lib/vdso: Make clock_getres() POSIX compliant again
      2b776b54
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · a8a31fdc
      Linus Torvalds authored
      Pull perf fixes from Thomas Gleixner:
       "A set of perf fixes:
      
        kernel:
      
         - Unbreak the tracking of auxiliary buffer allocations which got
           imbalanced causing recource limit failures.
      
         - Fix the fallout of splitting of ToPA entries which missed to shift
           the base entry PA correctly.
      
         - Use the correct context to lookup the AUX event when unmapping the
           associated AUX buffer so the event can be stopped and the buffer
           reference dropped.
      
        tools:
      
         - Fix buildiid-cache mode setting in copyfile_mode_ns() when copying
           /proc/kcore
      
         - Fix freeing id arrays in the event list so the correct event is
           closed.
      
         - Sync sched.h anc kvm.h headers with the kernel sources.
      
         - Link jvmti against tools/lib/ctype.o to have weak strlcpy().
      
         - Fix multiple memory and file descriptor leaks, found by coverity in
           perf annotate.
      
         - Fix leaks in error handling paths in 'perf c2c', 'perf kmem', found
           by a static analysis tool"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/aux: Fix AUX output stopping
        perf/aux: Fix tracking of auxiliary trace buffer allocation
        perf/x86/intel/pt: Fix base for single entry topa
        perf kmem: Fix memory leak in compact_gfp_flags()
        tools headers UAPI: Sync sched.h with the kernel
        tools headers kvm: Sync kvm.h headers with the kernel sources
        tools headers kvm: Sync kvm headers with the kernel sources
        tools headers kvm: Sync kvm headers with the kernel sources
        perf c2c: Fix memory leak in build_cl_output()
        perf tools: Fix mode setting in copyfile_mode_ns()
        perf annotate: Fix multiple memory and file descriptor leaks
        perf tools: Fix resource leak of closedir() on the error paths
        perf evlist: Fix fix for freed id arrays
        perf jvmti: Link against tools/lib/ctype.h to have weak strlcpy()
      a8a31fdc
    • Linus Torvalds's avatar
      Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 1e1ac1cb
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
       "Two fixes for interrupt controller drivers:
      
         - Skip IRQ_M_EXT entries in the device tree when initializing the
           RISCV PLIC controller to avoid a double init attempt.
      
         - Use the correct ITS list when issuing the VMOVP synchronization
           command so the operation works only on the ITS instances which are
           associated to a VM"
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip/sifive-plic: Skip contexts except supervisor in plic_init()
        irqchip/gic-v3-its: Use the exact ITSList for VMOVP
      1e1ac1cb
    • Linus Torvalds's avatar
      Merge tag '5.4-rc5-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 · c9a2e4a8
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "Seven cifs/smb3 fixes, including three for stable"
      
      * tag '5.4-rc5-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: Fix cifsInodeInfo lock_sem deadlock when reconnect occurs
        CIFS: Fix use after free of file info structures
        CIFS: Fix retry mid list corruption on reconnects
        cifs: Fix missed free operations
        CIFS: avoid using MID 0xFFFF
        cifs: clarify comment about timestamp granularity for old servers
        cifs: Handle -EINPROGRESS only when noblockcnt is set
      c9a2e4a8
    • Linus Torvalds's avatar
      Merge tag 'riscv/for-v5.4-rc5-b' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · 6995a6a5
      Linus Torvalds authored
      Pull RISC-V fixes from Paul Walmsley:
       "Several minor fixes and cleanups for v5.4-rc5:
      
         - Three build fixes for various SPARSEMEM-related kernel
           configurations
      
         - Two cleanup patches for the kernel bug and breakpoint trap handler
           code"
      
      * tag 'riscv/for-v5.4-rc5-b' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        riscv: cleanup do_trap_break
        riscv: cleanup <asm/bug.h>
        riscv: Fix undefined reference to vmemmap_populate_basepages
        riscv: Fix implicit declaration of 'page_to_section'
        riscv: fix fs/proc/kcore.c compilation with sparsemem enabled
      6995a6a5
  7. 26 Oct, 2019 5 commits