Re: [PATCH -v2] x86/hweight: Get rid of the special calling convention

From: Borislav Petkov
Date: Tue May 10 2016 - 15:10:51 EST


On Tue, May 10, 2016 at 12:03:48PM -0700, H. Peter Anvin wrote:
> Also, to be fair... if the problem is with these being in C then we
> could just do it in assembly easily enough.

I thought about converting the __sw_hweight* variants to asm but
__sw_hweight32, for example, is 55 bytes here and that's a lot.

Or do you have a better idea?

peterz's sounds ok to me: we call a thunk which then calls __sw_hweight*
after having saved regs properly - problem solved.

--
Regards/Gruss,
Boris.

SUSE Linux GmbH, GF: Felix ImendÃrffer, Jane Smithard, Graham Norton, HRB 21284 (AG NÃrnberg)
--