On 2024-12-20 16:05, Steven Rostedt wrote:

> 
> Can you try this patch on top of the last one?
> 

Hi Steven,

I just wanted to check if you saw my last reply to this thread.
I've tested both patches, and they work (tested on sparc32 and riscv32).

Let me know if you need more input.

Best regards,
// Ludwig

> 
> diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> index 7e257e855dd1..a9fe54b79ce5 100644
> --- a/kernel/trace/ring_buffer.c
> +++ b/kernel/trace/ring_buffer.c
> @@ -4398,8 +4398,13 @@ rb_reserve_next_event(struct trace_buffer *buffer,
>       int nr_loops = 0;
>       int add_ts_default;
>  
> -     /* ring buffer does cmpxchg, make sure it is safe in NMI context */
> -     if (!IS_ENABLED(CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG) &&
> +     /*
> +      * ring buffer does cmpxchg as well as atomic64 operations
> +      * (which some archs use locking for atomic64), make sure this
> +      * is safe in NMI context
> +      */
> +     if ((!IS_ENABLED(CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG) ||
> +          IS_ENABLED(CONFIG_GENERIC_ATOMIC64)) &&
>           (unlikely(in_nmi()))) {
>               return NULL;
>       }


Reply via email to