linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V (Arm)" <aneesh.kumar@kernel.org>
To: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev
Cc: Suzuki K Poulose <Suzuki.Poulose@arm.com>,
	Steven Price <steven.price@arm.com>,
	Will Deacon <will@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Oliver Upton <oliver.upton@linux.dev>,
	Joey Gouly <joey.gouly@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	"Aneesh Kumar K.V (Arm)" <aneesh.kumar@kernel.org>
Subject: [PATCH 0/4] Add support for NoTagAccess memory attribute
Date: Mon, 28 Oct 2024 15:10:10 +0530	[thread overview]
Message-ID: <20241028094014.2596619-1-aneesh.kumar@kernel.org> (raw)

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



             reply	other threads:[~2024-10-28  9:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-28  9:40 Aneesh Kumar K.V (Arm) [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241028094014.2596619-1-aneesh.kumar@kernel.org \
    --to=aneesh.kumar@kernel.org \
    --cc=Suzuki.Poulose@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=steven.price@arm.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).