Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Minhang Zhang <sesame_h@qq.com>
To: Marc Zyngier <maz@kernel.org>, Oliver Upton <oupton@kernel.org>
Cc: Fuad Tabba <fuad.tabba@linux.dev>,
	Joey Gouly <joey.gouly@arm.com>,
	Steffen Eiden <seiden@linux.ibm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Cornelia Huck <cohuck@redhat.com>,
	Christoffer Dall <christoffer.dall@linaro.org>,
	Dongjiu Geng <gengdongjiu@huawei.com>,
	James Morse <james.morse@arm.com>,
	Ben Horgan <ben.horgan@arm.com>,
	linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
	Minhang Zhang <zhangminhang@kylinos.cn>
Subject: [PATCH 0/2] KVM: arm64: Fix RAS trapping and MTE_frac validation
Date: Fri,  4 Dec 2026 17:12:23 +0800	[thread overview]
Message-ID: <tencent_7F4786FE41389F6D2DF278CF72951B9CD209@qq.com> (raw)

From: Minhang Zhang <zhangminhang@kylinos.cn>

This series fixes two independent issues in arm64 KVM.

Patch 1 enables trapping of RAS error record accesses whenever the host's
sanitised ID registers report RAS, including when CONFIG_ARM64_RAS_EXTN
is disabled. Update both the host and hyp HCR initialisation paths so
that this also applies in protected mode, where hyp rebuilds HCR_EL2.
This keeps guest accesses under KVM's emulation, including when userspace
hides RAS from the guest.

Patch 2 uses KVM's sanitised MTE field to decide whether to apply the
MTE_frac compatibility rewrite. This avoids changing the zero MTE_frac
reported for VMs where MTE is hidden, including nested virtualisation,
while preserving compatibility with older KVM versions for MTE guests.

The patches are independent.

Build-checked arch/arm64/kvm/sys_regs.o and the nVHE aggregate object
arch/arm64/kvm/hyp/nvhe/kvm_nvhe.o with arm64 defconfig, CONFIG_KVM=y,
and CONFIG_ARM64_RAS_EXTN both enabled and disabled, based on v7.4-rc5
(fe6ff8d5d675). No KVM runtime testing or hardware reproduction was
performed for either issue.

Minhang Zhang (2):
  KVM: arm64: Trap RAS error records whenever the host has RAS
  KVM: arm64: Only clamp MTE_frac when the VM has MTE

 arch/arm64/kvm/hyp/nvhe/pkvm.c |  8 +++++---
 arch/arm64/kvm/sys_regs.c      | 17 +++++++++++++----
 2 files changed, 18 insertions(+), 7 deletions(-)

-- 
2.25.1



                 reply	other threads:[~2026-12-04  9:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=tencent_7F4786FE41389F6D2DF278CF72951B9CD209@qq.com \
    --to=sesame_h@qq.com \
    --cc=ben.horgan@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=christoffer.dall@linaro.org \
    --cc=cohuck@redhat.com \
    --cc=fuad.tabba@linux.dev \
    --cc=gengdongjiu@huawei.com \
    --cc=james.morse@arm.com \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=seiden@linux.ibm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.com \
    --cc=zhangminhang@kylinos.cn \
    /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