From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-10629.protonmail.ch (mail-10629.protonmail.ch [79.135.106.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29E3A429823 for ; Tue, 10 Mar 2026 09:53:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.135.106.29 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773136424; cv=none; b=pdO7Bn4oQSczJdFPz7gI4pW6yUqWBFGYzM0d3cgOTsqkqJT3hdnuFgznwG/gSKO7r76GHRpBtEAJDj+uTeMzhXtUvnmfpCHzq25Tb62F1GrWBTya+IQGy4sklU2Xwm2wZ8Wc2vYP/UuOlU0Sey3h3hbd4mF9t5azITuGmOJ/hQI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773136424; c=relaxed/simple; bh=B9mEC7p83UcVdp0WQ7zSJrI1dgZbm+HYr88jdRyudX4=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VOELoaPuora+nq1Zpa51UIB5j/YAVKwW2sq8MoUT2+rwtSY3spOiMa0TTzcpg/8pnCxUm6fB0Y0lYnCN+fqSBoeity7XkamaIBXdogAdXjoj8YmCLJunSTh48JpSi4aASjVz3QtajqFOBq8k4gED1GonjmBoT9HzrWw3tatMbcg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pm.me; spf=pass smtp.mailfrom=pm.me; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b=iDKrW3jd; arc=none smtp.client-ip=79.135.106.29 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pm.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pm.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b="iDKrW3jd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1773136411; x=1773395611; bh=6X/O9Mh8OQo5CgJMNkty8SxaoF13/8ljU1JsgFPJKtI=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=iDKrW3jdRyyo3zJjww+yeR1xMhO6CLXkjcyCRzAbEmpIIMuAWrbM57jp3dNGP45fh GdFzmp7uEYRIk7Rx/WyU+7SpyMKxFYpBxAth5hPL2L7NT2UIk8Pg/GPHqPu2Qw2Srr img7eoQMbTyo+1gf/v8g+NNJvwxYs5EB2SYGGh5zIVLHktk/m0ufzZCzMIx+dMAPDi nRdypvEijrGp6bKRrwdOR6yf8A8U9Uif7egMwwqXtXkMe/kGa/TGHvjgH577OTrDHJ DQ3Wv9+iTyncPjBmykRGf2SP2gbyU8hwdP1PX4rHJ3214tOFTcMq6qYqOKjOrdKV2I Uojcdo1BS6eng== Date: Tue, 10 Mar 2026 09:53:25 +0000 To: Nikolay Borisov From: Maciej Wieczor-Retman Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Maciej Wieczor-Retman , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/3] x86/process: Shorten the default LAM tag width Message-ID: In-Reply-To: References: <324da30e8b32576b9a05b3969f6d6a49a4153ba2.1772465456.git.m.wieczorretman@pm.me> Feedback-ID: 164464600:user:proton X-Pm-Message-ID: 96c0ba9804801eb80f0bdac2488c88b394bb98c1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2026-03-06 at 18:58:31 +0200, Nikolay Borisov wrote: > > >On 2.03.26 =D0=B3. 17:34 =D1=87., Maciej Wieczor-Retman wrote: >> From: Maciej Wieczor-Retman >> >> 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 >> --- >> 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=094 > >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 fut= ure 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 h= ave 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 the= se two use cases. I'm working on a KASAN series for x86 in parallel for some t= ime and maybe if/once that's merged it would make sense to generalize some constants/functions. --=20 Kind regards Maciej Wiecz=C3=B3r-Retman