linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v0 0/6] x86/AMD: Userspace address tagging
@ 2022-03-10 11:15 Bharata B Rao
  2022-03-10 11:15 ` [RFC PATCH v0 1/6] mm, arm64: Update PR_SET/GET_TAGGED_ADDR_CTRL interface Bharata B Rao
                   ` (8 more replies)
  0 siblings, 9 replies; 33+ messages in thread
From: Bharata B Rao @ 2022-03-10 11:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-mm, x86, kirill.shutemov, tglx, mingo, bp, dave.hansen,
	catalin.marinas, will, shuah, oleg, ananth.narayan,
	Bharata B Rao

Hi,

This patchset makes use of Upper Address Ignore (UAI) feature available
on upcoming AMD processors to provide user address tagging support for x86/AMD.

UAI allows software to store a tag in the upper 7 bits of a logical
address [63:57]. When enabled, the processor will suppress the
traditional canonical address checks on the addresses. More information
about UAI can be found in section 5.10 of 'AMD64 Architecture
Programmer's Manual, Vol 2: System Programming' which is available from

https://bugzilla.kernel.org/attachment.cgi?id=300549

Currently ARM64 provides a way for processes to opt-in for
relaxed tagged ABI via prctl() options PR_SET/GET_TAGGED_ADDR_CTRL.
The prctl() API was found to be a bit restrictive for x86 use and
Kirill had posted an extension to it as part of Intel LAM patchset.
(https://lore.kernel.org/linux-mm/20210205151631.43511-1-kirill.shutemov@linux.intel.com/)

This patchset builds on that prctl() extension and adds support
for AMD UAI. AMD implementation is kept separate as equivalent
Intel LAM implementation is likely to be different due to different
bit positions and tag width.

This is an early implementation which has been only lightly tested.
I have used the tags_test.c from selftests/vm/tags/ to test this.
For ARM64 changes, I have only ensured that the changes compile.

Regards,
Bharata.

Bharata B Rao (5):
  x86/cpufeatures: Add Upper Address Ignore(UAI) as CPU feature
  x86: Enable Upper Address Ignore(UAI) feature
  x86: Provide an implementation of untagged_addr()
  x86: Untag user pointers in access_ok()
  x86: Add prctl() options to control tagged user addresses ABI

Kirill A. Shutemov (1):
  mm, arm64: Update PR_SET/GET_TAGGED_ADDR_CTRL interface

 arch/arm64/include/asm/processor.h            |  12 +-
 arch/arm64/kernel/process.c                   |  45 +++++-
 arch/arm64/kernel/ptrace.c                    |   4 +-
 arch/x86/Kconfig                              |   9 ++
 arch/x86/include/asm/cpufeatures.h            |   2 +-
 arch/x86/include/asm/msr-index.h              |   2 +
 arch/x86/include/asm/page_32.h                |   3 +
 arch/x86/include/asm/page_64.h                |  26 ++++
 arch/x86/include/asm/processor.h              |  12 ++
 arch/x86/include/asm/thread_info.h            |   2 +
 arch/x86/include/asm/uaccess.h                |  29 +++-
 arch/x86/kernel/cpu/scattered.c               |   1 +
 arch/x86/kernel/process.c                     | 134 ++++++++++++++++++
 arch/x86/kernel/setup.c                       |   8 ++
 kernel/sys.c                                  |  14 +-
 .../testing/selftests/arm64/tags/tags_test.c  |  31 ----
 .../selftests/{arm64 => vm}/tags/.gitignore   |   0
 .../selftests/{arm64 => vm}/tags/Makefile     |   0
 .../{arm64 => vm}/tags/run_tags_test.sh       |   0
 tools/testing/selftests/vm/tags/tags_test.c   |  59 ++++++++
 20 files changed, 335 insertions(+), 58 deletions(-)
 delete mode 100644 tools/testing/selftests/arm64/tags/tags_test.c
 rename tools/testing/selftests/{arm64 => vm}/tags/.gitignore (100%)
 rename tools/testing/selftests/{arm64 => vm}/tags/Makefile (100%)
 rename tools/testing/selftests/{arm64 => vm}/tags/run_tags_test.sh (100%)
 create mode 100644 tools/testing/selftests/vm/tags/tags_test.c

-- 
2.25.1



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

end of thread, other threads:[~2022-04-08 17:41 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-10 11:15 [RFC PATCH v0 0/6] x86/AMD: Userspace address tagging Bharata B Rao
2022-03-10 11:15 ` [RFC PATCH v0 1/6] mm, arm64: Update PR_SET/GET_TAGGED_ADDR_CTRL interface Bharata B Rao
2022-03-10 11:15 ` [RFC PATCH v0 2/6] x86/cpufeatures: Add Upper Address Ignore(UAI) as CPU feature Bharata B Rao
2022-03-10 11:15 ` [RFC PATCH v0 3/6] x86: Enable Upper Address Ignore(UAI) feature Bharata B Rao
2022-03-10 19:46   ` Andrew Cooper
2022-03-10 22:37     ` David Laight
2022-03-10 22:46       ` Dave Hansen
2022-03-11 12:37   ` Boris Petkov
2022-03-10 11:15 ` [RFC PATCH v0 4/6] x86: Provide an implementation of untagged_addr() Bharata B Rao
2022-03-10 11:15 ` [RFC PATCH v0 5/6] x86: Untag user pointers in access_ok() Bharata B Rao
2022-03-10 11:15 ` [RFC PATCH v0 6/6] x86: Add prctl() options to control tagged user addresses ABI Bharata B Rao
2022-03-10 14:32 ` [RFC PATCH v0 0/6] x86/AMD: Userspace address tagging David Laight
2022-03-10 16:45   ` Dave Hansen
2022-03-10 17:19     ` David Laight
2022-03-11  5:42       ` Bharata B Rao
2022-03-11  8:15         ` David Laight
2022-03-11  9:11           ` Bharata B Rao
2022-03-11  9:36             ` David Laight
2022-03-11 16:51               ` Dave Hansen
2022-03-10 15:16 ` Dave Hansen
2022-03-10 15:22   ` Dave Hansen
2022-03-14  5:00   ` Bharata B Rao
2022-03-14  7:03     ` Dave Hansen
2022-03-21 22:29 ` Andy Lutomirski
2022-03-21 22:59   ` Thomas Gleixner
2022-03-22  5:31   ` David Laight
2022-03-23  7:48   ` Bharata B Rao
2022-04-01 19:25     ` Dave Hansen
2022-04-05  5:58       ` Bharata B Rao
2022-04-01 19:41     ` Andy Lutomirski
2022-04-05  8:14     ` Peter Zijlstra
2022-04-05  8:40       ` Bharata B Rao
2022-04-08 17:41   ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).