Merge branch 'for-next/misc' into for-next/core

* for-next/misc:
  arm64: Disable KCSAN instrumentation in delay.o
  MAINTAINERS: arm64: Add Mark Rutland as an official Reviewer
  arm64: smp: Fix IPI teardown for GICv5 flow
  arm64: futex: Consolidate 'old == new' check in __lsui_cmpxchg32()
  arm64: ftrace: allow DIRECT_CALLS without CALL_OPS
  arm64: ftrace: prepare ftrace_modify_call() for use without CALL_OPS
This commit is contained in:
Will Deacon 2026-08-14 10:16:08 +00:00
commit 130bb50546
6 changed files with 32 additions and 43 deletions

View File

@ -3913,6 +3913,7 @@ F: drivers/platform/arm64/
ARM64 PORT (AARCH64 ARCHITECTURE)
M: Catalin Marinas <catalin.marinas@arm.com>
M: Will Deacon <will@kernel.org>
R: Mark Rutland <mark.rutland@arm.com>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git

View File

@ -187,7 +187,7 @@ config ARM64
if (GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS || \
CLANG_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS)
select HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS \
if DYNAMIC_FTRACE_WITH_ARGS && DYNAMIC_FTRACE_WITH_CALL_OPS
if DYNAMIC_FTRACE_WITH_ARGS
select HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS \
if (DYNAMIC_FTRACE_WITH_ARGS && !CFI && \
(CC_IS_CLANG || !CC_OPTIMIZE_FOR_SIZE))

View File

@ -151,42 +151,31 @@ __lsui_cmpxchg64(u64 __user *uaddr, u64 *oldval, u64 newval)
}
static __always_inline int
__lsui_cmpxchg32(u32 __user *uaddr, u32 oldval, u32 newval, u32 *oval)
__lsui_cmpxchg32(u32 __user *uaddr, u32 *oldval, u32 newval)
{
u64 __user *uaddr64;
bool futex_pos, other_pos;
u32 other, orig_other;
union {
u32 futex[2];
u64 raw;
} oval64, orig64, nval64;
} orig64, oval64, nval64;
uaddr64 = (u64 __user *)PTR_ALIGN_DOWN(uaddr, sizeof(u64));
futex_pos = !IS_ALIGNED((unsigned long)uaddr, sizeof(u64));
other_pos = !futex_pos;
oval64.futex[futex_pos] = oldval;
if (get_user(oval64.futex[other_pos], (u32 __user *)uaddr64 + other_pos))
orig64.futex[futex_pos] = *oldval;
if (get_user(orig64.futex[other_pos], (u32 __user *)uaddr64 + other_pos))
return -EFAULT;
orig64.raw = oval64.raw;
nval64 = oval64 = orig64;
nval64.futex[futex_pos] = newval;
nval64.futex[other_pos] = oval64.futex[other_pos];
if (__lsui_cmpxchg64(uaddr64, &oval64.raw, nval64.raw))
return -EFAULT;
oldval = oval64.futex[futex_pos];
other = oval64.futex[other_pos];
orig_other = orig64.futex[other_pos];
if (other != orig_other)
return -EAGAIN;
*oval = oldval;
return 0;
*oldval = oval64.futex[futex_pos];
return oval64.raw == orig64.raw ? 0 : -EAGAIN;
}
static __always_inline int
@ -202,7 +191,7 @@ __lsui_futex_atomic_and(int oparg, u32 __user *uaddr, int *oval)
static __always_inline int
__lsui_futex_atomic_eor(int oparg, u32 __user *uaddr, int *oval)
{
u32 oldval, newval, val;
u32 oldval, newval;
int ret, i;
if (get_user(oldval, uaddr))
@ -214,33 +203,27 @@ __lsui_futex_atomic_eor(int oparg, u32 __user *uaddr, int *oval)
for (i = 0; i < FUTEX_MAX_LOOPS; i++) {
newval = oldval ^ oparg;
ret = __lsui_cmpxchg32(uaddr, oldval, newval, &val);
switch (ret) {
case -EFAULT:
return ret;
case -EAGAIN:
continue;
}
if (val == oldval) {
*oval = val;
return 0;
}
oldval = val;
ret = __lsui_cmpxchg32(uaddr, &oldval, newval);
if (ret != -EAGAIN)
break;
}
return -EAGAIN;
*oval = oldval;
return ret;
}
static __always_inline int
__lsui_futex_cmpxchg(u32 __user *uaddr, u32 oldval, u32 newval, u32 *oval)
{
/*
* Callers of futex_atomic_cmpxchg_inatomic() already retry on
* -EAGAIN, no need for another loop of max retries.
*/
return __lsui_cmpxchg32(uaddr, oldval, newval, oval);
u32 curval = oldval;
int ret;
ret = __lsui_cmpxchg32(uaddr, &curval, newval);
if (ret == -EAGAIN && curval != oldval)
ret = 0;
*oval = curval;
return ret;
}
#endif /* CONFIG_ARM64_LSUI */

View File

@ -409,7 +409,8 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
return ftrace_modify_code(pc, old, new, true);
}
#ifdef CONFIG_DYNAMIC_FTRACE_WITH_CALL_OPS
#if defined(CONFIG_DYNAMIC_FTRACE_WITH_CALL_OPS) || \
defined(CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS)
int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr,
unsigned long addr)
{
@ -417,7 +418,7 @@ int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr,
u32 old, new;
int ret;
ret = ftrace_rec_set_ops(rec, arm64_rec_get_ops(rec));
ret = ftrace_rec_update_ops(rec);
if (ret)
return ret;

View File

@ -1086,7 +1086,7 @@ static void ipi_teardown(int cpu)
disable_percpu_irq(ipi_irq_base + i);
}
} else {
disable_irq(irq_desc_get_irq(get_ipi_desc(cpu, i)));
disable_irq_nosync(irq_desc_get_irq(get_ipi_desc(cpu, i)));
}
}
}

View File

@ -1,4 +1,8 @@
# SPDX-License-Identifier: GPL-2.0
# KCSAN uses udelay for introducing watchpoint delay; avoid recursion.
KCSAN_SANITIZE_delay.o := n
lib-y := clear_user.o delay.o copy_from_user.o \
copy_to_user.o copy_page.o \
clear_page.o csum.o insn.o memchr.o memcpy.o \