All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Uros Bizjak <ubizjak@gmail.com>
Cc: x86@kernel.org, llvm@lists.linux.dev,
	linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>
Subject: Re: [PATCH] x86/locking: Remove semicolon from "lock" prefix
Date: Fri, 28 Feb 2025 10:15:32 +0100	[thread overview]
Message-ID: <20250228091532.GD5880@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20250228085149.2478245-1-ubizjak@gmail.com>

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@gmail.com>

Ah, I always wondered why that ; was there.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

  reply	other threads:[~2025-02-28  9:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-28  8:51 [PATCH] x86/locking: Remove semicolon from "lock" prefix Uros Bizjak
2025-02-28  9:15 ` Peter Zijlstra [this message]
2025-02-28  9:28 ` [tip: locking/core] " tip-bot2 for Uros Bizjak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250228091532.GD5880@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=justinstitt@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mingo@kernel.org \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=nick.desaulniers+lkml@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=ubizjak@gmail.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.