Commit dc64f3b7fa for qemu.org
commit dc64f3b7fa92b876bad9eab30a8fafc81d80332c
Author: Sebastian Ott <sebott@redhat.com>
Date: Fri Oct 30 15:34:32 2026 +0100
target/arm/cpu64: Define cpreg migration tolerance for PMMIR_EL1
PMMIR_EL1 is exposed from Linux v7.3 onwards. Backward migration
to an older kernel would fail without cpreg migration tolerance
definition for this register.
Since qemu does not set KVM_ARM_VCPU_PMU_V3_STRICT the guest will
RAZ this register for both the old and new kernel.
Signed-off-by: Sebastian Ott <sebott@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20261030143435.57230-3-sebott@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
index 2eed467f5a..159bc08b73 100644
--- a/target/arm/cpu64.c
+++ b/target/arm/cpu64.c
@@ -787,6 +787,14 @@ static void kvm_arm_set_cpreg_mig_tolerances(ARMCPU *cpu)
arm_register_cpreg_mig_tolerance(cpu, ARM64_SYS_REG(3, 0, 10, 2, 3),
0, 0, ToleranceNotOnBothEnds);
+ /*
+ * PMMIR_EL1 was unconditionally exposed for linux 7.3 with commit
+ * 453f6ff04b8d ("KVM: arm64: Expose PMMIR_EL1.SLOTS under strict
+ * PMUv3 UAPI"). Tolerate backward migration to an older kernel.
+ */
+ arm_register_cpreg_mig_tolerance(cpu, ARM64_SYS_REG(3, 0, 9, 14, 6),
+ 0, 0, ToleranceNotOnBothEnds);
+
/*
* KVM_REG_ARM_VENDOR_HYP_BMAP_2 pseudo FW register is exposed
* from v6.15 onwards. Backward migration from a >= v6.15 to an older