linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Add support for NoTagAccess memory attribute
@ 2024-10-28  9:40 Aneesh Kumar K.V (Arm)
  2024-10-28  9:40 ` [PATCH 1/4] arm64: Update the values to binary from hex Aneesh Kumar K.V (Arm)
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Aneesh Kumar K.V (Arm) @ 2024-10-28  9:40 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, kvmarm
  Cc: Suzuki K Poulose, Steven Price, Will Deacon, Catalin Marinas,
	Marc Zyngier, Mark Rutland, Oliver Upton, Joey Gouly, Zenghui Yu,
	Aneesh Kumar K.V (Arm)

A VMM allows assigning different types of memory regions to the guest and not
all memory regions support storing allocation tags. Currently, the kernel
doesn't allow enabling the MTE feature in the guest if any of the assigned
memory regions don't allow MTE. This prevents the usage of MTE in the guest even
though the guest will never use these memory regions as allocation tagged
memory.

This patch series provides a way to enable MTE in such configs. Translations
from non-MTE-allowed memory regions are installed in stage-2 with NoTagAccess
memory attributes. Guest access of allocation tags with these memory regions
will result in a VM Exit.

Note: We could use the existing KVM_EXIT_MEMORY_FAULT for this. I chose to add a
new EXIT type because this is an arm64-specific exit type and I was not sure
whether KVM_EXIT_MEMORY_FAULT needs a NoTagAccess flag.


Aneesh Kumar K.V (Arm) (4):
  arm64: Update the values to binary from hex
  arm64: cpufeature: add Allocation Tag Access Permission (MTE_PERM)
    feature
  arm64: mte: update code comments
  arm64: mte: Use stage-2 NoTagAccess memory attribute if supported

 arch/arm64/include/asm/cpufeature.h  |  5 ++++
 arch/arm64/include/asm/kvm_emulate.h |  5 ++++
 arch/arm64/include/asm/kvm_pgtable.h |  1 +
 arch/arm64/include/asm/memory.h      | 14 +++++-----
 arch/arm64/kernel/cpufeature.c       |  9 +++++++
 arch/arm64/kvm/hyp/pgtable.c         | 16 ++++++++---
 arch/arm64/kvm/mmu.c                 | 40 +++++++++++++++++++---------
 arch/arm64/tools/cpucaps             |  1 +
 include/uapi/linux/kvm.h             |  7 +++++
 9 files changed, 77 insertions(+), 21 deletions(-)


base-commit: c964ced7726294d40913f2127c3f185a92cb4a41
-- 
2.43.0



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

end of thread, other threads:[~2024-11-15 16:26 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-28  9:40 [PATCH 0/4] Add support for NoTagAccess memory attribute Aneesh Kumar K.V (Arm)
2024-10-28  9:40 ` [PATCH 1/4] arm64: Update the values to binary from hex Aneesh Kumar K.V (Arm)
2024-10-28  9:40 ` [PATCH 2/4] arm64: cpufeature: add Allocation Tag Access Permission (MTE_PERM) feature Aneesh Kumar K.V (Arm)
2024-10-28  9:40 ` [PATCH 3/4] arm64: mte: update code comments Aneesh Kumar K.V (Arm)
2024-10-28 10:33   ` Marc Zyngier
2024-10-28 12:47     ` Aneesh Kumar K.V
2024-10-28 18:09       ` Marc Zyngier
2024-10-28  9:40 ` [PATCH 4/4] arm64: mte: Use stage-2 NoTagAccess memory attribute if supported Aneesh Kumar K.V (Arm)
2024-10-28 10:54   ` Marc Zyngier
2024-10-28 13:28     ` Aneesh Kumar K.V
2024-10-28 18:37       ` Marc Zyngier
2024-11-08  7:59         ` Aneesh Kumar K.V
2024-11-12 11:51           ` Marc Zyngier
2024-11-15 16:23             ` Catalin Marinas
2024-10-28 14:44   ` Oliver Upton
2024-10-28 14:52     ` Aneesh Kumar K.V
2024-10-28 15:07       ` Oliver Upton

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