From: peterz@infradead.org
To: Marco Elver <elver@google.com>
Cc: jgross@suse.com, fenghua.yu@intel.com, yu-cheng.yu@intel.com,
tony.luck@intel.com, dave.hansen@linux.intel.com,
syzkaller-bugs@googlegroups.com, linux-kernel@vger.kernel.org,
kasan-dev@googlegroups.com,
virtualization@lists.linux-foundation.org, mingo@redhat.com,
bp@alien8.de, hpa@zytor.com, tglx@linutronix.de,
syzbot <syzbot+8db9e1ecde74e590a657@syzkaller.appspotmail.com>,
x86@kernel.org
Subject: Re: [PATCH] x86/paravirt: Add missing noinstr to arch_local*() helpers
Date: Wed, 5 Aug 2020 15:42:32 +0200 [thread overview]
Message-ID: <20200805134232.GR2674@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20200805132629.GA87338@elver.google.com>
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.
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next parent reply other threads:[~2020-08-05 13:42 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <0000000000007d3b2d05ac1c303e@google.com>
[not found] ` <20200805132629.GA87338@elver.google.com>
2020-08-05 13:42 ` peterz [this message]
[not found] ` <20200805135940.GA156343@elver.google.com>
2020-08-05 14:12 ` [PATCH] x86/paravirt: Add missing noinstr to arch_local*() helpers peterz
2020-08-05 14:17 ` Jürgen Groß
2020-08-05 14:17 ` peterz
[not found] ` <CANpmjNN6FWZ+MsAn3Pj+WEez97diHzqF8hjONtHG15C2gSpSgw@mail.gmail.com>
[not found] ` <CANpmjNNy3XKQqgrjGPPKKvXhAoF=mae7dk8hmoS4k4oNnnB=KA@mail.gmail.com>
[not found] ` <20200806074723.GA2364872@elver.google.com>
2020-08-06 11:32 ` peterz
[not found] ` <20200806131702.GA3029162@elver.google.com>
[not found] ` <CANpmjNNqt8YrCad4WqgCoXvH47pRXtSLpnTKhD8W8+UpoYJ+jQ@mail.gmail.com>
[not found] ` <CANpmjNO860SHpNve+vaoAOgarU1SWy8o--tUWCqNhn82OLCiew@mail.gmail.com>
2020-08-07 9:24 ` Jürgen Groß
[not found] ` <20200807095032.GA3528289@elver.google.com>
2020-08-07 10:35 ` Jürgen Groß
[not found] ` <20200807113838.GA3547125@elver.google.com>
2020-08-07 12:04 ` Jürgen Groß
[not found] ` <CANpmjNPau_DEYadey9OL+iFZKEaUTqnFnyFs1dU12o00mg7ofA@mail.gmail.com>
[not found] ` <20200807151903.GA1263469@elver.google.com>
[not found] ` <CANpmjNM1jASqCFYZpteVrZCa2V2D_DbXaqvoCV_Ac2boYfDXnQ@mail.gmail.com>
2020-08-11 7:04 ` Jürgen Groß
2020-08-11 7:41 ` Peter Zijlstra
2020-08-11 7:57 ` Jürgen Groß
2020-08-11 8:12 ` Peter Zijlstra
2020-08-11 8:18 ` Jürgen Groß
2020-08-11 8:38 ` Jürgen Groß
2020-08-11 9:20 ` peterz
2020-08-11 9:46 ` peterz
2020-08-11 20:17 ` peterz
[not found] ` <20200812080650.GA3894595@elver.google.com>
2020-08-12 8:18 ` peterz
2020-08-12 8:57 ` peterz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200805134232.GR2674@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=elver@google.com \
--cc=fenghua.yu@intel.com \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=syzbot+8db9e1ecde74e590a657@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=x86@kernel.org \
--cc=yu-cheng.yu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).