mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 23:22:31 +02:00
KVM: arm64: Don't let userspace write to PMCR_EL0.N when the vcpu has EL2
Now that userspace can provide its limit for hte maximum number of counters, prevent it from writing to PMCR_EL0.N, as the value should be derived from MDCR_EL2.HPMN in that case. Reviewed-by: Oliver Upton <oliver.upton@linux.dev> Signed-off-by: Marc Zyngier <maz@kernel.org>
This commit is contained in:
parent
b7628c7973
commit
cd84a42c67
|
|
@ -1216,6 +1216,7 @@ static int set_pmcr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *r,
|
|||
* with the existing KVM behavior.
|
||||
*/
|
||||
if (!kvm_vm_has_ran_once(kvm) &&
|
||||
!vcpu_has_nv(vcpu) &&
|
||||
new_n <= kvm_arm_pmu_get_max_counters(kvm))
|
||||
kvm->arch.nr_pmu_counters = new_n;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user