Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 7 Mar 2019 18:02:54 +0100
From: Borislav Petkov <>
Cc: Nadav Amit <>,
	Rick Edgecombe <>,
	Andy Lutomirski <>, Ingo Molnar <>,
	LKML <>, X86 ML <>,
	Thomas Gleixner <>,
	Dave Hansen <>,
	Peter Zijlstra <>,
	Damian Tometzki <>,
	linux-integrity <>,
	LSM List <>,
	Andrew Morton <>,
	Kernel Hardening <>,
	Linux-MM <>, Will Deacon <>,
	Ard Biesheuvel <>,
	Kristen Carlson Accardi <>,
	"Dock, Deneen T" <>,
	Kees Cook <>,
	Dave Hansen <>,
	Masami Hiramatsu <>, Michael Matz <>
Subject: Re: [PATCH] x86/cpufeature: Remove __pure attribute to

Lemme preface this by saying that I've talked to gcc guys before doing

On Thu, Mar 07, 2019 at 08:43:50AM -0800, wrote:
> Uhm... (a) it is correct, even if the compiler doesn't use it now, it
> allows the compiler to CSE it in the future;

Well, the compiler won't CSE asm blocks due to the difference in the
labels, for example, so the heuristic won't detect them as equivalent

Also, compiler guys said that they might consider inlining pure
functions later, in the IPA stage but that's future stuff.

This is how I understood it, at least.

> (b) it is documentation;

That could be a comment instead. Otherwise we will wonder again why this
is marked pure.

> (c) there is an actual bug here: the "volatile" implies a side effect,
> which in reality is not present, inhibiting CSE.
> So the correct fix is to remove "volatile", not remove "__pure".

There's not really a volatile there:

 * GCC 'asm goto' miscompiles certain code sequences:
 * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
 * (asm goto is automatically volatile - the naming reflects this.)
#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)


Good mailing practices for 400: avoid top-posting and trim the reply.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.