FAILED: patch "[PATCH] KVM: arm64: Fix MMFR0 TGRAN advertisement for pVMs" failed to apply to 6.1-stable tree
Subsystems (3)
Sasha Levin
maintainerThe patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 6c29285e78b5e4811145ebda382ac0ba732ce56a
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 6.1.y' 'HEAD^..'
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From 6c29285e78b5e4811145ebda382ac0ba732ce56a Mon Sep 17 00:00:00 2001
From: Vincent Donnefort <[email protected]>
Date: Mon, 28 Sep 2026 10:54:50 +0100
Subject: [PATCH] KVM: arm64: Fix MMFR0 TGRAN advertisement for pVMs
Protected VM ID register emulation leaves unlisted fields at 0. This creates two issues for TGRAN:
* TGRAN16: 0 means non-implemented. It prevents 16KB protected VMs from booting even when the hardware supports it.
* TGRAN4|TGRAN64: 0 means implemented. This may falsely advertise the feature even when the hardware does not support it.
Advertise all the TGRAN fields in pvmid_aa64mmfr0 so that the hardware support is properly propagated.
--- arch/arm64/kvm/hyp/nvhe/sys_regs.c | 3 +++ 1 file changed, 3 insertions(+)
arch/arm64/kvm/hyp/nvhe/sys_regs.c +3 -0
@@ -121,6 +121,9 @@ static const struct pvm_ftr_bits pvmid_aa64mmfr0[] = {MAX_FEAT (ID_AA64MMFR0_EL1 ,SNSMEM ,IMP ),MAX_FEAT (ID_AA64MMFR0_EL1 ,BIGENDEL0 ,IMP ),MAX_FEAT (ID_AA64MMFR0_EL1 ,EXS ,IMP ), +MAX_FEAT (ID_AA64MMFR0_EL1 ,TGRAN4 ,IMP ), +MAX_FEAT (ID_AA64MMFR0_EL1 ,TGRAN16 ,IMP ), +MAX_FEAT (ID_AA64MMFR0_EL1 ,TGRAN64 ,IMP ), FEAT_END };
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 KVM: arm64: Fix MMFR0 TGRAN advertisement for pVMs
From: Vincent Donnefort <[email protected]>
[ Upstream commit 6c29285e78b5e4811145ebda382ac0ba732ce56a ]
Protected VM ID register emulation leaves unlisted fields at 0. This creates two issues for TGRAN:
* TGRAN16: 0 means non-implemented. It prevents 16KB protected VMs from booting even when the hardware supports it.
* TGRAN4|TGRAN64: 0 means implemented. This may falsely advertise the feature even when the hardware does not support it.
Advertise all the TGRAN fields in pvmid_aa64mmfr0 so that the hardware support is properly propagated.
--- arch/arm64/kvm/hyp/include/nvhe/fixed_config.h | 3 ++- arch/arm64/kvm/hyp/nvhe/sys_regs.c | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-)
arch/arm64/kvm/hyp/include/nvhe/fixed_config.h +2 -1
@@ -90,7 +90,8 @@*/ #define PVM_ID_AA64MMFR0_RESTRICT_UNSIGNED (\ FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64MMFR0_EL1_PARANGE), ID_AA64MMFR0_EL1_PARANGE_40) | \ - FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64MMFR0_EL1_ASIDBITS), ID_AA64MMFR0_EL1_ASIDBITS_16) \ + FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64MMFR0_EL1_ASIDBITS), ID_AA64MMFR0_EL1_ASIDBITS_16) | \ + SYS_FIELD_PREP_ENUM(ID_AA64MMFR0_EL1, TGRAN16, IMP) \ )/*
arch/arm64/kvm/hyp/nvhe/sys_regs.c +9 -0
@@ -190,6 +190,15 @@ static u64 get_pvm_id_aa64mmfr0(const struct kvm_vcpu *vcpu) set_mask =get_restricted_features_unsigned (id_aa64mmfr0_el1_sys_val,PVM_ID_AA64MMFR0_RESTRICT_UNSIGNED ); + set_mask |=SYS_FIELD_PREP (ID_AA64MMFR0_EL1 ,TGRAN4 , +min_t (int,cpuid_feature_extract_signed_field (id_aa64mmfr0_el1_sys_val, +ID_AA64MMFR0_EL1_TGRAN4_SHIFT ), +ID_AA64MMFR0_EL1_TGRAN4_IMP )); + set_mask |=SYS_FIELD_PREP (ID_AA64MMFR0_EL1 ,TGRAN64 , +min_t (int,cpuid_feature_extract_signed_field (id_aa64mmfr0_el1_sys_val, +ID_AA64MMFR0_EL1_TGRAN64_SHIFT ), +ID_AA64MMFR0_EL1_TGRAN64_IMP )); +return (id_aa64mmfr0_el1_sys_val &PVM_ID_AA64MMFR0_ALLOW ) | set_mask; }
Signature · 1 line
2.53.0