[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250228091532.GD5880@noisy.programming.kicks-ass.net>
Date: Fri, 28 Feb 2025 10:15:32 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Uros Bizjak <ubizjak@...il.com>
Cc: x86@...nel.org, llvm@...ts.linux.dev, linux-kernel@...r.kernel.org,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>
Subject: Re: [PATCH] x86/locking: Remove semicolon from "lock" prefix
On Fri, Feb 28, 2025 at 09:51:15AM +0100, Uros Bizjak wrote:
> Minimum version of binutils required to compile the kernel is 2.25.
> This version correctly handles the "lock" prefix, so it is possible
> to remove the semicolon, which was used to support ancient versions
> of GNU as.
>
> Due to the semicolon, the compiler considers "lock; insn" as two
> separate instructions. Removing the semicolon makes asm length
> calculations more accurate, consequently making scheduling and
> inlining decisions of the compiler more accurate.
>
> Removing the semicolon also enables assembler checks involving lock
> prefix. Trying to assemble e.g. "lock andl %eax, %ebx" results in:
>
> Error: expecting lockable instruction after `lock'
>
> Signed-off-by: Uros Bizjak <ubizjak@...il.com>
Ah, I always wondered why that ; was there.
Acked-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Powered by blists - more mailing lists