• Marc Zyngier's avatar
    KVM: arm64: Reset the PMU in preemptible context · ebff0b0e
    Marc Zyngier authored
    We've become very cautious to now always reset the vcpu when nothing
    is loaded on the physical CPU. To do so, we now disable preemption
    and do a kvm_arch_vcpu_put() to make sure we have all the state
    in memory (and that it won't be loaded behind out back).
    
    This now causes issues with resetting the PMU, which calls into perf.
    Perf itself uses mutexes, which clashes with the lack of preemption.
    It is worth realizing that the PMU is fully emulated, and that
    no PMU state is ever loaded on the physical CPU. This means we can
    perfectly reset the PMU outside of the non-preemptible section.
    
    Fixes: e761a927 ("KVM: arm/arm64: Reset the VCPU without preemption and vcpu state loaded")
    Reported-by: default avatarJulien Grall <julien.grall@arm.com>
    Tested-by: default avatarJulien Grall <julien.grall@arm.com>
    Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
    ebff0b0e
reset.c 7.69 KB