The patch titled Subject: uapi: define GENMASK_U128 has been added to the -mm mm-nonmm-unstable branch. Its filename is uapi-define-genmask_u128.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/uapi-define-genmask_u128.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Anshuman Khandual <anshuman.khandual@xxxxxxx> Subject: uapi: define GENMASK_U128 Date: Thu, 25 Jul 2024 11:18:07 +0530 Patch series "uapi: Add support for GENMASK_U128()", v2. 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. This patch (of 2): This adds GENMASK_U128() and __GENMASK_U128() macros using __BITS_PER_U128 and __int128 data types. These macros will be used in providing support for generating 128 bit masks. Link: https://lkml.kernel.org/r/20240725054808.286708-1-anshuman.khandual@xxxxxxx Link: https://lkml.kernel.org/r/20240725054808.286708-2-anshuman.khandual@xxxxxxx Signed-off-by: Anshuman Khandual <anshuman.khandual@xxxxxxx> Cc: Yury Norov <yury.norov@xxxxxxxxx> Cc: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx> Cc: Arnd Bergmann <arnd@xxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/bits.h | 2 ++ include/uapi/asm-generic/bitsperlong.h | 2 ++ include/uapi/linux/bits.h | 3 +++ include/uapi/linux/const.h | 1 + 4 files changed, 8 insertions(+) --- a/include/linux/bits.h~uapi-define-genmask_u128 +++ a/include/linux/bits.h @@ -35,5 +35,7 @@ (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l)) #define GENMASK_ULL(h, l) \ (GENMASK_INPUT_CHECK(h, l) + __GENMASK_ULL(h, l)) +#define GENMASK_U128(h, l) \ + (GENMASK_INPUT_CHECK(h, l) + __GENMASK_U128(h, l)) #endif /* __LINUX_BITS_H */ --- a/include/uapi/asm-generic/bitsperlong.h~uapi-define-genmask_u128 +++ a/include/uapi/asm-generic/bitsperlong.h @@ -28,4 +28,6 @@ #define __BITS_PER_LONG_LONG 64 #endif +#define __BITS_PER_U128 128 + #endif /* _UAPI__ASM_GENERIC_BITS_PER_LONG */ --- a/include/uapi/linux/bits.h~uapi-define-genmask_u128 +++ a/include/uapi/linux/bits.h @@ -12,4 +12,7 @@ (((~_ULL(0)) - (_ULL(1) << (l)) + 1) & \ (~_ULL(0) >> (__BITS_PER_LONG_LONG - 1 - (h)))) +#define __GENMASK_U128(h, l) \ + ((_BIT128((h) + 1)) - (_BIT128(l))) + #endif /* _UAPI_LINUX_BITS_H */ --- a/include/uapi/linux/const.h~uapi-define-genmask_u128 +++ a/include/uapi/linux/const.h @@ -27,6 +27,7 @@ #define _BITUL(x) (_UL(1) << (x)) #define _BITULL(x) (_ULL(1) << (x)) +#define _BIT128(x) ((unsigned __int128)(1) << (x)) #define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1) #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) _ Patches currently in -mm which might be from anshuman.khandual@xxxxxxx are uapi-define-genmask_u128.patch lib-test_bitsc-add-tests-for-genmask_u128.patch