1. 06 May, 2021 1 commit
  2. 05 May, 2021 2 commits
    • Catalin Marinas's avatar
      arm64: Fix the documented event stream frequency · 5d8505fd
      Catalin Marinas authored
      It should be 10KHz, matching the ARCH_TIMER_EVT_STREAM_PERIOD_US of
      100us.
      
      Note that this is only a documentation bug.
      
      Fixes: 611a7bc7 ("arm64: docs: describe ELF hwcaps")
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
      Link: https://lore.kernel.org/r/20210505132845.23698-1-catalin.marinas@arm.comSigned-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      5d8505fd
    • Mark Rutland's avatar
      arm64: entry: always set GIC_PRIO_PSR_I_SET during entry · 4d6a38da
      Mark Rutland authored
      Zenghui reports that booting a kernel with "irqchip.gicv3_pseudo_nmi=1"
      on the command line hits a warning during kernel entry, due to the way
      we manipulate the PMR.
      
      Early in the entry sequence, we call lockdep_hardirqs_off() to inform
      lockdep that interrupts have been masked (as the HW sets DAIF wqhen
      entering an exception). Architecturally PMR_EL1 is not affected by
      exception entry, and we don't set GIC_PRIO_PSR_I_SET in the PMR early in
      the exception entry sequence, so early in exception entry the PMR can
      indicate that interrupts are unmasked even though they are masked by
      DAIF.
      
      If DEBUG_LOCKDEP is selected, lockdep_hardirqs_off() will check that
      interrupts are masked, before we set GIC_PRIO_PSR_I_SET in any of the
      exception entry paths, and hence lockdep_hardirqs_off() will WARN() that
      something is amiss.
      
      We can avoid this by consistently setting GIC_PRIO_PSR_I_SET during
      exception entry so that kernel code sees a consistent environment. We
      must also update local_daif_inherit() to undo this, as currently only
      touches DAIF. For other paths, local_daif_restore() will update both
      DAIF and the PMR. With this done, we can remove the existing special
      cases which set this later in the entry code.
      
      We always use (GIC_PRIO_IRQON | GIC_PRIO_PSR_I_SET) for consistency with
      local_daif_save(), as this will warn if it ever encounters
      (GIC_PRIO_IRQOFF | GIC_PRIO_PSR_I_SET), and never sets this itself. This
      matches the gic_prio_kentry_setup that we have to retain for
      ret_to_user.
      
      The original splat from Zenghui's report was:
      
      | DEBUG_LOCKS_WARN_ON(!irqs_disabled())
      | WARNING: CPU: 3 PID: 125 at kernel/locking/lockdep.c:4258 lockdep_hardirqs_off+0xd4/0xe8
      | Modules linked in:
      | CPU: 3 PID: 125 Comm: modprobe Tainted: G        W         5.12.0-rc8+ #463
      | Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015
      | pstate: 604003c5 (nZCv DAIF +PAN -UAO -TCO BTYPE=--)
      | pc : lockdep_hardirqs_off+0xd4/0xe8
      | lr : lockdep_hardirqs_off+0xd4/0xe8
      | sp : ffff80002a39bad0
      | pmr_save: 000000e0
      | x29: ffff80002a39bad0 x28: ffff0000de214bc0
      | x27: ffff0000de1c0400 x26: 000000000049b328
      | x25: 0000000000406f30 x24: ffff0000de1c00a0
      | x23: 0000000020400005 x22: ffff8000105f747c
      | x21: 0000000096000044 x20: 0000000000498ef9
      | x19: ffff80002a39bc88 x18: ffffffffffffffff
      | x17: 0000000000000000 x16: ffff800011c61eb0
      | x15: ffff800011700a88 x14: 0720072007200720
      | x13: 0720072007200720 x12: 0720072007200720
      | x11: 0720072007200720 x10: 0720072007200720
      | x9 : ffff80002a39bad0 x8 : ffff80002a39bad0
      | x7 : ffff8000119f0800 x6 : c0000000ffff7fff
      | x5 : ffff8000119f07a8 x4 : 0000000000000001
      | x3 : 9bcdab23f2432800 x2 : ffff800011730538
      | x1 : 9bcdab23f2432800 x0 : 0000000000000000
      | Call trace:
      |  lockdep_hardirqs_off+0xd4/0xe8
      |  enter_from_kernel_mode.isra.5+0x7c/0xa8
      |  el1_abort+0x24/0x100
      |  el1_sync_handler+0x80/0xd0
      |  el1_sync+0x6c/0x100
      |  __arch_clear_user+0xc/0x90
      |  load_elf_binary+0x9fc/0x1450
      |  bprm_execve+0x404/0x880
      |  kernel_execve+0x180/0x188
      |  call_usermodehelper_exec_async+0xdc/0x158
      |  ret_from_fork+0x10/0x18
      
      Fixes: 23529049 ("arm64: entry: fix non-NMI user<->kernel transitions")
      Fixes: 7cd1ea10 ("arm64: entry: fix non-NMI kernel<->kernel transitions")
      Fixes: f0cd5ac1 ("arm64: entry: fix NMI {user, kernel}->kernel transitions")
      Fixes: 2a9b3e6a ("arm64: entry: fix EL1 debug transitions")
      Link: https://lore.kernel.org/r/f4012761-026f-4e51-3a0c-7524e434e8b3@huawei.comSigned-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Reported-by: default avatarZenghui Yu <yuzenghui@huawei.com>
      Cc: Marc Zyngier <maz@kernel.org>
      Cc: Will Deacon <will@kernel.org>
      Acked-by: default avatarMarc Zyngier <maz@kernel.org>
      Link: https://lore.kernel.org/r/20210428111555.50880-1-mark.rutland@arm.comSigned-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      4d6a38da
  3. 30 Apr, 2021 6 commits
  4. 29 Apr, 2021 2 commits
  5. 23 Apr, 2021 7 commits
  6. 15 Apr, 2021 4 commits
    • Catalin Marinas's avatar
      Merge branch 'for-next/pac-set-get-enabled-keys' into for-next/core · a27a8816
      Catalin Marinas authored
      * for-next/pac-set-get-enabled-keys:
        : Introduce arm64 prctl(PR_PAC_{SET,GET}_ENABLED_KEYS).
        arm64: pac: Optimize kernel entry/exit key installation code paths
        arm64: Introduce prctl(PR_PAC_{SET,GET}_ENABLED_KEYS)
        arm64: mte: make the per-task SCTLR_EL1 field usable elsewhere
      a27a8816
    • Catalin Marinas's avatar
      Merge branch 'for-next/mte-async-kernel-mode' into for-next/core · 604df13d
      Catalin Marinas authored
      * for-next/mte-async-kernel-mode:
        : Add MTE asynchronous kernel mode support
        kasan, arm64: tests supports for HW_TAGS async mode
        arm64: mte: Report async tag faults before suspend
        arm64: mte: Enable async tag check fault
        arm64: mte: Conditionally compile mte_enable_kernel_*()
        arm64: mte: Enable TCO in functions that can read beyond buffer limits
        kasan: Add report for async mode
        arm64: mte: Drop arch_enable_tagging()
        kasan: Add KASAN mode kernel parameter
        arm64: mte: Add asynchronous mode support
      604df13d
    • Catalin Marinas's avatar
      Merge branches 'for-next/misc', 'for-next/kselftest', 'for-next/xntable',... · a1e1edde
      Catalin Marinas authored
      Merge branches 'for-next/misc', 'for-next/kselftest', 'for-next/xntable', 'for-next/vdso', 'for-next/fiq', 'for-next/epan', 'for-next/kasan-vmalloc', 'for-next/fgt-boot-init', 'for-next/vhe-only' and 'for-next/neon-softirqs-disabled', remote-tracking branch 'arm64/for-next/perf' into for-next/core
      
      * for-next/misc:
        : Miscellaneous patches
        arm64/sve: Add compile time checks for SVE hooks in generic functions
        arm64/kernel/probes: Use BUG_ON instead of if condition followed by BUG.
        arm64/sve: Remove redundant system_supports_sve() tests
        arm64: mte: Remove unused mte_assign_mem_tag_range()
        arm64: Add __init section marker to some functions
        arm64/sve: Rework SVE access trap to convert state in registers
        docs: arm64: Fix a grammar error
        arm64: smp: Add missing prototype for some smp.c functions
        arm64: setup: name `tcr` register
        arm64: setup: name `mair` register
        arm64: stacktrace: Move start_backtrace() out of the header
        arm64: barrier: Remove spec_bar() macro
        arm64: entry: remove test_irqs_unmasked macro
        ARM64: enable GENERIC_FIND_FIRST_BIT
        arm64: defconfig: Use DEBUG_INFO_REDUCED
      
      * for-next/kselftest:
        : Various kselftests for arm64
        kselftest: arm64: Add BTI tests
        kselftest/arm64: mte: Report filename on failing temp file creation
        kselftest/arm64: mte: Fix clang warning
        kselftest/arm64: mte: Makefile: Fix clang compilation
        kselftest/arm64: mte: Output warning about failing compiler
        kselftest/arm64: mte: Use cross-compiler if specified
        kselftest/arm64: mte: Fix MTE feature detection
        kselftest/arm64: mte: common: Fix write() warnings
        kselftest/arm64: mte: user_mem: Fix write() warning
        kselftest/arm64: mte: ksm_options: Fix fscanf warning
        kselftest/arm64: mte: Fix pthread linking
        kselftest/arm64: mte: Fix compilation with native compiler
      
      * for-next/xntable:
        : Add hierarchical XN permissions for all page tables
        arm64: mm: use XN table mapping attributes for user/kernel mappings
        arm64: mm: use XN table mapping attributes for the linear region
        arm64: mm: add missing P4D definitions and use them consistently
      
      * for-next/vdso:
        : Minor improvements to the compat vdso and sigpage
        arm64: compat: Poison the compat sigpage
        arm64: vdso: Avoid ISB after reading from cntvct_el0
        arm64: compat: Allow signal page to be remapped
        arm64: vdso: Remove redundant calls to flush_dcache_page()
        arm64: vdso: Use GFP_KERNEL for allocating compat vdso and signal pages
      
      * for-next/fiq:
        : Support arm64 FIQ controller registration
        arm64: irq: allow FIQs to be handled
        arm64: Always keep DAIF.[IF] in sync
        arm64: entry: factor irq triage logic into macros
        arm64: irq: rework root IRQ handler registration
        arm64: don't use GENERIC_IRQ_MULTI_HANDLER
        genirq: Allow architectures to override set_handle_irq() fallback
      
      * for-next/epan:
        : Support for Enhanced PAN (execute-only permissions)
        arm64: Support execute-only permissions with Enhanced PAN
      
      * for-next/kasan-vmalloc:
        : Support CONFIG_KASAN_VMALLOC on arm64
        arm64: Kconfig: select KASAN_VMALLOC if KANSAN_GENERIC is enabled
        arm64: kaslr: support randomized module area with KASAN_VMALLOC
        arm64: Kconfig: support CONFIG_KASAN_VMALLOC
        arm64: kasan: abstract _text and _end to KERNEL_START/END
        arm64: kasan: don't populate vmalloc area for CONFIG_KASAN_VMALLOC
      
      * for-next/fgt-boot-init:
        : Booting clarifications and fine grained traps setup
        arm64: Require that system registers at all visible ELs be initialized
        arm64: Disable fine grained traps on boot
        arm64: Document requirements for fine grained traps at boot
      
      * for-next/vhe-only:
        : Dealing with VHE-only CPUs (a.k.a. M1)
        arm64: Get rid of CONFIG_ARM64_VHE
        arm64: Cope with CPUs stuck in VHE mode
        arm64: cpufeature: Allow early filtering of feature override
      
      * arm64/for-next/perf:
        arm64: perf: Remove redundant initialization in perf_event.c
        perf/arm_pmu_platform: Clean up with dev_printk
        perf/arm_pmu_platform: Fix error handling
        perf/arm_pmu_platform: Use dev_err_probe() for IRQ errors
        docs: perf: Address some html build warnings
        docs: perf: Add new description on HiSilicon uncore PMU v2
        drivers/perf: hisi: Add support for HiSilicon PA PMU driver
        drivers/perf: hisi: Add support for HiSilicon SLLC PMU driver
        drivers/perf: hisi: Update DDRC PMU for programmable counter
        drivers/perf: hisi: Add new functions for HHA PMU
        drivers/perf: hisi: Add new functions for L3C PMU
        drivers/perf: hisi: Add PMU version for uncore PMU drivers.
        drivers/perf: hisi: Refactor code for more uncore PMUs
        drivers/perf: hisi: Remove unnecessary check of counter index
        drivers/perf: Simplify the SMMUv3 PMU event attributes
        drivers/perf: convert sysfs sprintf family to sysfs_emit
        drivers/perf: convert sysfs scnprintf family to sysfs_emit_at() and sysfs_emit()
        drivers/perf: convert sysfs snprintf family to sysfs_emit
      
      * for-next/neon-softirqs-disabled:
        : Run kernel mode SIMD with softirqs disabled
        arm64: fpsimd: run kernel mode NEON with softirqs disabled
        arm64: assembler: introduce wxN aliases for wN registers
        arm64: assembler: remove conditional NEON yield macros
      a1e1edde
    • Mark Brown's avatar
      arm64/sve: Add compile time checks for SVE hooks in generic functions · 087dfa5c
      Mark Brown authored
      The FPSIMD code was relying on IS_ENABLED() checks in system_suppors_sve()
      to cause the compiler to delete references to SVE functions in some places,
      add explicit IS_ENABLED() checks back.
      
      Fixes: ef9c5d09 ("arm64/sve: Remove redundant system_supports_sve() tests")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Link: https://lore.kernel.org/r/20210415121742.36628-1-broonie@kernel.orgSigned-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      087dfa5c
  7. 13 Apr, 2021 5 commits
  8. 12 Apr, 2021 3 commits
  9. 11 Apr, 2021 9 commits
  10. 08 Apr, 2021 1 commit