[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200805134232.GR2674@hirez.programming.kicks-ass.net>
Date: Wed, 5 Aug 2020 15:42:32 +0200
From: peterz@...radead.org
To: Marco Elver <elver@...gle.com>
Cc: bp@...en8.de, dave.hansen@...ux.intel.com, fenghua.yu@...el.com,
hpa@...or.com, linux-kernel@...r.kernel.org, mingo@...hat.com,
syzkaller-bugs@...glegroups.com, tglx@...utronix.de,
tony.luck@...el.com, x86@...nel.org, yu-cheng.yu@...el.com,
jgross@...e.com, sdeep@...are.com,
virtualization@...ts.linux-foundation.org,
kasan-dev@...glegroups.com,
syzbot <syzbot+8db9e1ecde74e590a657@...kaller.appspotmail.com>
Subject: Re: [PATCH] x86/paravirt: Add missing noinstr to arch_local*()
helpers
On Wed, Aug 05, 2020 at 03:26:29PM +0200, Marco Elver wrote:
> Add missing noinstr to arch_local*() helpers, as they may be called from
> noinstr code.
>
> On a KCSAN config with CONFIG_PARAVIRT=y, syzbot stumbled across corrupt
Cute, so I've been working on adding objtool support for this a little:
https://lkml.kernel.org/r/20200803143231.GE2674@hirez.programming.kicks-ass.net
> diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
> index 3d2afecde50c..a606f2ba2b5e 100644
> --- a/arch/x86/include/asm/paravirt.h
> +++ b/arch/x86/include/asm/paravirt.h
> @@ -760,27 +760,27 @@ bool __raw_callee_save___native_vcpu_is_preempted(long cpu);
> ((struct paravirt_callee_save) { func })
>
> #ifdef CONFIG_PARAVIRT_XXL
> -static inline notrace unsigned long arch_local_save_flags(void)
> +static inline noinstr unsigned long arch_local_save_flags(void)
> {
> return PVOP_CALLEE0(unsigned long, irq.save_fl);
> }
>
> -static inline notrace void arch_local_irq_restore(unsigned long f)
> +static inline noinstr void arch_local_irq_restore(unsigned long f)
> {
> PVOP_VCALLEE1(irq.restore_fl, f);
> }
>
> -static inline notrace void arch_local_irq_disable(void)
> +static inline noinstr void arch_local_irq_disable(void)
> {
> PVOP_VCALLEE0(irq.irq_disable);
> }
>
> -static inline notrace void arch_local_irq_enable(void)
> +static inline noinstr void arch_local_irq_enable(void)
> {
> PVOP_VCALLEE0(irq.irq_enable);
> }
>
> -static inline notrace unsigned long arch_local_irq_save(void)
> +static inline noinstr unsigned long arch_local_irq_save(void)
> {
> unsigned long f;
>
Shouldn't we __always_inline those? They're going to be really small.
Powered by blists - more mailing lists