提交 7a745be1 编写于 作者: P Peter Zijlstra 提交者: Thomas Gleixner

x86/entry: __always_inline irqflags for noinstr

vmlinux.o: warning: objtool: lockdep_hardirqs_on()+0x65: call to arch_local_save_flags() leaves .noinstr.text section
vmlinux.o: warning: objtool: lockdep_hardirqs_off()+0x5d: call to arch_local_save_flags() leaves .noinstr.text section
vmlinux.o: warning: objtool: lock_is_held_type()+0x35: call to arch_local_irq_save() leaves .noinstr.text section
vmlinux.o: warning: objtool: check_preemption_disabled()+0x31: call to arch_local_save_flags() leaves .noinstr.text section
vmlinux.o: warning: objtool: check_preemption_disabled()+0x33: call to arch_irqs_disabled_flags() leaves .noinstr.text section
vmlinux.o: warning: objtool: lock_is_held_type()+0x2f: call to native_irq_disable() leaves .noinstr.text section
Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20200603114052.012171668@infradead.org

上级 28eaf871
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
/* Declaration required for gcc < 4.9 to prevent -Werror=missing-prototypes */ /* Declaration required for gcc < 4.9 to prevent -Werror=missing-prototypes */
extern inline unsigned long native_save_fl(void); extern inline unsigned long native_save_fl(void);
extern inline unsigned long native_save_fl(void) extern __always_inline unsigned long native_save_fl(void)
{ {
unsigned long flags; unsigned long flags;
...@@ -44,12 +44,12 @@ extern inline void native_restore_fl(unsigned long flags) ...@@ -44,12 +44,12 @@ extern inline void native_restore_fl(unsigned long flags)
:"memory", "cc"); :"memory", "cc");
} }
static inline void native_irq_disable(void) static __always_inline void native_irq_disable(void)
{ {
asm volatile("cli": : :"memory"); asm volatile("cli": : :"memory");
} }
static inline void native_irq_enable(void) static __always_inline void native_irq_enable(void)
{ {
asm volatile("sti": : :"memory"); asm volatile("sti": : :"memory");
} }
...@@ -74,22 +74,22 @@ static inline __cpuidle void native_halt(void) ...@@ -74,22 +74,22 @@ static inline __cpuidle void native_halt(void)
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <linux/types.h> #include <linux/types.h>
static inline notrace unsigned long arch_local_save_flags(void) static __always_inline unsigned long arch_local_save_flags(void)
{ {
return native_save_fl(); return native_save_fl();
} }
static inline notrace void arch_local_irq_restore(unsigned long flags) static __always_inline void arch_local_irq_restore(unsigned long flags)
{ {
native_restore_fl(flags); native_restore_fl(flags);
} }
static inline notrace void arch_local_irq_disable(void) static __always_inline void arch_local_irq_disable(void)
{ {
native_irq_disable(); native_irq_disable();
} }
static inline notrace void arch_local_irq_enable(void) static __always_inline void arch_local_irq_enable(void)
{ {
native_irq_enable(); native_irq_enable();
} }
...@@ -115,7 +115,7 @@ static inline __cpuidle void halt(void) ...@@ -115,7 +115,7 @@ static inline __cpuidle void halt(void)
/* /*
* For spinlocks, etc: * For spinlocks, etc:
*/ */
static inline notrace unsigned long arch_local_irq_save(void) static __always_inline unsigned long arch_local_irq_save(void)
{ {
unsigned long flags = arch_local_save_flags(); unsigned long flags = arch_local_save_flags();
arch_local_irq_disable(); arch_local_irq_disable();
...@@ -159,12 +159,12 @@ static inline notrace unsigned long arch_local_irq_save(void) ...@@ -159,12 +159,12 @@ static inline notrace unsigned long arch_local_irq_save(void)
#endif /* CONFIG_PARAVIRT_XXL */ #endif /* CONFIG_PARAVIRT_XXL */
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
static inline int arch_irqs_disabled_flags(unsigned long flags) static __always_inline int arch_irqs_disabled_flags(unsigned long flags)
{ {
return !(flags & X86_EFLAGS_IF); return !(flags & X86_EFLAGS_IF);
} }
static inline int arch_irqs_disabled(void) static __always_inline int arch_irqs_disabled(void)
{ {
unsigned long flags = arch_local_save_flags(); unsigned long flags = arch_local_save_flags();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册