Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org
Cc: Steffen Eiden <seiden@linux.ibm.com>,
	Joey Gouly <joey.gouly@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Oliver Upton <oupton@kernel.org>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Fuad Tabba <fuad.tabba@linux.dev>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>
Subject: [PATCH 0/2] KVM: arm64: Reenable MTE on VHE guest exit
Date: Mon, 26 Oct 2026 08:23:03 +0000	[thread overview]
Message-ID: <20261026082305.2515705-1-maz@kernel.org> (raw)

Upton taking an exception, the CPU sets PSTATE.TCO to ensure that no
tag fault can be taken while handling the exception. It is SW's job to
eventually clear it when it is safe to do so.

It appears that when MTE is enabled and that the kernel is running
VHE, nothing eventually clears TCO when we come back from the guest,
so things such as KASAN_HW_TAGS will not work until the next exit to
userspace.

This series aims at fixing this. This is not a stable candidate, as
KASAN is only a debug option.

Marc Zyngier (2):
  arm64: Add return value to mte_disable_tco_entry()
  KVM: arm64: Reenable MTE tag checking on exit from guest when running
    VHE

 arch/arm64/include/asm/mte.h    | 10 +++++++---
 arch/arm64/kvm/hyp/vhe/switch.c |  7 +++++++
 2 files changed, 14 insertions(+), 3 deletions(-)

-- 
2.47.3



             reply	other threads:[~2026-10-26  8:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26  8:23 Marc Zyngier [this message]
2026-10-26  8:23 ` [PATCH 1/2] arm64: Add return value to mte_disable_tco_entry() Marc Zyngier
2026-10-26  8:23 ` [PATCH 2/2] KVM: arm64: Reenable MTE tag checking on exit from guest when running VHE Marc Zyngier
2026-10-26 14:06 ` [PATCH 0/2] KVM: arm64: Reenable MTE on VHE guest exit Fuad Tabba

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=20261026082305.2515705-1-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=fuad.tabba@linux.dev \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=oupton@kernel.org \
    --cc=seiden@linux.ibm.com \
    --cc=suzuki.poulose@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