[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221216123805.6eba002c@gandalf.local.home>
Date: Fri, 16 Dec 2022 12:38:04 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: David Laight <David.Laight@...LAB.COM>
Cc: 'Andreas Schwab' <schwab@...ux-m68k.org>,
"'Leizhen (ThunderTown)'" <thunder.leizhen@...wei.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Jiri Kosina <jikos@...nel.org>,
Miroslav Benes <mbenes@...e.cz>,
Petr Mladek <pmladek@...e.com>,
"Joe Lawrence" <joe.lawrence@...hat.com>,
"live-patching@...r.kernel.org" <live-patching@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Masahiro Yamada <masahiroy@...nel.org>,
Alexei Starovoitov <ast@...nel.org>,
Jiri Olsa <jolsa@...nel.org>,
Kees Cook <keescook@...omium.org>,
Andrew Morton <akpm@...ux-foundation.org>,
"Luis Chamberlain" <mcgrof@...nel.org>,
"linux-modules@...r.kernel.org" <linux-modules@...r.kernel.org>,
Ingo Molnar <mingo@...hat.com>,
linux-m68k <linux-m68k@...ts.linux-m68k.org>,
"Jason A. Donenfeld" <Jason@...c4.com>
Subject: Re: [PATCH v9] kallsyms: Add self-test facility
On Fri, 16 Dec 2022 12:19:47 -0500
Steven Rostedt <rostedt@...dmis.org> wrote:
> I assumed that "memory" was for memory unrelated to the input constraints.
Well, it looks like you do need a "memory" barrier.
https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html
"memory"
The "memory" clobber tells the compiler that the assembly code
performs memory reads or writes to items other than those listed in
the input and output operands (for example, accessing the memory
pointed to by one of the input parameters). To ensure memory contains
correct values, GCC may need to flush specific register values to
memory before executing the asm. Further, the compiler does not
assume that any values read from memory before an asm remain
unchanged after that asm; it reloads them as needed. Using the
"memory" clobber effectively forms a read/write memory barrier for
the compiler.
As the "(for example, accessing the memory pointed to by one of the input
parameters)" is exactly this case.
-- Steve
Powered by blists - more mailing lists