include/linux/bits.h | 13 +++++++++++++ include/uapi/linux/bits.h | 3 +++ include/uapi/linux/const.h | 15 +++++++++++++++ lib/test_bits.c | 23 +++++++++++++++++++++++ 4 files changed, 54 insertions(+)
This adds support for GENMASK_U128() and some corresponding tests as well. GENMASK_U128() generated 128 bit masks will be required later on the arm64 platform for enabling FEAT_SYSREG128 and FEAT_D128 features. Because GENMAKS_U128() depends on __int128 data type being supported in the compiler, its usage needs to be protected with CONFIG_ARCH_SUPPORTS_INT128. Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Yury Norov <yury.norov@gmail.com> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk> Cc: Arnd Bergmann <arnd@arndb.de>> Cc: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org Changes in V3: - Dropped unused __BITS_PER_U128 - Moved #ifdef CONFIG_ARCH_SUPPORTS_INT128 inside genmask_u128_test() - Added asm unsupported comments for GENMASK_U128() and __BIT128() - Added reviewed tag from Arnd Changes in V2: https://lore.kernel.org/all/20240725054808.286708-1-anshuman.khandual@arm.com/ - Wrapped genmask_u128_test() with CONFIG_ARCH_SUPPORTS_INT128 - Defined __BITS_PER_U128 unconditionally as 128 - Defined __GENMASK_U128() via new _BIT128() - Dropped _U128() and _AC128() Changes in V1: https://lore.kernel.org/lkml/20240724103142.165693-1-anshuman.khandual@arm.com/ Anshuman Khandual (2): uapi: Define GENMASK_U128 lib/test_bits.c: Add tests for GENMASK_U128() include/linux/bits.h | 13 +++++++++++++ include/uapi/linux/bits.h | 3 +++ include/uapi/linux/const.h | 15 +++++++++++++++ lib/test_bits.c | 23 +++++++++++++++++++++++ 4 files changed, 54 insertions(+) -- 2.30.2
On Thu, Aug 1, 2024 at 12:16 AM Anshuman Khandual <anshuman.khandual@arm.com> wrote: > > This adds support for GENMASK_U128() and some corresponding tests as well. > GENMASK_U128() generated 128 bit masks will be required later on the arm64 > platform for enabling FEAT_SYSREG128 and FEAT_D128 features. > > Because GENMAKS_U128() depends on __int128 data type being supported in the > compiler, its usage needs to be protected with CONFIG_ARCH_SUPPORTS_INT128. > > Cc: Andrew Morton <akpm@linux-foundation.org> > Cc: Yury Norov <yury.norov@gmail.com> > Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk> > Cc: Arnd Bergmann <arnd@arndb.de>> > Cc: linux-kernel@vger.kernel.org > Cc: linux-arch@vger.kernel.org For the patches: Reviewed-by: Yury Norov <yury.norov@gmail.com> This series doesn't include a real use-case for the new macros. Do you have some? I can take it via my branch, but I need at least one use-case to not merge dead code. Thanks, Yury
On 8/1/24 20:13, Yury Norov wrote: > On Thu, Aug 1, 2024 at 12:16 AM Anshuman Khandual > <anshuman.khandual@arm.com> wrote: >> >> This adds support for GENMASK_U128() and some corresponding tests as well. >> GENMASK_U128() generated 128 bit masks will be required later on the arm64 >> platform for enabling FEAT_SYSREG128 and FEAT_D128 features. >> >> Because GENMAKS_U128() depends on __int128 data type being supported in the >> compiler, its usage needs to be protected with CONFIG_ARCH_SUPPORTS_INT128. >> >> Cc: Andrew Morton <akpm@linux-foundation.org> >> Cc: Yury Norov <yury.norov@gmail.com> >> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk> >> Cc: Arnd Bergmann <arnd@arndb.de>> >> Cc: linux-kernel@vger.kernel.org >> Cc: linux-arch@vger.kernel.org > > For the patches: > > Reviewed-by: Yury Norov <yury.norov@gmail.com> Thanks Yury. > > This series doesn't include a real use-case for the new macros. Do you > have some? > I can take it via my branch, but I need at least one use-case to not > merge dead code. I have recently posted the following patch for arm64 platform although most of the subsequent work is still in progress. But for now there are some corresponding tests for this new GENMASK_U128() ABI as well. Hence it will be really great to have these two patches merged first. Thank you. https://lore.kernel.org/all/20240801054436.612024-1-anshuman.khandual@arm.com/
On Fri, Aug 02, 2024 at 07:00:43AM +0530, Anshuman Khandual wrote: > > > On 8/1/24 20:13, Yury Norov wrote: > > On Thu, Aug 1, 2024 at 12:16 AM Anshuman Khandual > > <anshuman.khandual@arm.com> wrote: > >> > >> This adds support for GENMASK_U128() and some corresponding tests as well. > >> GENMASK_U128() generated 128 bit masks will be required later on the arm64 > >> platform for enabling FEAT_SYSREG128 and FEAT_D128 features. > >> > >> Because GENMAKS_U128() depends on __int128 data type being supported in the > >> compiler, its usage needs to be protected with CONFIG_ARCH_SUPPORTS_INT128. > >> > >> Cc: Andrew Morton <akpm@linux-foundation.org> > >> Cc: Yury Norov <yury.norov@gmail.com> > >> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk> > >> Cc: Arnd Bergmann <arnd@arndb.de>> > >> Cc: linux-kernel@vger.kernel.org > >> Cc: linux-arch@vger.kernel.org > > > > For the patches: > > > > Reviewed-by: Yury Norov <yury.norov@gmail.com> > > Thanks Yury. > > > > > This series doesn't include a real use-case for the new macros. Do you > > have some? > > I can take it via my branch, but I need at least one use-case to not > > merge dead code. > > I have recently posted the following patch for arm64 platform although > most of the subsequent work is still in progress. But for now there > are some corresponding tests for this new GENMASK_U128() ABI as well. > Hence it will be really great to have these two patches merged first. > Thank you. > > https://lore.kernel.org/all/20240801054436.612024-1-anshuman.khandual@arm.com/ If you're going to merge the above patch in 6.12, you'd normally send it together with GENMASK_U128 preparation series, get an ACK from me and Rasmus for bitops part and move through arm64 tree. Whatever, I've merged it in bitmap-for-next for testing. Please keep me posted for any following patches. Thanks, Yury
© 2016 - 2026 Red Hat, Inc.