lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130831200124.GV3871@linux.vnet.ibm.com>
Date:	Sat, 31 Aug 2013 13:01:24 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Jiri Olsa <jolsa@...hat.com>, "H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [RFC][PATCH 16/18 v2] rcu/irq/x86: Mark functions that are RCU
 unsafe

On Sat, Aug 31, 2013 at 01:11:33AM -0400, Steven Rostedt wrote:
> From: "Steven Rostedt (Red Hat)" <rostedt@...dmis.org>
> 
> Some callbacks of the function tracer use rcu_read_lock(). This means that
> there's places that can not be traced because RCU is not tracking the CPU
> for various reasons (like NO_HZ_FULL and coming back from userspace).
> 
> Thes functions need to be marked so that callbacks that use RCU do not
> trace them.
> 
> Cc: H. Peter Anvin <hpa@...or.com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Signed-off-by: Steven Rostedt <rostedt@...dmis.org>

Acked-by: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>

> ---
>  arch/x86/kernel/apic/apic.c |    2 ++
>  arch/x86/kernel/irq.c       |    1 +
>  arch/x86/kernel/irq_work.c  |    3 +++
>  arch/x86/kernel/smp.c       |    8 ++++++++
>  kernel/softirq.c            |    2 ++
>  5 files changed, 16 insertions(+)
> 
> diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
> index eca89c5..91af16b 100644
> --- a/arch/x86/kernel/apic/apic.c
> +++ b/arch/x86/kernel/apic/apic.c
> @@ -931,6 +931,7 @@ void __irq_entry smp_apic_timer_interrupt(struct pt_regs *regs)
> 
>  	set_irq_regs(old_regs);
>  }
> +FTRACE_UNSAFE_RCU(smp_apic_timer_interrupt);
> 
>  void __irq_entry smp_trace_apic_timer_interrupt(struct pt_regs *regs)
>  {
> @@ -952,6 +953,7 @@ void __irq_entry smp_trace_apic_timer_interrupt(struct pt_regs *regs)
> 
>  	set_irq_regs(old_regs);
>  }
> +FTRACE_UNSAFE_RCU(smp_trace_apic_timer_interrupt);
> 
>  int setup_profiling_timer(unsigned int multiplier)
>  {
> diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
> index 3a8185c..fccd0d1 100644
> --- a/arch/x86/kernel/irq.c
> +++ b/arch/x86/kernel/irq.c
> @@ -203,6 +203,7 @@ unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
>  	set_irq_regs(old_regs);
>  	return 1;
>  }
> +FTRACE_UNSAFE_RCU(do_IRQ);
> 
>  /*
>   * Handler for X86_PLATFORM_IPI_VECTOR.
> diff --git a/arch/x86/kernel/irq_work.c b/arch/x86/kernel/irq_work.c
> index 636a55e..a2199c2 100644
> --- a/arch/x86/kernel/irq_work.c
> +++ b/arch/x86/kernel/irq_work.c
> @@ -7,6 +7,7 @@
>  #include <linux/kernel.h>
>  #include <linux/irq_work.h>
>  #include <linux/hardirq.h>
> +#include <linux/ftrace.h>
>  #include <asm/apic.h>
>  #include <asm/trace/irq_vectors.h>
> 
> @@ -28,6 +29,7 @@ void smp_irq_work_interrupt(struct pt_regs *regs)
>  	__smp_irq_work_interrupt();
>  	exiting_irq();
>  }
> +FTRACE_UNSAFE_RCU(smp_irq_work_interrupt);
> 
>  void smp_trace_irq_work_interrupt(struct pt_regs *regs)
>  {
> @@ -37,6 +39,7 @@ void smp_trace_irq_work_interrupt(struct pt_regs *regs)
>  	trace_irq_work_exit(IRQ_WORK_VECTOR);
>  	exiting_irq();
>  }
> +FTRACE_UNSAFE_RCU(smp_trace_irq_work_interrupt);
> 
>  void arch_irq_work_raise(void)
>  {
> diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
> index cdaa347..3d702ef 100644
> --- a/arch/x86/kernel/smp.c
> +++ b/arch/x86/kernel/smp.c
> @@ -23,6 +23,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/cpu.h>
>  #include <linux/gfp.h>
> +#include <linux/ftrace.h>
> 
>  #include <asm/mtrr.h>
>  #include <asm/tlbflush.h>
> @@ -175,6 +176,7 @@ asmlinkage void smp_reboot_interrupt(void)
>  	stop_this_cpu(NULL);
>  	irq_exit();
>  }
> +FTRACE_UNSAFE_RCU(smp_reboot_interrupt);
> 
>  static void native_stop_other_cpus(int wait)
>  {
> @@ -264,6 +266,7 @@ void smp_reschedule_interrupt(struct pt_regs *regs)
>  	 * KVM uses this interrupt to force a cpu out of guest mode
>  	 */
>  }
> +FTRACE_UNSAFE_RCU(smp_reschedule_interrupt);
> 
>  static inline void smp_entering_irq(void)
>  {
> @@ -288,6 +291,7 @@ void smp_trace_reschedule_interrupt(struct pt_regs *regs)
>  	 * KVM uses this interrupt to force a cpu out of guest mode
>  	 */
>  }
> +FTRACE_UNSAFE_RCU(smp_trace_reschedule_interrupt);
> 
>  static inline void __smp_call_function_interrupt(void)
>  {
> @@ -301,6 +305,7 @@ void smp_call_function_interrupt(struct pt_regs *regs)
>  	__smp_call_function_interrupt();
>  	exiting_irq();
>  }
> +FTRACE_UNSAFE_RCU(smp_call_function_interrupt);
> 
>  void smp_trace_call_function_interrupt(struct pt_regs *regs)
>  {
> @@ -310,6 +315,7 @@ void smp_trace_call_function_interrupt(struct pt_regs *regs)
>  	trace_call_function_exit(CALL_FUNCTION_VECTOR);
>  	exiting_irq();
>  }
> +FTRACE_UNSAFE_RCU(smp_trace_call_function_interrupt);
> 
>  static inline void __smp_call_function_single_interrupt(void)
>  {
> @@ -323,6 +329,7 @@ void smp_call_function_single_interrupt(struct pt_regs *regs)
>  	__smp_call_function_single_interrupt();
>  	exiting_irq();
>  }
> +FTRACE_UNSAFE_RCU(smp_call_function_single_interrupt);
> 
>  void smp_trace_call_function_single_interrupt(struct pt_regs *regs)
>  {
> @@ -332,6 +339,7 @@ void smp_trace_call_function_single_interrupt(struct pt_regs *regs)
>  	trace_call_function_single_exit(CALL_FUNCTION_SINGLE_VECTOR);
>  	exiting_irq();
>  }
> +FTRACE_UNSAFE_RCU(smp_trace_call_function_single_interrupt);
> 
>  static int __init nonmi_ipi_setup(char *str)
>  {
> diff --git a/kernel/softirq.c b/kernel/softirq.c
> index be3d351..7960e70 100644
> --- a/kernel/softirq.c
> +++ b/kernel/softirq.c
> @@ -325,6 +325,7 @@ void irq_enter(void)
> 
>  	__irq_enter();
>  }
> +FTRACE_UNSAFE_RCU(irq_enter);
> 
>  static inline void invoke_softirq(void)
>  {
> @@ -367,6 +368,7 @@ void irq_exit(void)
>  	tick_irq_exit();
>  	rcu_irq_exit();
>  }
> +FTRACE_UNSAFE_RCU(irq_exit);
> 
>  /*
>   * This function must run with irqs disabled!
> -- 
> 1.7.10.4
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