--- zzzz-none-000/linux-5.15.111/arch/x86/include/asm/irqflags.h 2023-05-11 14:00:40.000000000 +0000 +++ puma7-atom-6670-761/linux-5.15.111/arch/x86/include/asm/irqflags.h 2024-02-07 10:22:34.000000000 +0000 @@ -11,6 +11,10 @@ /* Provide __cpuidle; we can't safely include */ #define __cpuidle __section(".cpuidle.text") +#if IS_ENABLED(CONFIG_ENABLE_IRQ_PROFILING_HOOKS) +#include +#include +#endif /* * Interrupt control: */ @@ -72,11 +76,30 @@ static __always_inline void arch_local_irq_disable(void) { +#if IS_ENABLED(CONFIG_ENABLE_IRQ_PROFILING_HOOKS) + unsigned long flags = arch_local_save_flags(); + native_irq_disable(); + avm_simple_profiling_irq_disabled(_THIS_IP_, _RET_IP_, + !(flags & X86_EFLAGS_IF), /* old-disable-status */ + 0x1 /* new-disable-status */ + ); +#else + native_irq_disable(); +#endif } static __always_inline void arch_local_irq_enable(void) { +#if IS_ENABLED(CONFIG_ENABLE_IRQ_PROFILING_HOOKS) + unsigned long flags = arch_local_save_flags(); + + avm_simple_profiling_irq_disabled((unsigned long)&&here, _RET_IP_, + !(flags & X86_EFLAGS_IF), /* old-disable-status */ + 0x0 /* new-disable-status */ + ); +here: +#endif native_irq_enable(); } @@ -104,7 +127,14 @@ static __always_inline unsigned long arch_local_irq_save(void) { unsigned long flags = arch_local_save_flags(); - arch_local_irq_disable(); + + native_irq_disable(); +#if IS_ENABLED(CONFIG_ENABLE_IRQ_PROFILING_HOOKS) + avm_simple_profiling_irq_disabled(_THIS_IP_, _RET_IP_, + !(flags & X86_EFLAGS_IF), /* old-disable-status */ + 0x1 /* new-disable-status */ + ); +#endif return flags; } #else @@ -136,6 +166,13 @@ static __always_inline void arch_local_irq_restore(unsigned long flags) { +#if IS_ENABLED(CONFIG_ENABLE_IRQ_PROFILING_HOOKS) + avm_simple_profiling_irq_disabled((unsigned long)&&here, _RET_IP_, + 0x1, /* old-disable-status */ + !(flags & X86_EFLAGS_IF) /* new-disable-status */ + ); +here: +#endif if (!arch_irqs_disabled_flags(flags)) arch_local_irq_enable(); }