[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <565ac06a-005f-4b77-930e-d63285c025b9@citrix.com>
Date: Tue, 29 Apr 2025 22:59:52 +0100
From: Andrew Cooper <andrew.cooper3@...rix.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>,
"H. Peter Anvin" <hpa@...or.com>
Cc: Ingo Molnar <mingo@...nel.org>, Arnd Bergmann <arnd@...db.de>,
Arnd Bergmann <arnd@...nel.org>, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
Juergen Gross <jgross@...e.com>, Boris Ostrovsky
<boris.ostrovsky@...cle.com>, Alexander Usyskin
<alexander.usyskin@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Mateusz Jończyk <mat.jonczyk@...pl>,
Mike Rapoport <rppt@...nel.org>, Ard Biesheuvel <ardb@...nel.org>,
Peter Zijlstra <peterz@...radead.org>, linux-kernel@...r.kernel.org,
xen-devel@...ts.xenproject.org
Subject: Re: [PATCH] bitops/32: Convert variable_ffs() and fls() zero-case
handling to C
On 29/04/2025 10:53 pm, Linus Torvalds wrote:
> I just did
>
> gcc -m32 -O2 -S -fomit-frame-pointer t.c
>
> (with, and without that -m32) and looked at the result to see that it
> looks sane. No *actual* testing.
do_variable_ffs() doesn't quite work.
REP BSF is LZCNT, and unconditionally writes it's output operand, and
defeats the attempt to preload with -1.
Drop the REP prefix, and it should work as intended.
~Andrew
Powered by blists - more mailing lists