Re: [PATCH 9/9] x86/bitops: Use the POPCNT instruction when available

2024-08-27 Thread Jan Beulich
On 27.08.2024 16:59, Andrew Cooper wrote: > On 27/08/2024 1:47 pm, Jan Beulich wrote: >> On 27.08.2024 13:17, Andrew Cooper wrote: >>> On 26/08/2024 2:07 pm, Jan Beulich wrote: On 23.08.2024 01:06, Andrew Cooper wrote: > @@ -475,4 +476,24 @@ static always_inline unsigned int arch_flsl(unsi

Re: [PATCH 9/9] x86/bitops: Use the POPCNT instruction when available

2024-08-27 Thread Andrew Cooper
On 27/08/2024 1:47 pm, Jan Beulich wrote: > On 27.08.2024 13:17, Andrew Cooper wrote: >> On 26/08/2024 2:07 pm, Jan Beulich wrote: >>> On 23.08.2024 01:06, Andrew Cooper wrote: A few RFC points. * I throught we had an x86 general lib-y but I can't find one, hence why it's

Re: [PATCH 9/9] x86/bitops: Use the POPCNT instruction when available

2024-08-27 Thread Jan Beulich
On 27.08.2024 13:17, Andrew Cooper wrote: > On 26/08/2024 2:07 pm, Jan Beulich wrote: >> On 23.08.2024 01:06, Andrew Cooper wrote: >>> A few RFC points. >>> >>> * I throught we had an x86 general lib-y but I can't find one, hence why >>> it's >>>still in xen/lib/ for now. >> We indeed have no

Re: [PATCH 9/9] x86/bitops: Use the POPCNT instruction when available

2024-08-27 Thread Andrew Cooper
On 26/08/2024 2:07 pm, Jan Beulich wrote: > On 23.08.2024 01:06, Andrew Cooper wrote: >> A few RFC points. >> >> * I throught we had an x86 general lib-y but I can't find one, hence why >> it's >>still in xen/lib/ for now. > We indeed have nothing like that yet. The file name should then imo

Re: [PATCH 9/9] x86/bitops: Use the POPCNT instruction when available

2024-08-26 Thread Jan Beulich
On 23.08.2024 01:06, Andrew Cooper wrote: > A few RFC points. > > * I throught we had an x86 general lib-y but I can't find one, hence why it's >still in xen/lib/ for now. We indeed have nothing like that yet. The file name should then imo not be arch-* though, but x86-*. Or you could put it

Re: [PATCH 9/9] x86/bitops: Use the POPCNT instruction when available

2024-08-23 Thread Andrew Cooper
On 23/08/2024 4:35 pm, Nicola Vetrini wrote: > On 2024-08-23 01:06, Andrew Cooper wrote: >> diff --git a/xen/lib/generic-hweightl.c b/xen/lib/generic-hweightl.c >> index fa4bbec273ab..4b39dd84de5e 100644 >> --- a/xen/lib/generic-hweightl.c >> +++ b/xen/lib/generic-hweightl.c >> @@ -43,4 +43,19 @@ s

Re: [PATCH 9/9] x86/bitops: Use the POPCNT instruction when available

2024-08-23 Thread Nicola Vetrini
On 2024-08-23 01:06, Andrew Cooper wrote: It has existed in x86 CPUs since 2008, so we're only 16 years late adding support. With all the other scafolding in place, implement arch_hweightl() for x86. The only complication is that the call to arch_generic_hweightl() is behind the compilers ba

[PATCH 9/9] x86/bitops: Use the POPCNT instruction when available

2024-08-22 Thread Andrew Cooper
It has existed in x86 CPUs since 2008, so we're only 16 years late adding support. With all the other scafolding in place, implement arch_hweightl() for x86. The only complication is that the call to arch_generic_hweightl() is behind the compilers back. Address this by writing it in ASM and ensu