[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181031131110.GA13257@hirez.programming.kicks-ass.net>
Date: Wed, 31 Oct 2018 14:11:10 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Borislav Petkov <bp@...en8.de>
Cc: Segher Boessenkool <segher@...nel.crashing.org>,
Ingo Molnar <mingo@...nel.org>,
Richard Biener <rguenther@...e.de>,
Michael Matz <matz@...e.de>, gcc@....gnu.org,
Nadav Amit <namit@...are.com>, Ingo Molnar <mingo@...hat.com>,
linux-kernel@...r.kernel.org, x86@...nel.org,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Sam Ravnborg <sam@...nborg.org>,
Alok Kataria <akataria@...are.com>,
Christopher Li <sparse@...isli.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"H. Peter Anvin" <hpa@...or.com>, Jan Beulich <JBeulich@...e.com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Juergen Gross <jgross@...e.com>,
Kate Stewart <kstewart@...uxfoundation.org>,
Kees Cook <keescook@...omium.org>,
linux-sparse@...r.kernel.org,
Philippe Ombredanne <pombredanne@...b.com>,
Thomas Gleixner <tglx@...utronix.de>,
virtualization@...ts.linux-foundation.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Chris Zankel <chris@...kel.net>,
Max Filippov <jcmvbkbc@...il.com>,
linux-xtensa@...ux-xtensa.org,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: PROPOSAL: Extend inline asm syntax with size spec
On Wed, Oct 31, 2018 at 01:55:26PM +0100, Peter Zijlstra wrote:
> On Sat, Oct 13, 2018 at 09:33:35PM +0200, Borislav Petkov wrote:
> > Ok,
> >
> > with Segher's help I've been playing with his patch ontop of bleeding
> > edge gcc 9 and here are my observations. Please double-check me for
> > booboos so that they can be addressed while there's time.
> >
> > So here's what I see ontop of 4.19-rc7:
> >
> > First marked the alternative asm() as inline and undeffed the "inline"
> > keyword. I need to do that because of the funky games we do with
> > "inline" redefinitions in include/linux/compiler_types.h.
> >
> > And Segher hinted at either doing:
> >
> > asm volatile inline(...
> >
> > or
> >
> > asm volatile __inline__(...
> >
> > but both "inline" variants are defined as macros in that file.
> >
> > Which means we either need to #undef inline before using it in asm() or
> > come up with something cleverer.
>
> # git grep -e "\<__inline__\>" | wc -l
> 488
> # git grep -e "\<__inline\>" | wc -l
> 56
> # git grep -e "\<inline\>" | wc -l
> 69598
>
> And we already have scripts/checkpatch.pl:
>
> # Check for __inline__ and __inline, prefer inline
>
> Which suggests we do:
>
> git grep -l "\<__inline\(\|__\)\>" | while read file
> do
> sed -i -e 's/\<__inline\(\|__\)\>/inline/g' $file
> done
>
> and get it over with.
>
>
> Anyway, with the below patch, I get:
>
> text data bss dec hex filename
> 17385183 5064780 1953892 24403855 1745f8f defconfig-build/vmlinux
> 17385678 5064780 1953892 24404350 174617e defconfig-build/vmlinux
17387603 5065468 1953892 24406963 1746bb3 defconfig-build/vmlinux
If I do an additional:
git grep -l "asm volatile" | while read file
do
sed -i -e 's/asm volatile/asm_volatile/g' $file
done
on the tree...
No changes for:
-#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
+#define asm_volatile_goto(x...) do { asm __inline__ goto (x); asm (""); } while (0)
I suppose all our goto's are small now (my tree includes Nadav's patch
to static_cpu_has).
Powered by blists - more mailing lists