Re: [PATCH] x86: fix user address masking non-canonical speculation issue

From: Linus Torvalds
Date: Thu Oct 24 2024 - 16:00:29 EST


On Thu, 24 Oct 2024 at 12:09, Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
>
> On a non-related note, doesn't the inline asm need a "cc" clobber?

All inline asm is always a cc clobber on x86, probably because the
bulk of x86 instructions do.

Having one is certainly not _wrong_, but we typically don't have it.

(See for example all of the atomics, all bitops, and pretty much
everything else).

We do see to have added the "cc" clobber to a handful of cases - it
looks like the virtualization people do it, because it's mostly
<asm/vmware.h> and <asm/mshyperv.h>, and the ones I found in
<asm/barrier.h> were added by Michael Tsirkin, who is mostly also on
the virt side.

I'm not sure what triggered the virt people to do it, but it's
certainly not wrong, it's just neither needed nor traditional.

Linus