public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/3] x86: Simplifying LAM
@ 2026-04-07 17:45 Maciej Wieczor-Retman
  2026-04-07 17:45 ` [PATCH v5 1/3] x86/process: Shorten the default LAM tag width Maciej Wieczor-Retman
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Maciej Wieczor-Retman @ 2026-04-07 17:45 UTC (permalink / raw)
  To: houwenlong.hwl, dave.hansen, ryan.roberts, nick.desaulniers+lkml,
	bp, will, maciej.wieczor-retman, david, nathan, justinstitt,
	seanjc, perry.yuan, oleg, tglx, hpa, james.morse, mingo, akpm,
	jgross, peterz, morbo, ilpo.jarvinen, xin, shuah
  Cc: x86, linux-kselftest, linux-kernel, llvm, m.wieczorretman

After ChkTag [1] announcement, 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 shorten lam to
4 bits as ChkTag will likely be the main user of the interface and such
connection should simplify things in the future.

If a usecase arises in the future, the 6-bit tags can be made available
as a debug feature and possible to enable through debugfs.

Changing the tag width has no effect on userspace programs. Due to LAM
being disabled until LASS is fully supported in the kernel there are yet
no userspace projects relying on a specific LAM tag width. One known
exception is the clang compiler and its hwasan support. It is however
not a problem since there are both no users of hwasan on x86 yet and
upon closer inspection (when working on x86 KASAN software tag-based
mode) I found it's not working correctly and needs to be patched.

The patchset also cleans up some comments referencing LAM_U48 which was
not implemented in the kernel and the comments shouldn't imply it can be
enabled.

Patches are based on v7.0-rc7

Changelog v5:
- Rebase onto v7.0-rc7.

Changelog v4:
- Remove the 'default' wording from the cover letter and patch messages.
- Add a paragraph to the cover letter about userspace impact.

Changelog v3:
- Remove the debugfs part and update the rest of the code and patch
  messages accordingly.

Changelog v2:
- Extend a char buffer in debugfs read callback to fit the format
  string.

[1] https://community.intel.com/t5/Blogs/Tech-Innovation/open-intel/ChkTag-x86-Memory-Safety/post/1721490

Maciej Wieczor-Retman (3):
  x86/process: Shorten the default LAM tag width
  x86/mm: Cleanup comments where LAM_U48 is mentioned
  selftests/lam: Add test cases for different LAM tag widths

 arch/x86/include/asm/mmu.h        |  2 +-
 arch/x86/include/asm/tlbflush.h   |  2 +-
 arch/x86/kernel/process_64.c      |  8 +--
 tools/testing/selftests/x86/lam.c | 86 +++++++++++++++----------------
 4 files changed, 49 insertions(+), 49 deletions(-)

-- 
2.53.0



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-04-08 10:19 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox