Skip to content

Commit

Permalink
microblaze/irqs: Do not trace arch_local_{*,irq_*} functions
Browse files Browse the repository at this point in the history
Do not trace arch_local_save_flags(), arch_local_irq_*() and friends.
Although they are marked inline, gcc may still make a function out of
them and add it to the pool of functions that are traced by the function
tracer. This can cause undesirable results (kernel panic, triple faults,
etc).

Add the notrace notation to prevent them from ever being traced.

Cc: Michal Simek <monstr@monstr.eu>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and Michal Simek committed Jul 25, 2011
1 parent 02f8c6a commit a2f5269
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions arch/microblaze/include/asm/irqflags.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR

static inline unsigned long arch_local_irq_save(void)
static inline notrace unsigned long arch_local_irq_save(void)
{
unsigned long flags;
asm volatile(" msrclr %0, %1 \n"
Expand All @@ -25,7 +25,7 @@ static inline unsigned long arch_local_irq_save(void)
return flags;
}

static inline void arch_local_irq_disable(void)
static inline notrace void arch_local_irq_disable(void)
{
/* this uses r0 without declaring it - is that correct? */
asm volatile(" msrclr r0, %0 \n"
Expand All @@ -35,7 +35,7 @@ static inline void arch_local_irq_disable(void)
: "memory");
}

static inline void arch_local_irq_enable(void)
static inline notrace void arch_local_irq_enable(void)
{
/* this uses r0 without declaring it - is that correct? */
asm volatile(" msrset r0, %0 \n"
Expand All @@ -47,7 +47,7 @@ static inline void arch_local_irq_enable(void)

#else /* !CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */

static inline unsigned long arch_local_irq_save(void)
static inline notrace unsigned long arch_local_irq_save(void)
{
unsigned long flags, tmp;
asm volatile (" mfs %0, rmsr \n"
Expand All @@ -61,7 +61,7 @@ static inline unsigned long arch_local_irq_save(void)
return flags;
}

static inline void arch_local_irq_disable(void)
static inline notrace void arch_local_irq_disable(void)
{
unsigned long tmp;
asm volatile(" mfs %0, rmsr \n"
Expand All @@ -74,7 +74,7 @@ static inline void arch_local_irq_disable(void)
: "memory");
}

static inline void arch_local_irq_enable(void)
static inline notrace void arch_local_irq_enable(void)
{
unsigned long tmp;
asm volatile(" mfs %0, rmsr \n"
Expand All @@ -89,7 +89,7 @@ static inline void arch_local_irq_enable(void)

#endif /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */

static inline unsigned long arch_local_save_flags(void)
static inline notrace unsigned long arch_local_save_flags(void)
{
unsigned long flags;
asm volatile(" mfs %0, rmsr \n"
Expand All @@ -100,7 +100,7 @@ static inline unsigned long arch_local_save_flags(void)
return flags;
}

static inline void arch_local_irq_restore(unsigned long flags)
static inline notrace void arch_local_irq_restore(unsigned long flags)
{
asm volatile(" mts rmsr, %0 \n"
" nop \n"
Expand All @@ -109,12 +109,12 @@ static inline void arch_local_irq_restore(unsigned long flags)
: "memory");
}

static inline bool arch_irqs_disabled_flags(unsigned long flags)
static inline notrace bool arch_irqs_disabled_flags(unsigned long flags)
{
return (flags & MSR_IE) == 0;
}

static inline bool arch_irqs_disabled(void)
static inline notrace bool arch_irqs_disabled(void)
{
return arch_irqs_disabled_flags(arch_local_save_flags());
}
Expand Down

0 comments on commit a2f5269

Please sign in to comment.