]> xenbits.xensource.com Git - xen.git/commit
xen/lib: introduce generic find next bit operations
authorOleksii Kurochko <oleksii.kurochko@gmail.com>
Fri, 9 Feb 2024 17:58:30 +0000 (18:58 +0100)
committerJulien Grall <jgrall@amazon.com>
Wed, 28 Feb 2024 11:55:32 +0000 (11:55 +0000)
commitba0d1a7cedc8b282b5b6e780e0846f3189e9cc90
tree8218df871ed51246a4594e3a1fdde1341cd6a486
parent801c4e72621d5541d249af1938a77466f0dcfe88
xen/lib: introduce generic find next bit operations

find-next-bit.c is common for Arm64, PPC and RISCV64,
so it is moved to xen/lib.

PPC has been transitioned to generic functions from find-next-bit.c
since it now shares the same implementation as the PPC-specific code.

The MISRA exclude list has been updated to verify
lib/find-next-bit.c instead of Arm's find_next_bit.c,
as Arm's find_next_bit.c has been relocated to xen/lib/.

Despite CONFIG_GENERIC_FIND_FIRST_BIT not currently being used in
Xen and being removed from the Linux kernel [1], it could theoretically
prove useful for Xen. This is because the Linux kernel transitioned
Arm to the generic version of find_first_bit() and
find_first_zero_bit() due to improvements [1] in both performance
and .text size.
It would be prudent to investigate whether [1] is applicable to Xen
as well and, if so, implement the necessary changes in a separate patch.

[1] https://lore.kernel.org/linux-arch/20211005054059.475634-5-yury.norov@gmail.com/

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
docs/misra/exclude-list.json
xen/arch/arm/arm64/lib/Makefile
xen/arch/arm/arm64/lib/find_next_bit.c [deleted file]
xen/arch/arm/include/asm/arm64/bitops.h
xen/arch/ppc/include/asm/bitops.h
xen/include/xen/bitops.h
xen/lib/Makefile
xen/lib/find-next-bit.c [new file with mode: 0644]