mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sohil Mehta <sohil.mehta@intel.com>
To: Maciej Wieczor-Retman <m.wieczorretman@pm.me>,
	<peterz@infradead.org>, <ryan.roberts@arm.com>,
	<ilpo.jarvinen@linux.intel.com>,
	<maciej.wieczor-retman@intel.com>, <jgross@suse.com>,
	<morbo@google.com>, <mingo@redhat.com>, <ljs@kernel.org>,
	<nathan@kernel.org>, <shuah@kernel.org>,
	<akpm@linux-foundation.org>, <james.morse@arm.com>,
	<oleg@redhat.com>, <houwenlong.hwl@antgroup.com>, <xin@zytor.com>,
	<justinstitt@google.com>, <seanjc@google.com>, <hpa@zytor.com>,
	<perry.yuan@amd.com>, <bp@alien8.de>,
	<dave.hansen@linux.intel.com>, <tglx@kernel.org>,
	<nick.desaulniers+lkml@gmail.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-kselftest@vger.kernel.org>,
	<llvm@lists.linux.dev>, <x86@kernel.org>
Subject: Re: [PATCH v6 3/3] selftests/lam: Update LAM tag width and cleanup names
Date: Wed, 22 Apr 2026 11:11:26 -0700	[thread overview]
Message-ID: <2e3c3288-4a82-4803-a0ad-5b931041a54c@intel.com> (raw)
In-Reply-To: <20687a8abed771847a4056e64aedbc073076d477.1775813245.git.m.wieczorretman@pm.me>

On 4/10/2026 2:55 AM, Maciej Wieczor-Retman wrote:
> diff --git a/tools/testing/selftests/x86/lam.c b/tools/testing/selftests/x86/lam.c
> index 1919fa6daec0..f14600e74d8c 100644
> --- a/tools/testing/selftests/x86/lam.c
> +++ b/tools/testing/selftests/x86/lam.c
> @@ -24,11 +24,15 @@
>  # error This test is 64-bit only
>  #endif
>  
> +#define GENMASK(h, l) (((~0UL) << (l)) & (~0UL >> (__BITS_PER_LONG - 1 - (h))))
> +


Did you run into any problem when including linux/bits.h? It would be
preferable to avoid redefining generic macros. I see the GENMASK defines
in tools/include/linux/bits.h and include/uapi/linux/bits.h.

If you are running into issues with the x86 selftests header includes,
the uapi one should be safe to use.

You probably just need:
#define GENMASK(h, l)		__GENMASK(h, l)


>  /* LAM modes, these definitions were copied from kernel code */
>  #define LAM_NONE                0
> -#define LAM_U57_BITS            6
> +#define LAM_TAG_BITS		4
> +#define LAM_LS_BIT		57
> +#define LAM_MS_BIT		(LAM_LS_BIT + LAM_TAG_BITS - 1) /* 60 */
> +#define LAM_UNTAG_MASK		~GENMASK(LAM_MS_BIT, LAM_LS_BIT)
>  

Same comment as patch 1:
#define LAM_UNTAG_MASK		~GENMASK(60, 57)


> -#define LAM_U57_MASK            (0x3fULL << 57)
>  /* arch prctl for LAM */
>  #define ARCH_GET_UNTAG_MASK     0x4001
>  #define ARCH_ENABLE_TAGGED_ADDR 0x4002
> @@ -51,8 +55,8 @@
>  #define GET_USER_KERNEL         3

The rest of the patch looks fine.

With the above addressed,

Reviewed-by: Sohil Mehta <sohil.mehta@intel.com>


  reply	other threads:[~2026-04-22 18:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-10  9:55 [PATCH v6 0/3] x86: Simplifying LAM Maciej Wieczor-Retman
2026-04-10  9:55 ` [PATCH v6 1/3] x86/process: Shorten the LAM tag width Maciej Wieczor-Retman
2026-04-22 17:24   ` Sohil Mehta
2026-04-22 17:53     ` Maciej Wieczor-Retman
2026-04-22 18:07   ` Edgecombe, Rick P
2026-04-23  8:09     ` Maciej Wieczor-Retman
2026-04-23  9:38       ` Maciej Wieczor-Retman
2026-04-23 18:07       ` Edgecombe, Rick P
2026-04-23 19:10         ` Maciej Wieczor-Retman
2026-04-10  9:55 ` [PATCH v6 2/3] x86/mm: Cleanup comments where LAM_U48 is mentioned Maciej Wieczor-Retman
2026-04-10  9:55 ` [PATCH v6 3/3] selftests/lam: Update LAM tag width and cleanup names Maciej Wieczor-Retman
2026-04-22 18:11   ` Sohil Mehta [this message]
2026-04-22 18:36     ` Maciej Wieczor-Retman

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=2e3c3288-4a82-4803-a0ad-5b931041a54c@intel.com \
    --to=sohil.mehta@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=houwenlong.hwl@antgroup.com \
    --cc=hpa@zytor.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=james.morse@arm.com \
    --cc=jgross@suse.com \
    --cc=justinstitt@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=ljs@kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=m.wieczorretman@pm.me \
    --cc=maciej.wieczor-retman@intel.com \
    --cc=mingo@redhat.com \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=nick.desaulniers+lkml@gmail.com \
    --cc=oleg@redhat.com \
    --cc=perry.yuan@amd.com \
    --cc=peterz@infradead.org \
    --cc=ryan.roberts@arm.com \
    --cc=seanjc@google.com \
    --cc=shuah@kernel.org \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    --cc=xin@zytor.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®