target/arm/kvm: Use CPUState::kvm_state in kvm_arm_pmu_supported()
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Tue, 21 Jan 2020 11:03:43 +0000 (12:03 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 24 Jan 2020 19:59:11 +0000 (20:59 +0100)
KVMState is already accessible via CPUState::kvm_state, use it.

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200121110349.25842-5-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/arm/kvm.c

index b87b59a02ad84e583f2d208e672a0e5bf0f94ad1..8d82889150626f82dd6cc2e44c8be1e27ada1584 100644 (file)
@@ -181,9 +181,7 @@ void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu)
 
 bool kvm_arm_pmu_supported(CPUState *cpu)
 {
-    KVMState *s = KVM_STATE(current_machine->accelerator);
-
-    return kvm_check_extension(s, KVM_CAP_ARM_PMU_V3);
+    return kvm_check_extension(cpu->kvm_state, KVM_CAP_ARM_PMU_V3);
 }
 
 int kvm_arm_get_max_vm_ipa_size(MachineState *ms)