RE: [Bug report] __arch_hweight32/64 x86

From: David Laight
Date: Thu Jun 29 2023 - 05:13:16 EST


From: Borislav Petkov
> Sent: 27 June 2023 05:26
>
> On Mon, Jun 26, 2023 at 03:41:27PM -0700, Dave Hansen wrote:
> > I'm not even sure that UML needs GENERIC_HWEIGHT. From a quick glance,
> > it looks like x86 used to use GENERIC_HWEIGHT, but got arch-specific
> > versions later. UML just never moved over to the arch-specific versions.
>
> Thanks - that could very well be the explanation.
>
> That bug report made me blink a couple of times since I did take extra
> precaution to not clobber regs in arch/x86/lib/hweight.S as this was
> part of the whole pain back then with calling a function from asm where
> gcc doesn't even know we're calling a function, see:

Perhaps the asm called function should use a different global
label than the one in the C file.

Then it wouldn't be as fragile.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)