mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maciej Wieczor-Retman <m.wieczorretman@pm.me>
To: Nikolay Borisov <nik.borisov@suse.com>
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/3] x86/process: Shorten the default LAM tag width
Date: Tue, 10 Mar 2026 09:53:25 +0000	[thread overview]
Message-ID: <aa_dbil5I5G2GhCe@wieczorr-mobl1.localdomain> (raw)
In-Reply-To: <f3563ed5-3221-42f6-9020-7f5ae16e9c70@suse.com>

On 2026-03-06 at 18:58:31 +0200, Nikolay Borisov wrote:
>
>
>On 2.03.26 г. 17:34 ч., Maciej Wieczor-Retman wrote:
>> From: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
>>
>> With the announcement of ChkTag, it's worth preparing a stable x86
>> linear address masking (lam) user interface. One important aspect of lam
>> is the tag width, and aligning it with other industry solutions can
>> provide a more popular, generalized interface that other technologies
>> could utilize.
>>
>> ChkTag will use 4-bit tags and since that's the direction other memory
>> tagging implementations seem to be taking too (for example Arm's MTE)
>> it's reasonable to converge lam in linux to the same specification. Even
>> though x86's LAM supports 6-bit tags it is beneficial to default lam to
>> 4 bits as ChkTag will likely be the main user of the interface and such
>> connection should simplify things in the future.
>>
>> Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
>> ---
>> Changelog v3:
>> - Remove the variability of the lam width after the debugfs part was
>>    removed from the patchset.
>>
>>   arch/x86/kernel/process_64.c | 8 ++++----
>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> 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
>
>If this is getting standartized across architectures shouldn't there be
>some shared header file which contains arch-agnostic definitions, which
>could then be used by the arch-specific code?

I think this patchset should mostly just clarify the intentions, make
specifically x86's LAM 4-bit so any users that might appear in the near future
are used to this width and not the bigger one.

On across arch level I'd say right now it's about x86 preparing ground to have
some common features of address masking with other architectures that seem to
follow the 4-bit width notion.

For now I recall only MTE using 4-bit tags in cooperation with TBI but I'm not
yet sure if it has any value to take the tag width out of arch code for these
two use cases. I'm working on a KASAN series for x86 in parallel for some time
and maybe if/once that's merged it would make sense to generalize some
constants/functions.

-- 
Kind regards
Maciej Wieczór-Retman


  reply	other threads:[~2026-03-10  9:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-02 15:34 [PATCH v3 0/3] x86: Simplifying LAM Maciej Wieczor-Retman
2026-03-02 15:34 ` [PATCH v3 1/3] x86/process: Shorten the default LAM tag width Maciej Wieczor-Retman
2026-03-04 20:08   ` Dave Hansen
2026-03-05  7:40     ` Maciej Wieczor-Retman
2026-03-06 16:58   ` Nikolay Borisov
2026-03-10  9:53     ` Maciej Wieczor-Retman [this message]
2026-03-02 15:34 ` [PATCH v3 2/3] x86/mm: Cleanup comments where LAM_U48 is mentioned Maciej Wieczor-Retman
2026-03-02 15:35 ` [PATCH v3 3/3] selftests/lam: Add test cases for different LAM tag widths 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=aa_dbil5I5G2GhCe@wieczorr-mobl1.localdomain \
    --to=m.wieczorretman@pm.me \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.wieczor-retman@intel.com \
    --cc=mingo@redhat.com \
    --cc=nik.borisov@suse.com \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    /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®