From: Sohil Mehta <sohil.mehta@intel.com>
To: Maciej Wieczor-Retman <m.wieczorretman@pm.me>
Cc: <x86@kernel.org>, <linux-kselftest@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <llvm@lists.linux.dev>,
<houwenlong.hwl@antgroup.com>, <dave.hansen@linux.intel.com>,
<ryan.roberts@arm.com>, <nick.desaulniers+lkml@gmail.com>,
<bp@alien8.de>, <will@kernel.org>,
<maciej.wieczor-retman@intel.com>, <david@kernel.org>,
<nathan@kernel.org>, <justinstitt@google.com>,
<seanjc@google.com>, <perry.yuan@amd.com>, <oleg@redhat.com>,
<tglx@kernel.org>, <hpa@zytor.com>, <james.morse@arm.com>,
<mingo@redhat.com>, <akpm@linux-foundation.org>,
<jgross@suse.com>, <peterz@infradead.org>, <morbo@google.com>,
<ilpo.jarvinen@linux.intel.com>, <xin@zytor.com>,
<shuah@kernel.org>
Subject: Re: [PATCH v5 1/3] x86/process: Shorten the default LAM tag width
Date: Tue, 7 Apr 2026 12:52:07 -0700 [thread overview]
Message-ID: <9580a35f-afa4-41a6-b53c-1f16033cea7f@intel.com> (raw)
In-Reply-To: <bf872c3f7591dc7580679e35b343b08534be2d5a.1775581451.git.m.wieczorretman@pm.me>
On 4/7/2026 10:45 AM, Maciej Wieczor-Retman wrote:
> diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
> index 08e72f429870..1a0e96835bbc 100644
> --- a/arch/x86/kernel/process_64.c
> +++ b/arch/x86/kernel/process_64.c
> @@ -797,7 +797,7 @@ static long prctl_map_vdso(const struct vdso_image *image, unsigned long addr)
>
> #ifdef CONFIG_ADDRESS_MASKING
>
> -#define LAM_U57_BITS 6
> +#define LAM_DEFAULT_BITS 4
>
As Dave mentioned earlier, the default wording makes it seem like this
can be configured. But that isn't true anymore, right?
How about naming this as LAM_TAG_BITS to match ARCH_GET_MAX_TAG_BITS?
> static void enable_lam_func(void *__mm)
> {
> @@ -814,7 +814,7 @@ static void enable_lam_func(void *__mm)
> static void mm_enable_lam(struct mm_struct *mm)
> {
> mm->context.lam_cr3_mask = X86_CR3_LAM_U57;
> - mm->context.untag_mask = ~GENMASK(62, 57);
> + mm->context.untag_mask = ~GENMASK(57 + LAM_DEFAULT_BITS - 1, 57);
>
Also, would it be useful to calculate the LAM mask as a #define because
it might need to be reused later or copied over to the selftest (as in
patch 3)?
next prev parent reply other threads:[~2026-04-07 19:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-07 17:45 [PATCH v5 0/3] x86: Simplifying LAM Maciej Wieczor-Retman
2026-04-07 17:45 ` [PATCH v5 1/3] x86/process: Shorten the default LAM tag width Maciej Wieczor-Retman
2026-04-07 19:52 ` Sohil Mehta [this message]
2026-04-07 20:31 ` Maciej Wieczor-Retman
2026-04-07 21:30 ` Sohil Mehta
2026-04-07 21:36 ` Maciej Wieczor-Retman
2026-04-07 21:36 ` David Laight
2026-04-07 21:53 ` Maciej Wieczor-Retman
2026-04-08 8:51 ` David Laight
2026-04-08 10:19 ` Maciej Wieczor-Retman
2026-04-07 17:45 ` [PATCH v5 2/3] x86/mm: Cleanup comments where LAM_U48 is mentioned Maciej Wieczor-Retman
2026-04-07 19:58 ` Sohil Mehta
2026-04-07 17:45 ` [PATCH v5 3/3] selftests/lam: Add test cases for different LAM tag widths Maciej Wieczor-Retman
2026-04-07 20:06 ` Sohil Mehta
2026-04-07 20:34 ` 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=9580a35f-afa4-41a6-b53c-1f16033cea7f@intel.com \
--to=sohil.mehta@intel.com \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=david@kernel.org \
--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=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=will@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