Skip to content

KVM: arm64: Fix RAS trapping and MTE_frac validation

Minhang Zhang kvmarm linux-arm-kernel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 2 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 2 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] KVM: arm64: Fix RAS trapping and MTE_frac validation

From: Minhang Zhang <[email protected]>

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(-)
Signature · 1 line
2.25.1