diff options
author | Marc Zyngier <maz@kernel.org> | 2021-01-06 20:22:28 +0300 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2021-01-14 14:02:52 +0300 |
commit | 7ded92e25cac9758a755b8f524b11b509c49afe1 (patch) | |
tree | 0d6408b4c3ca594e1c9fc21337c12ce4347709cd /arch | |
parent | 11663111cd49b4c6dd27479774e420f139e4c447 (diff) | |
download | linux-7ded92e25cac9758a755b8f524b11b509c49afe1.tar.xz |
KVM: arm64: Simplify handling of absent PMU system registers
Now that all PMU registers are gated behind a .visibility callback,
remove the other checks against an absent PMU.
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm64/kvm/sys_regs.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index 45f4ae71c8dc..93f0a4a0789a 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -622,9 +622,8 @@ static void reset_pmcr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) static bool check_pmu_access_disabled(struct kvm_vcpu *vcpu, u64 flags) { u64 reg = __vcpu_sys_reg(vcpu, PMUSERENR_EL0); - bool enabled = kvm_vcpu_has_pmu(vcpu); + bool enabled = (reg & flags) || vcpu_mode_priv(vcpu); - enabled &= (reg & flags) || vcpu_mode_priv(vcpu); if (!enabled) kvm_inject_undefined(vcpu); @@ -909,11 +908,6 @@ static bool access_pmswinc(struct kvm_vcpu *vcpu, struct sys_reg_params *p, static bool access_pmuserenr(struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) { - if (!kvm_vcpu_has_pmu(vcpu)) { - kvm_inject_undefined(vcpu); - return false; - } - if (p->is_write) { if (!vcpu_mode_priv(vcpu)) { kvm_inject_undefined(vcpu); |