KVM: arm64: Limit the debug architecture to ARMv8.0
authorMarc Zyngier <maz@kernel.org>
Sun, 16 Feb 2020 17:44:29 +0000 (17:44 +0000)
committerMarc Zyngier <maz@kernel.org>
Wed, 3 Feb 2021 11:00:08 +0000 (11:00 +0000)
Let's not pretend we support anything but ARMv8.0 as far as the
debug architecture is concerned.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/sys_regs.c

index dda16d60197b81b5afba61be84f3cdbf845cbd74..8f79ec1fffa7eb8aaf06b3d0921a183dd6616f2a 100644 (file)
@@ -1048,6 +1048,9 @@ static u64 read_id_reg(const struct kvm_vcpu *vcpu,
                                 FEATURE(ID_AA64ISAR1_GPI));
                break;
        case SYS_ID_AA64DFR0_EL1:
+               /* Limit debug to ARMv8.0 */
+               val &= ~FEATURE(ID_AA64DFR0_DEBUGVER);
+               val |= FIELD_PREP(FEATURE(ID_AA64DFR0_DEBUGVER), 6);
                /* Limit guests to PMUv3 for ARMv8.1 */
                val = cpuid_feature_cap_perfmon_field(val,
                                                      ID_AA64DFR0_PMUVER_SHIFT,