arm64/daifflags: Make local_daif_*() helpers __always_inline

Make sure those helpers are always inlined and instrumentation safe.

Suggested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Leonardo Bras <leo.bras@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
This commit is contained in:
Leonardo Bras 2026-04-27 15:01:26 +01:00 committed by Will Deacon
parent 254f49634e
commit 827ce94e08

View File

@ -19,7 +19,7 @@
/* mask/save/unmask/restore all exceptions, including interrupts. */
static inline void local_daif_mask(void)
static __always_inline void local_daif_mask(void)
{
WARN_ON(system_has_prio_mask_debugging() &&
(read_sysreg_s(SYS_ICC_PMR_EL1) == (GIC_PRIO_IRQOFF |
@ -38,7 +38,7 @@ static inline void local_daif_mask(void)
trace_hardirqs_off();
}
static inline unsigned long local_daif_save_flags(void)
static __always_inline unsigned long local_daif_save_flags(void)
{
unsigned long flags;
@ -53,7 +53,7 @@ static inline unsigned long local_daif_save_flags(void)
return flags;
}
static inline unsigned long local_daif_save(void)
static __always_inline unsigned long local_daif_save(void)
{
unsigned long flags;
@ -64,7 +64,7 @@ static inline unsigned long local_daif_save(void)
return flags;
}
static inline void local_daif_restore(unsigned long flags)
static __always_inline void local_daif_restore(unsigned long flags)
{
bool irq_disabled = flags & PSR_I_BIT;
@ -124,7 +124,7 @@ static inline void local_daif_restore(unsigned long flags)
* Called by synchronous exception handlers to restore the DAIF bits that were
* modified by taking an exception.
*/
static inline void local_daif_inherit(struct pt_regs *regs)
static __always_inline void local_daif_inherit(struct pt_regs *regs)
{
unsigned long flags = regs->pstate & DAIF_MASK;