Hi Marc, On 11/13/20 6:25 PM, Marc Zyngier wrote: > It recently dawned on me that the way we handle PMU traps when the PMU > is disabled is plain wrong. We consider that handling the registers as > RAZ/WI is a fine thing to do, while the ARMv8 ARM is pretty clear that > that's not OK and that such registers should UNDEF when FEAT_PMUv3 > doesn't exist. I went all the way back to the first public version of > the spec, and it turns out we were *always* wrong. > > It probably comes from the fact that we used not to trap the ID > registers, and thus were unable to advertise the lack of PMU, but > that's hardly an excuse. So let's fix the damned thing. > > This series adds an extra check in the helpers that check for the > validity of the PMU access (most of the registers have to checked > against some enable flags and/or the accessing exception level), and > rids us of the RAZ/WI behaviour. > > This enables us to make additional cleanups, to the point where we can > remove the PMU "ready" state that always had very bizarre semantics. > All in all, a negative diffstat, and spec compliant behaviours. What's > not to like? > > I've run a few guests with and without PMUs as well as KUT, and > nothing caught fire. The patches are on top of kvmarm/queue. Everything looks fine to me. You can add my Reviewed-by tag the patches I haven't commented on separately. Thanks, Alex > > Marc Zyngier (8): > KVM: arm64: Add kvm_vcpu_has_pmu() helper > KVM: arm64: Set ID_AA64DFR0_EL1.PMUVer to 0 when no PMU support > KVM: arm64: Refuse illegal KVM_ARM_VCPU_PMU_V3 at reset time > KVM: arm64: Inject UNDEF on PMU access when no PMU configured > KVM: arm64: Remove PMU RAZ/WI handling > KVM: arm64: Remove dead PMU sysreg decoding code > KVM: arm64: Gate kvm_pmu_update_state() on the PMU feature > KVM: arm64: Get rid of the PMU ready state > > arch/arm64/include/asm/kvm_host.h | 3 ++ > arch/arm64/kvm/pmu-emul.c | 11 +++---- > arch/arm64/kvm/reset.c | 4 +++ > arch/arm64/kvm/sys_regs.c | 51 ++++++++----------------------- > include/kvm/arm_pmu.h | 3 -- > 5 files changed, 24 insertions(+), 48 deletions(-) > _______________________________________________ kvmarm mailing list kvmarm@xxxxxxxxxxxxxxxxxxxxx https://lists.cs.columbia.edu/mailman/listinfo/kvmarm