[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAADnVQLDY+6bGQqpiWCX5uaRBQYCEtnw_LYqpZdeLUE5s22Byw@mail.gmail.com>
Date: Sun, 21 Dec 2025 16:56:28 -0800
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Uros Bizjak <ubizjak@...il.com>
Cc: bpf <bpf@...r.kernel.org>, X86 ML <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>, Andrii Nakryiko <andrii@...nel.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>
Subject: Re: [PATCH] x86/bpf: Avoid emitting LOCK prefix for XCHG atomic ops
On Mon, Dec 8, 2025 at 6:34 AM Uros Bizjak <ubizjak@...il.com> wrote:
>
> The x86 XCHG instruction is implicitly locked when one of the
> operands is a memory location, making an explicit LOCK prefix
> unnecessary.
>
> Stop emitting the LOCK prefix for BPF_XCHG in the JIT atomic
> read-modify-write helpers. This avoids redundant instruction
> prefixes while preserving correct atomic semantics.
>
> No functional change for other atomic operations.
>
> Signed-off-by: Uros Bizjak <ubizjak@...il.com>
> Cc: Alexei Starovoitov <ast@...nel.org>
> Cc: Daniel Borkmann <daniel@...earbox.net>
> Cc: Andrii Nakryiko <andrii@...nel.org>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Ingo Molnar <mingo@...nel.org>
> Cc: Borislav Petkov <bp@...en8.de>
> Cc: Dave Hansen <dave.hansen@...ux.intel.com>
> Cc: "H. Peter Anvin" <hpa@...or.com>
> ---
> arch/x86/net/bpf_jit_comp.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
Applied to bpf-next.
Powered by blists - more mailing lists