include/linux/bits.h | 2 ++ include/uapi/asm-generic/bitsperlong.h | 2 ++ include/uapi/linux/bits.h | 3 +++ include/uapi/linux/const.h | 1 + lib/test_bits.c | 25 +++++++++++++++++++++++++ 5 files changed, 33 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 V2: - 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 | 2 ++ include/uapi/asm-generic/bitsperlong.h | 2 ++ include/uapi/linux/bits.h | 3 +++ include/uapi/linux/const.h | 1 + lib/test_bits.c | 25 +++++++++++++++++++++++++ 5 files changed, 33 insertions(+) -- 2.30.2
On 7/25/24 11:18, Anshuman Khandual 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 > > Changes in V2: > > - 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() Hello Arnd, Does the changed series look good ? Please do let me know if something further needs to be changed. Thank you. - Anshuman
On Tue, Jul 30, 2024, at 06:29, Anshuman Khandual wrote: > On 7/25/24 11:18, Anshuman Khandual wrote: >> >> - 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() > > Does the changed series look good ? Please do let me know if something > further needs to be changed. Thank you. Yes, these look fine to me, please add Reviewed-by: Arnd Bergmann <arnd@arndb.de> One detail: You are not actually using __BITS_PER_U128 at all now, so I think it would be better to not add it at all.
On 7/30/24 17:59, Arnd Bergmann wrote: > On Tue, Jul 30, 2024, at 06:29, Anshuman Khandual wrote: >> On 7/25/24 11:18, Anshuman Khandual wrote: >>> >>> - 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() >> >> Does the changed series look good ? Please do let me know if something >> further needs to be changed. Thank you. > > Yes, these look fine to me, please add > > Reviewed-by: Arnd Bergmann <arnd@arndb.de> Thanks Arnd. > > One detail: You are not actually using __BITS_PER_U128 at > all now, so I think it would be better to not add it at all. Sure, will do, missed that some how.
On Thu, 25 Jul 2024 11:18:06 +0530 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. If this will be required for ongoing ARM development prior to the 6.11 release then it would make sense for these changes to be carried in the relevant ARM tree.
On 7/26/24 02:35, Andrew Morton wrote: > On Thu, 25 Jul 2024 11:18:06 +0530 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. > > If this will be required for ongoing ARM development prior to the 6.11 > release then it would make sense for these changes to be carried in the > relevant ARM tree. Hello Andrew, These changes are not required prior to 6.11, hence being taken via the mm tree is fine. - Anshuman
© 2016 - 2025 Red Hat, Inc.