mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anshuman Khandual <anshuman.khandual@arm.com>
To: linux-kernel@vger.kernel.org, yury.norov@gmail.com, arnd@arndb.de
Cc: Anshuman Khandual <anshuman.khandual@arm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	linux-arch@vger.kernel.org
Subject: [PATCH V4 0/2] uapi: Add support for GENMASK_U128()
Date: Thu, 22 Aug 2024 10:18:51 +0530	[thread overview]
Message-ID: <20240822044853.567386-1-anshuman.khandual@arm.com> (raw)

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 series is being used for an work in progress on arm64 platform.

https://lore.kernel.org/all/20240801054436.612024-1-anshuman.khandual@arm.com/

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 V4:

- Folded in the below patch which guards against assembly code
- Fixed __GENMASK_U128() for the corner case (128 bit left shift)
- Improved genmask_u128_test() and genmask_input_check_test()

https://lore.kernel.org/lkml/20240803133753.1598137-1-yury.norov@gmail.com/

Changes in V3:

https://lore.kernel.org/lkml/20240801071646.682731-1-anshuman.khandual@arm.com/

- 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       | 15 +++++++++++++++
 include/uapi/linux/bits.h  |  3 +++
 include/uapi/linux/const.h | 17 +++++++++++++++++
 lib/test_bits.c            | 34 ++++++++++++++++++++++++++++++++++
 4 files changed, 69 insertions(+)

-- 
2.30.2


             reply	other threads:[~2024-08-22  4:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-22  4:48 Anshuman Khandual [this message]
2024-08-22  4:48 ` [PATCH V4 1/2] uapi: Define GENMASK_U128 Anshuman Khandual
2024-08-22  4:48 ` [PATCH V4 2/2] lib/test_bits.c: Add tests for GENMASK_U128() Anshuman Khandual

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240822044853.567386-1-anshuman.khandual@arm.com \
    --to=anshuman.khandual@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=yury.norov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®