linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/29] arm64: Permission Overlay Extension
@ 2024-05-03 13:01 Joey Gouly
  2024-05-03 13:01 ` [PATCH v4 01/29] powerpc/mm: add ARCH_PKEY_BITS to Kconfig Joey Gouly
                   ` (30 more replies)
  0 siblings, 31 replies; 146+ messages in thread
From: Joey Gouly @ 2024-05-03 13:01 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: akpm, aneesh.kumar, aneesh.kumar, bp, broonie, catalin.marinas,
	christophe.leroy, dave.hansen, hpa, joey.gouly, linux-fsdevel,
	linux-mm, linuxppc-dev, maz, mingo, mpe, naveen.n.rao, npiggin,
	oliver.upton, shuah, szabolcs.nagy, tglx, will, x86, kvmarm

Hi all,

This series implements the Permission Overlay Extension introduced in 2022
VMSA enhancements [1]. It is based on v6.9-rc5.

One possible issue with this version, I took the last bit of HWCAP2.

Changes since v3[2]:
	- Moved Kconfig to nearer the end of the series
	- Reworked MMU Fault path, to check for POE faults earlier, under the mm lock
	- Rework VM_FLAGS to use Kconfig option
	- Don't check POR_EL0 in MTE sync tags function
	- Reworked KVM to fit into VNCR/VM configuration changes
	- Use new AT instruction in KVM
	- Rebase onto v6.9-rc5

The Permission Overlay Extension allows to constrain permissions on memory
regions. This can be used from userspace (EL0) without a system call or TLB
invalidation.

POE is used to implement the Memory Protection Keys [3] Linux syscall.

The first few patches add the basic framework, then the PKEYS interface is
implemented, and then the selftests are made to work on arm64.

I have tested the modified protection_keys test on x86_64, but not PPC.
I haven't build tested the x86/ppc arch changes.

Thanks,
Joey

