1. 15 Dec, 2022 1 commit
  2. 14 Dec, 2022 1 commit
  3. 06 Dec, 2022 20 commits
    • Will Deacon's avatar
      Merge branch 'for-next/undef-traps' into for-next/core · 5f4c3747
      Will Deacon authored
      * for-next/undef-traps:
        arm64: armv8_deprecated: fix unused-function error
        arm64: armv8_deprecated: rework deprected instruction handling
        arm64: armv8_deprecated: move aarch32 helper earlier
        arm64: armv8_deprecated move emulation functions
        arm64: armv8_deprecated: fold ops into insn_emulation
        arm64: rework EL0 MRS emulation
        arm64: factor insn read out of call_undef_hook()
        arm64: factor out EL1 SSBS emulation hook
        arm64: split EL0/EL1 UNDEF handlers
        arm64: allow kprobes on EL0 handlers
      5f4c3747
    • Will Deacon's avatar
      Merge branch 'for-next/trivial' into for-next/core · 9d84ad42
      Will Deacon authored
      * for-next/trivial:
        arm64: alternatives: add __init/__initconst to some functions/variables
        arm64/asm: Remove unused assembler DAIF save/restore macros
        arm64/kpti: Move DAIF masking to C code
        Revert "arm64/mm: Drop redundant BUG_ON(!pgtable_alloc)"
        arm64/mm: Drop unused restore_ttbr1
        arm64: alternatives: make apply_alternatives_vdso() static
        arm64/mm: Drop idmap_pg_end[] declaration
        arm64/mm: Drop redundant BUG_ON(!pgtable_alloc)
        arm64: make is_ttbrX_addr() noinstr-safe
        arm64/signal: Document our convention for choosing magic numbers
        arm64: atomics: lse: remove stale dependency on JUMP_LABEL
        arm64: paravirt: remove conduit check in has_pv_steal_clock
        arm64: entry: Fix typo
        arm64/booting: Add missing colon to FA64 entry
        arm64/mm: Drop ARM64_KERNEL_USES_PMD_MAPS
        arm64/asm: Remove unused enable_da macro
      9d84ad42
    • Will Deacon's avatar
      Merge branch 'for-next/sysregs' into for-next/core · 70b1c62a
      Will Deacon authored
      * for-next/sysregs: (39 commits)
        arm64/sysreg: Remove duplicate definitions from asm/sysreg.h
        arm64/sysreg: Convert ID_DFR1_EL1 to automatic generation
        arm64/sysreg: Convert ID_DFR0_EL1 to automatic generation
        arm64/sysreg: Convert ID_AFR0_EL1 to automatic generation
        arm64/sysreg: Convert ID_MMFR5_EL1 to automatic generation
        arm64/sysreg: Convert MVFR2_EL1 to automatic generation
        arm64/sysreg: Convert MVFR1_EL1 to automatic generation
        arm64/sysreg: Convert MVFR0_EL1 to automatic generation
        arm64/sysreg: Convert ID_PFR2_EL1 to automatic generation
        arm64/sysreg: Convert ID_PFR1_EL1 to automatic generation
        arm64/sysreg: Convert ID_PFR0_EL1 to automatic generation
        arm64/sysreg: Convert ID_ISAR6_EL1 to automatic generation
        arm64/sysreg: Convert ID_ISAR5_EL1 to automatic generation
        arm64/sysreg: Convert ID_ISAR4_EL1 to automatic generation
        arm64/sysreg: Convert ID_ISAR3_EL1 to automatic generation
        arm64/sysreg: Convert ID_ISAR2_EL1 to automatic generation
        arm64/sysreg: Convert ID_ISAR1_EL1 to automatic generation
        arm64/sysreg: Convert ID_ISAR0_EL1 to automatic generation
        arm64/sysreg: Convert ID_MMFR4_EL1 to automatic generation
        arm64/sysreg: Convert ID_MMFR3_EL1 to automatic generation
        ...
      70b1c62a
    • Will Deacon's avatar
      Merge branch 'for-next/sve-state' into for-next/core · 75bc81d0
      Will Deacon authored
      * for-next/sve-state:
        arm64/fp: Use a struct to pass data to fpsimd_bind_state_to_cpu()
        arm64/sve: Leave SVE enabled on syscall if we don't context switch
        arm64/fpsimd: SME no longer requires SVE register state
        arm64/fpsimd: Load FP state based on recorded data type
        arm64/fpsimd: Stop using TIF_SVE to manage register saving in KVM
        arm64/fpsimd: Have KVM explicitly say which FP registers to save
        arm64/fpsimd: Track the saved FPSIMD state type separately to TIF_SVE
        KVM: arm64: Discard any SVE state when entering KVM guests
      75bc81d0
    • Will Deacon's avatar
      Merge branch 'for-next/stacks' into for-next/core · 595a121e
      Will Deacon authored
      * for-next/stacks:
        arm64: move on_thread_stack() to <asm/stacktrace.h>
        arm64: remove current_top_of_stack()
      595a121e
    • Will Deacon's avatar
      Merge branch 'for-next/selftests' into for-next/core · 32b48248
      Will Deacon authored
      * for-next/selftests:
        kselftest/arm64: Allow epoll_wait() to return more than one result
        kselftest/arm64: Don't drain output while spawning children
        kselftest/arm64: Hold fp-stress children until they're all spawned
        kselftest/arm64: Set test names prior to starting children
        kselftest/arm64: Use preferred form for predicate load/stores
        kselftest/arm64: fix array_size.cocci warning
        kselftest/arm64: fix array_size.cocci warning
        kselftest/arm64: Print ASCII version of unknown signal frame magic values
        kselftest/arm64: Remove validation of extra_context from TODO
        kselftest/arm64: Provide progress messages when signalling children
        kselftest/arm64: Check that all children are producing output in fp-stress
      32b48248
    • Will Deacon's avatar
      Merge branch 'for-next/perf' into for-next/core · 10162e78
      Will Deacon authored
      * for-next/perf: (21 commits)
        arm_pmu: Drop redundant armpmu->map_event() in armpmu_event_init()
        drivers/perf: hisi: Add TLP filter support
        Documentation: perf: Indent filter options list of hisi-pcie-pmu
        docs: perf: Fix PMU instance name of hisi-pcie-pmu
        drivers/perf: hisi: Fix some event id for hisi-pcie-pmu
        arm64/perf: Replace PMU version number '0' with ID_AA64DFR0_EL1_PMUVer_NI
        perf/amlogic: Remove unused header inclusions of  <linux/version.h>
        perf/amlogic: Fix build error for x86_64 allmodconfig
        dt-binding: perf: Add Amlogic DDR PMU
        docs/perf: Add documentation for the Amlogic G12 DDR PMU
        perf/amlogic: Add support for Amlogic meson G12 SoC DDR PMU driver
        MAINTAINERS: Update HiSilicon PMU maintainers
        perf: arm_cspmu: Fix module cyclic dependency
        perf: arm_cspmu: Fix build failure on x86_64
        perf: arm_cspmu: Fix modular builds due to missing MODULE_LICENSE()s
        perf: arm_cspmu: Add support for NVIDIA SCF and MCF attribute
        perf: arm_cspmu: Add support for ARM CoreSight PMU driver
        perf/smmuv3: Fix hotplug callback leak in arm_smmu_pmu_init()
        perf/arm_dmc620: Fix hotplug callback leak in dmc620_pmu_init()
        drivers: perf: marvell_cn10k: Fix hotplug callback leak in tad_pmu_init()
        ...
      10162e78
    • Will Deacon's avatar
      Merge branch 'for-next/mm' into for-next/core · c947948f
      Will Deacon authored
      * for-next/mm:
        arm64: booting: Require placement within 48-bit addressable memory
        arm64: mm: kfence: only handle translation faults
        arm64/mm: Simplify and document pte_to_phys() for 52 bit addresses
      c947948f
    • Will Deacon's avatar
      Merge branch 'for-next/kprobes' into for-next/core · 37f5d61a
      Will Deacon authored
      * for-next/kprobes:
        arm64: kprobes: Return DBG_HOOK_ERROR if kprobes can not handle a BRK
        arm64: kprobes: Let arch do_page_fault() fix up page fault in user handler
        arm64: Prohibit instrumentation on arch_stack_walk()
      37f5d61a
    • Will Deacon's avatar
      Merge branch 'for-next/kdump' into for-next/core · 926939c7
      Will Deacon authored
      * for-next/kdump:
        arm64: kdump: Support crashkernel=X fall back to reserve region above DMA zones
        arm64: kdump: Provide default size when crashkernel=Y,low is not specified
      926939c7
    • Will Deacon's avatar
      Merge branch 'for-next/kbuild' into for-next/core · d864e905
      Will Deacon authored
      * for-next/kbuild:
        arm64: remove special treatment for the link order of head.o
      d864e905
    • Will Deacon's avatar
      Merge branch 'for-next/insn' into for-next/core · 586e1ad9
      Will Deacon authored
      * for-next/insn:
        arm64:uprobe fix the uprobe SWBP_INSN in big-endian
        arm64: insn: always inline hint generation
        arm64: insn: simplify insn group identification
        arm64: insn: always inline predicates
        arm64: insn: remove aarch64_insn_gen_prefetch()
      586e1ad9
    • Will Deacon's avatar
      Merge branch 'for-next/ftrace' into for-next/core · a4aebff7
      Will Deacon authored
      * for-next/ftrace:
        ftrace: arm64: remove static ftrace
        ftrace: arm64: move from REGS to ARGS
        ftrace: abstract DYNAMIC_FTRACE_WITH_ARGS accesses
        ftrace: rename ftrace_instruction_pointer_set() -> ftrace_regs_set_instruction_pointer()
        ftrace: pass fregs to arch_ftrace_set_direct_caller()
      a4aebff7
    • Will Deacon's avatar
      Merge branch 'for-next/fpsimd' into for-next/core · 1a916ed7
      Will Deacon authored
      * for-next/fpsimd:
        arm64/fpsimd: Make kernel_neon_ API _GPL
      1a916ed7
    • Will Deacon's avatar
      Merge branch 'for-next/ffa' into for-next/core · 5def4a97
      Will Deacon authored
      * for-next/ffa:
        firmware: arm_ffa: Move comment before the field it is documenting
        firmware: arm_ffa: Move constants to header file
      5def4a97
    • Will Deacon's avatar
      Merge branch 'for-next/errata' into for-next/core · f455fb65
      Will Deacon authored
      * for-next/errata:
        arm64: errata: Workaround possible Cortex-A715 [ESR|FAR]_ELx corruption
        arm64: Add Cortex-715 CPU part definition
      f455fb65
    • Will Deacon's avatar
      Merge branch 'for-next/dynamic-scs' into for-next/core · f6ffa4c8
      Will Deacon authored
      * for-next/dynamic-scs:
        arm64: implement dynamic shadow call stack for Clang
        scs: add support for dynamic shadow call stacks
        arm64: unwind: add asynchronous unwind tables to kernel and modules
      f6ffa4c8
    • Will Deacon's avatar
      Merge branch 'for-next/cpufeature' into for-next/core · 9f930478
      Will Deacon authored
      * for-next/cpufeature:
        kselftest/arm64: Add SVE 2.1 to hwcap test
        arm64/hwcap: Add support for SVE 2.1
        kselftest/arm64: Add FEAT_RPRFM to the hwcap test
        arm64/hwcap: Add support for FEAT_RPRFM
        kselftest/arm64: Add FEAT_CSSC to the hwcap selftest
        arm64/hwcap: Add support for FEAT_CSSC
        arm64: Enable data independent timing (DIT) in the kernel
      9f930478
    • Will Deacon's avatar
      Merge branch 'for-next/asm-const' into for-next/core · d49d7c2e
      Will Deacon authored
      * for-next/asm-const:
        arm64: alternative: constify alternative_has_feature_* argument
        arm64: jump_label: mark arguments as const to satisfy asm constraints
      d49d7c2e
    • Will Deacon's avatar
      Merge branch 'for-next/acpi' into for-next/core · c46ae1fc
      Will Deacon authored
      * for-next/acpi:
        ACPI: APMT: Fix kerneldoc and indentation
        ACPI: Enable FPDT on arm64
        arm_pmu: acpi: handle allocation failure
        arm_pmu: rework ACPI probing
        arm_pmu: factor out PMU matching
        arm_pmu: acpi: factor out PMU<->CPU association
        ACPI/IORT: Update SMMUv3 DeviceID support
        ACPI: ARM Performance Monitoring Unit Table (APMT) initial support
      c46ae1fc
  4. 05 Dec, 2022 5 commits
    • Masami Hiramatsu (Google)'s avatar
      arm64: kprobes: Return DBG_HOOK_ERROR if kprobes can not handle a BRK · 3b84efc0
      Masami Hiramatsu (Google) authored
      Return DBG_HOOK_ERROR if kprobes can not handle a BRK because it
      fails to find a kprobe corresponding to the address.
      
      Since arm64 kprobes uses stop_machine based text patching for removing
      BRK, it ensures all running kprobe_break_handler() is done at that point.
      And after removing the BRK, it removes the kprobe from its hash list.
      Thus, if the kprobe_break_handler() fails to find kprobe from hash list,
      there is a bug.
      Signed-off-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
      Link: https://lore.kernel.org/r/166994753273.439920.6629626290560350760.stgit@devnote3Signed-off-by: default avatarWill Deacon <will@kernel.org>
      3b84efc0
    • Masami Hiramatsu (Google)'s avatar
      arm64: kprobes: Let arch do_page_fault() fix up page fault in user handler · 30a42155
      Masami Hiramatsu (Google) authored
      Since arm64's do_page_fault() can handle the page fault correctly
      than kprobe_fault_handler() according to the context, let it handle
      the page fault instead of simply call fixup_exception() in the
      kprobe_fault_handler().
      Signed-off-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
      Link: https://lore.kernel.org/r/166994752269.439920.4801339965959400456.stgit@devnote3Signed-off-by: default avatarWill Deacon <will@kernel.org>
      30a42155
    • Masami Hiramatsu (Google)'s avatar
      arm64: Prohibit instrumentation on arch_stack_walk() · 0fbcd8ab
      Masami Hiramatsu (Google) authored
      Mark arch_stack_walk() as noinstr instead of notrace and inline functions
      called from arch_stack_walk() as __always_inline so that user does not
      put any instrumentations on it, because this function can be used from
      return_address() which is used by lockdep.
      
      Without this, if the kernel built with CONFIG_LOCKDEP=y, just probing
      arch_stack_walk() via <tracefs>/kprobe_events will crash the kernel on
      arm64.
      
       # echo p arch_stack_walk >> ${TRACEFS}/kprobe_events
       # echo 1 > ${TRACEFS}/events/kprobes/enable
        kprobes: Failed to recover from reentered kprobes.
        kprobes: Dump kprobe:
        .symbol_name = arch_stack_walk, .offset = 0, .addr = arch_stack_walk+0x0/0x1c0
        ------------[ cut here ]------------
        kernel BUG at arch/arm64/kernel/probes/kprobes.c:241!
        kprobes: Failed to recover from reentered kprobes.
        kprobes: Dump kprobe:
        .symbol_name = arch_stack_walk, .offset = 0, .addr = arch_stack_walk+0x0/0x1c0
        ------------[ cut here ]------------
        kernel BUG at arch/arm64/kernel/probes/kprobes.c:241!
        PREEMPT SMP
        Modules linked in:
        CPU: 0 PID: 17 Comm: migration/0 Tainted: G                 N 6.1.0-rc5+ #6
        Hardware name: linux,dummy-virt (DT)
        Stopper: 0x0 <- 0x0
        pstate: 600003c5 (nZCv DAIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
        pc : kprobe_breakpoint_handler+0x178/0x17c
        lr : kprobe_breakpoint_handler+0x178/0x17c
        sp : ffff8000080d3090
        x29: ffff8000080d3090 x28: ffff0df5845798c0 x27: ffffc4f59057a774
        x26: ffff0df5ffbba770 x25: ffff0df58f420f18 x24: ffff49006f641000
        x23: ffffc4f590579768 x22: ffff0df58f420f18 x21: ffff8000080d31c0
        x20: ffffc4f590579768 x19: ffffc4f590579770 x18: 0000000000000006
        x17: 5f6b636174735f68 x16: 637261203d207264 x15: 64612e202c30203d
        x14: 2074657366666f2e x13: 30633178302f3078 x12: 302b6b6c61775f6b
        x11: 636174735f686372 x10: ffffc4f590dc5bd8 x9 : ffffc4f58eb31958
        x8 : 00000000ffffefff x7 : ffffc4f590dc5bd8 x6 : 80000000fffff000
        x5 : 000000000000bff4 x4 : 0000000000000000 x3 : 0000000000000000
        x2 : 0000000000000000 x1 : ffff0df5845798c0 x0 : 0000000000000064
        Call trace:
        kprobes: Failed to recover from reentered kprobes.
        kprobes: Dump kprobe:
        .symbol_name = arch_stack_walk, .offset = 0, .addr = arch_stack_walk+0x0/0x1c0
        ------------[ cut here ]------------
        kernel BUG at arch/arm64/kernel/probes/kprobes.c:241!
      
      Fixes: 39ef362d ("arm64: Make return_address() use arch_stack_walk()")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
      Link: https://lore.kernel.org/r/166994751368.439920.3236636557520824664.stgit@devnote3Signed-off-by: default avatarWill Deacon <will@kernel.org>
      0fbcd8ab
    • junhua huang's avatar
      arm64:uprobe fix the uprobe SWBP_INSN in big-endian · 60f07e22
      junhua huang authored
      We use uprobe in aarch64_be, which we found the tracee task would exit
      due to SIGILL when we enable the uprobe trace.
      We can see the replace inst from uprobe is not correct in aarch big-endian.
      As in Armv8-A, instruction fetches are always treated as little-endian,
      we should treat the UPROBE_SWBP_INSN as little-endian。
      
      The test case is as following。
      bash-4.4# ./mqueue_test_aarchbe 1 1 2 1 10 > /dev/null &
      bash-4.4# cd /sys/kernel/debug/tracing/
      bash-4.4# echo 'p:test /mqueue_test_aarchbe:0xc30 %x0 %x1' > uprobe_events
      bash-4.4# echo 1 > events/uprobes/enable
      bash-4.4#
      bash-4.4# ps
        PID TTY          TIME CMD
        140 ?        00:00:01 bash
        237 ?        00:00:00 ps
      [1]+  Illegal instruction     ./mqueue_test_aarchbe 1 1 2 1 100 > /dev/null
      
      which we debug use gdb as following:
      
      bash-4.4# gdb attach 155
      (gdb) disassemble send
      Dump of assembler code for function send:
         0x0000000000400c30 <+0>:     .inst   0xa00020d4 ; undefined
         0x0000000000400c34 <+4>:     mov     x29, sp
         0x0000000000400c38 <+8>:     str     w0, [sp, #28]
         0x0000000000400c3c <+12>:    strb    w1, [sp, #27]
         0x0000000000400c40 <+16>:    str     xzr, [sp, #40]
         0x0000000000400c44 <+20>:    str     xzr, [sp, #48]
         0x0000000000400c48 <+24>:    add     x0, sp, #0x1b
         0x0000000000400c4c <+28>:    mov     w3, #0x0                 // #0
         0x0000000000400c50 <+32>:    mov     x2, #0x1                 // #1
         0x0000000000400c54 <+36>:    mov     x1, x0
         0x0000000000400c58 <+40>:    ldr     w0, [sp, #28]
         0x0000000000400c5c <+44>:    bl      0x405e10 <mq_send>
         0x0000000000400c60 <+48>:    str     w0, [sp, #60]
         0x0000000000400c64 <+52>:    ldr     w0, [sp, #60]
         0x0000000000400c68 <+56>:    ldp     x29, x30, [sp], #64
         0x0000000000400c6c <+60>:    ret
      End of assembler dump.
      (gdb) info b
      No breakpoints or watchpoints.
      (gdb) c
      Continuing.
      
      Program received signal SIGILL, Illegal instruction.
      0x0000000000400c30 in send ()
      (gdb) x/10x 0x400c30
      0x400c30 <send>:    0xd42000a0   0xfd030091      0xe01f00b9      0xe16f0039
      0x400c40 <send+16>: 0xff1700f9   0xff1b00f9      0xe06f0091      0x03008052
      0x400c50 <send+32>: 0x220080d2   0xe10300aa
      (gdb) disassemble 0x400c30
      Dump of assembler code for function send:
      => 0x0000000000400c30 <+0>:     .inst   0xa00020d4 ; undefined
         0x0000000000400c34 <+4>:     mov     x29, sp
         0x0000000000400c38 <+8>:     str     w0, [sp, #28]
         0x0000000000400c3c <+12>:    strb    w1, [sp, #27]
         0x0000000000400c40 <+16>:    str     xzr, [sp, #40]
      Signed-off-by: default avatarjunhua huang <huang.junhua@zte.com.cn>
      Link: https://lore.kernel.org/r/202212021511106844809@zte.com.cnSigned-off-by: default avatarWill Deacon <will@kernel.org>
      60f07e22
    • Jisheng Zhang's avatar
      arm64: alternatives: add __init/__initconst to some functions/variables · 67bc5b2d
      Jisheng Zhang authored
      apply_alternatives_vdso(), __apply_alternatives_multi_stop() and
      kernel_alternatives are not needed after booting, so mark the two
      functions as __init and the var as __initconst.
      Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
      Link: https://lore.kernel.org/r/20221202161859.2228-1-jszhang@kernel.orgSigned-off-by: default avatarWill Deacon <will@kernel.org>
      67bc5b2d
  5. 02 Dec, 2022 1 commit
  6. 01 Dec, 2022 12 commits