Re: [GIT PULL] x86/asm updates for v5.10

From: Linus Torvalds
Date: Mon Oct 12 2020 - 15:34:18 EST


On Mon, Oct 12, 2020 at 12:24 PM Uros Bizjak <ubizjak@xxxxxxxxx> wrote:
>
> I don't think it is even possible to write to a part of a register in the asm. An example:

But this example is the *reverse* of what I worry about.

I worry about the asm writing not to a "part" of a register, but to
*more* than we told the compiler we'd write to.

If we told the compiler we're only writing to %al, then I could see
the compiler using %ah for something, and scheduling that "somethihng"
to after the inline asm that said it was only modifying the low bits.

Now, I do believe you're right that gcc (and probably clang) simply
doesn't track %ah liveness and clobbering separately from %al.

But it still stinks as a concept when this isn't actually documented
anywhere I can tell.

See my worry?

Linus