Joey Gouly (29):
  powerpc/mm: add ARCH_PKEY_BITS to Kconfig
  x86/mm: add ARCH_PKEY_BITS to Kconfig
  mm: use ARCH_PKEY_BITS to define VM_PKEY_BITN
  arm64: disable trapping of POR_EL0 to EL2
  arm64: cpufeature: add Permission Overlay Extension cpucap
  arm64: context switch POR_EL0 register
  KVM: arm64: Save/restore POE registers
  KVM: arm64: make kvm_at() take an OP_AT_*
  KVM: arm64: use `at s1e1a` for POE
  arm64: enable the Permission Overlay Extension for EL0
  arm64: re-order MTE VM_ flags
  arm64: add POIndex defines
  arm64: convert protection key into vm_flags and pgprot values
  arm64: mask out POIndex when modifying a PTE
  arm64: handle PKEY/POE faults
  arm64: add pte_access_permitted_no_overlay()
  arm64: implement PKEYS support
  arm64: add POE signal support
  arm64: enable PKEY support for CPUs with S1POE
  arm64: enable POE and PIE to coexist
  arm64/ptrace: add support for FEAT_POE
  arm64: add Permission Overlay Extension Kconfig
  kselftest/arm64: move get_header()
  selftests: mm: move fpregs printing
  selftests: mm: make protection_keys test work on arm64
  kselftest/arm64: add HWCAP test for FEAT_S1POE
  kselftest/arm64: parse POE_MAGIC in a signal frame
  kselftest/arm64: Add test case for POR_EL0 signal frame records
  KVM: selftests: get-reg-list: add Permission Overlay registers

 Documentation/arch/arm64/elf_hwcaps.rst       |   2 +
 arch/arm64/Kconfig                            |  22 +++
 arch/arm64/include/asm/cpufeature.h           |   6 +
 arch/arm64/include/asm/el2_setup.h            |  10 +-
 arch/arm64/include/asm/hwcap.h                |   1 +
 arch/arm64/include/asm/kvm_asm.h              |   3 +-
 arch/arm64/include/asm/kvm_host.h             |   4 +
 arch/arm64/include/asm/mman.h                 |   8 +-
 arch/arm64/include/asm/mmu.h                  |   1 +
 arch/arm64/include/asm/mmu_context.h          |  51 ++++++-
 arch/arm64/include/asm/pgtable-hwdef.h        |  10 ++
 arch/arm64/include/asm/pgtable-prot.h         |   8 +-
 arch/arm64/include/asm/pgtable.h              |  34 ++++-
 arch/arm64/include/asm/pkeys.h                | 110 ++++++++++++++
 arch/arm64/include/asm/por.h                  |  33 +++++
 arch/arm64/include/asm/processor.h            |   1 +
 arch/arm64/include/asm/sysreg.h               |   3 +
 arch/arm64/include/asm/traps.h                |   1 +
 arch/arm64/include/asm/vncr_mapping.h         |   1 +
 arch/arm64/include/uapi/asm/hwcap.h           |   1 +
 arch/arm64/include/uapi/asm/sigcontext.h      |   7 +
 arch/arm64/kernel/cpufeature.c                |  23 +++
 arch/arm64/kernel/cpuinfo.c                   |   1 +
 arch/arm64/kernel/process.c                   |  28 ++++
 arch/arm64/kernel/ptrace.c                    |  46 ++++++
 arch/arm64/kernel/signal.c                    |  52 +++++++
 arch/arm64/kernel/traps.c                     |  12 +-
 arch/arm64/kvm/hyp/include/hyp/fault.h        |   5 +-
 arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h    |  29 ++++
 arch/arm64/kvm/sys_regs.c                     |   8 +-
 arch/arm64/mm/fault.c                         |  56 ++++++-
 arch/arm64/mm/mmap.c                          |   9 ++
 arch/arm64/mm/mmu.c                           |  40 +++++
 arch/arm64/tools/cpucaps                      |   1 +
 arch/powerpc/Kconfig                          |   4 +
 arch/x86/Kconfig                              |   4 +
 fs/proc/task_mmu.c                            |   2 +
 include/linux/mm.h                            |  20 ++-
 include/uapi/linux/elf.h                      |   1 +
 tools/testing/selftests/arm64/abi/hwcap.c     |  14 ++
 .../testing/selftests/arm64/signal/.gitignore |   1 +
 .../arm64/signal/testcases/poe_siginfo.c      |  86 +++++++++++
 .../arm64/signal/testcases/testcases.c        |  27 +---
 .../arm64/signal/testcases/testcases.h        |  28 +++-
 .../selftests/kvm/aarch64/get-reg-list.c      |  14 ++
 tools/testing/selftests/mm/Makefile           |   2 +-
 tools/testing/selftests/mm/pkey-arm64.h       | 139 ++++++++++++++++++
 tools/testing/selftests/mm/pkey-helpers.h     |   8 +
 tools/testing/selftests/mm/pkey-powerpc.h     |   3 +
 tools/testing/selftests/mm/pkey-x86.h         |   4 +
 tools/testing/selftests/mm/protection_keys.c  | 109 ++++++++++++--
 51 files changed, 1027 insertions(+), 66 deletions(-)
 create mode 100644 arch/arm64/include/asm/pkeys.h
 create mode 100644 arch/arm64/include/asm/por.h
 create mode 100644 tools/testing/selftests/arm64/signal/testcases/poe_siginfo.c
 create mode 100644 tools/testing/selftests/mm/pkey-arm64.h

-- 
2.25.1


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

end of thread, other threads:[~2024-08-20 14:45 UTC | newest]

Thread overview: 146+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-03 13:01 [PATCH v4 00/29] arm64: Permission Overlay Extension Joey Gouly
2024-05-03 13:01 ` [PATCH v4 01/29] powerpc/mm: add ARCH_PKEY_BITS to Kconfig Joey Gouly
2024-05-06  8:57   ` Michael Ellerman
2024-05-03 13:01 ` [PATCH v4 02/29] x86/mm: " Joey Gouly
2024-05-03 16:40   ` Dave Hansen
2024-05-03 13:01 ` [PATCH v4 03/29] mm: use ARCH_PKEY_BITS to define VM_PKEY_BITN Joey Gouly
2024-05-03 16:41   ` Dave Hansen
2024-07-15  7:53   ` Anshuman Khandual
2024-05-03 13:01 ` [PATCH v4 04/29] arm64: disable trapping of POR_EL0 to EL2 Joey Gouly
2024-07-15  7:47   ` Anshuman Khandual
2024-07-25 15:44   ` Dave Martin
2024-08-06 10:04     ` Joey Gouly
2024-05-03 13:01 ` [PATCH v4 05/29] arm64: cpufeature: add Permission Overlay Extension cpucap Joey Gouly
2024-06-21 16:58   ` Catalin Marinas
2024-06-21 17:01   ` Catalin Marinas
2024-06-21 17:02     ` Catalin Marinas
2024-07-15  7:47   ` Anshuman Khandual
2024-05-03 13:01 ` [PATCH v4 06/29] arm64: context switch POR_EL0 register Joey Gouly
2024-06-21 17:03   ` Catalin Marinas
2024-06-21 17:07   ` Catalin Marinas
2024-07-15  8:27   ` Anshuman Khandual
2024-07-16 13:21     ` Mark Brown
2024-07-18 14:16     ` Joey Gouly
2024-07-22 13:40   ` Kevin Brodsky
2024-07-25 15:46   ` Dave Martin
2024-05-03 13:01 ` [PATCH v4 07/29] KVM: arm64: Save/restore POE registers Joey Gouly
2024-05-29 15:43   ` Marc Zyngier
2024-08-16 14:55   ` Marc Zyngier
2024-08-16 15:13     ` Joey Gouly
2024-08-16 15:32       ` Marc Zyngier
2024-05-03 13:01 ` [PATCH v4 08/29] KVM: arm64: make kvm_at() take an OP_AT_* Joey Gouly
2024-05-29 15:46   ` Marc Zyngier
2024-07-15  8:36   ` Anshuman Khandual
2024-05-03 13:01 ` [PATCH v4 09/29] KVM: arm64: use `at s1e1a` for POE Joey Gouly
2024-05-29 15:50   ` Marc Zyngier
2024-07-15  8:45   ` Anshuman Khandual
2024-05-03 13:01 ` [PATCH v4 10/29] arm64: enable the Permission Overlay Extension for EL0 Joey Gouly
2024-06-21 17:04   ` Catalin Marinas
2024-07-15  9:13   ` Anshuman Khandual
2024-07-15 20:16   ` Mark Brown
2024-07-25 15:49   ` Dave Martin
2024-08-01 16:04     ` Joey Gouly
2024-08-01 16:31       ` Dave Martin
2024-05-03 13:01 ` [PATCH v4 11/29] arm64: re-order MTE VM_ flags Joey Gouly
2024-06-21 17:04   ` Catalin Marinas
2024-07-15  9:21   ` Anshuman Khandual
2024-05-03 13:01 ` [PATCH v4 12/29] arm64: add POIndex defines Joey Gouly
2024-06-21 17:05   ` Catalin Marinas
2024-07-15  9:26   ` Anshuman Khandual
2024-05-03 13:01 ` [PATCH v4 13/29] arm64: convert protection key into vm_flags and pgprot values Joey Gouly
2024-05-28  6:54   ` Amit Daniel Kachhap
2024-06-19 16:45     ` Catalin Marinas
2024-07-04 12:47       ` Joey Gouly
2024-07-08 17:22         ` Catalin Marinas
2024-07-16  9:05   ` Anshuman Khandual
2024-07-16  9:34     ` Joey Gouly
2024-07-25 15:49   ` Dave Martin
2024-08-01 10:55     ` Joey Gouly
2024-08-01 11:01       ` Dave Martin
2024-05-03 13:01 ` [PATCH v4 14/29] arm64: mask out POIndex when modifying a PTE Joey Gouly
2024-07-16  9:10   ` Anshuman Khandual
2024-05-03 13:01 ` [PATCH v4 15/29] arm64: handle PKEY/POE faults Joey Gouly
2024-06-21 16:57   ` Catalin Marinas
2024-07-09 13:03   ` Kevin Brodsky
2024-07-16 10:13   ` Anshuman Khandual
2024-07-25 15:57   ` Dave Martin
2024-08-01 16:01     ` Joey Gouly
2024-08-06 13:33       ` Dave Martin
2024-08-06 13:43         ` Joey Gouly
2024-08-06 14:38           ` Dave Martin
2024-05-03 13:01 ` [PATCH v4 16/29] arm64: add pte_access_permitted_no_overlay() Joey Gouly
2024-06-21 17:15   ` Catalin Marinas
2024-07-16 10:21   ` Anshuman Khandual
2024-05-03 13:01 ` [PATCH v4 17/29] arm64: implement PKEYS support Joey Gouly
2024-05-28  6:55   ` Amit Daniel Kachhap
2024-05-28 11:26     ` Joey Gouly
2024-05-31 14:57   ` Szabolcs Nagy
2024-05-31 15:21     ` Joey Gouly
2024-05-31 16:27       ` Szabolcs Nagy
2024-06-17 13:40         ` Florian Weimer
2024-06-17 14:51           ` Szabolcs Nagy
2024-07-08 17:53             ` Catalin Marinas
2024-07-09  8:32               ` Szabolcs Nagy
2024-07-09  8:52                 ` Florian Weimer
2024-07-11  9:50               ` Joey Gouly
2024-07-18 14:45                 ` Szabolcs Nagy
2024-07-05 16:59   ` Catalin Marinas
2024-07-22 13:39     ` Kevin Brodsky
2024-07-09 13:07   ` Kevin Brodsky
2024-07-16 11:40     ` Anshuman Khandual
2024-07-23  4:22   ` Anshuman Khandual
2024-07-25 16:12   ` Dave Martin
2024-05-03 13:01 ` [PATCH v4 18/29] arm64: add POE signal support Joey Gouly
2024-05-28  6:56   ` Amit Daniel Kachhap
2024-05-31 16:39     ` Mark Brown
2024-06-03  9:21       ` Amit Daniel Kachhap
2024-07-25 15:58         ` Dave Martin
2024-07-25 18:11           ` Mark Brown
2024-07-26 16:14             ` Dave Martin
2024-07-26 17:39               ` Mark Brown
2024-07-29 14:27                 ` Dave Martin
2024-07-29 14:41                   ` Mark Brown
2024-07-05 17:04   ` Catalin Marinas
2024-07-09 13:08   ` Kevin Brodsky
2024-07-22  9:16   ` Anshuman Khandual
2024-07-25 16:00   ` Dave Martin
2024-08-01 15:54     ` Joey Gouly
2024-08-01 16:22       ` Dave Martin
2024-08-06 10:35         ` Joey Gouly
2024-08-06 14:31           ` Joey Gouly
2024-08-06 15:00             ` Dave Martin
2024-08-14 15:03             ` Catalin Marinas
2024-08-15 13:18               ` Joey Gouly
2024-08-15 15:09                 ` Dave Martin
2024-08-15 15:24                   ` Mark Brown
2024-08-19 17:09                   ` Catalin Marinas
2024-08-20  9:54                     ` Joey Gouly
2024-08-20 13:54                       ` Dave Martin
2024-08-20 14:06                         ` Joey Gouly
2024-08-20 14:45                           ` Dave Martin
2024-05-03 13:01 ` [PATCH v4 19/29] arm64: enable PKEY support for CPUs with S1POE Joey Gouly
2024-07-16 10:47   ` Anshuman Khandual
2024-07-25 15:48     ` Dave Martin
2024-07-25 16:00   ` Dave Martin
2024-05-03 13:01 ` [PATCH v4 20/29] arm64: enable POE and PIE to coexist Joey Gouly
2024-06-21 17:16   ` Catalin Marinas
2024-07-16 10:41   ` Anshuman Khandual
2024-07-16 13:46     ` Joey Gouly
2024-05-03 13:01 ` [PATCH v4 21/29] arm64/ptrace: add support for FEAT_POE Joey Gouly
2024-07-16 10:35   ` Anshuman Khandual
2024-05-03 13:01 ` [PATCH v4 22/29] arm64: add Permission Overlay Extension Kconfig Joey Gouly
2024-07-05 17:05   ` Catalin Marinas
2024-07-09 13:08   ` Kevin Brodsky
2024-07-16 11:02   ` Anshuman Khandual
2024-05-03 13:01 ` [PATCH v4 23/29] kselftest/arm64: move get_header() Joey Gouly
2024-05-03 13:01 ` [PATCH v4 24/29] selftests: mm: move fpregs printing Joey Gouly
2024-05-03 13:01 ` [PATCH v4 25/29] selftests: mm: make protection_keys test work on arm64 Joey Gouly
2024-05-03 13:01 ` [PATCH v4 26/29] kselftest/arm64: add HWCAP test for FEAT_S1POE Joey Gouly
2024-05-03 13:01 ` [PATCH v4 27/29] kselftest/arm64: parse POE_MAGIC in a signal frame Joey Gouly
2024-05-03 13:01 ` [PATCH v4 28/29] kselftest/arm64: Add test case for POR_EL0 signal frame records Joey Gouly
2024-05-29 15:51   ` Mark Brown
2024-07-05 19:34     ` Shuah Khan
2024-07-09 13:10   ` Kevin Brodsky
2024-05-03 13:01 ` [PATCH v4 29/29] KVM: selftests: get-reg-list: add Permission Overlay registers Joey Gouly
2024-05-05 14:41 ` [PATCH v4 00/29] arm64: Permission Overlay Extension Mark Brown
2024-05-28 11:30 ` Joey Gouly

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).