]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
target/ppc: Fix timer register accessors when !KVM
authorCédric Le Goater <clg@kaod.org>
Tue, 20 Jun 2023 05:59:11 +0000 (07:59 +0200)
committerCédric Le Goater <clg@kaod.org>
Sun, 25 Jun 2023 20:41:30 +0000 (22:41 +0200)
When the Timer Control and Timer Status registers are modified, avoid
calling the KVM backend when not available

Signed-off-by: Cédric Le Goater <clg@kaod.org>
target/ppc/kvm.c

index a7f2de9d10187613e50b7717e804419e246c59c1..a8a935e26726d3161b607c62956ee569e623be14 100644 (file)
@@ -1728,6 +1728,10 @@ int kvmppc_or_tsr_bits(PowerPCCPU *cpu, uint32_t tsr_bits)
         .addr = (uintptr_t) &bits,
     };
 
+    if (!kvm_enabled()) {
+        return 0;
+    }
+
     return kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
 }
 
@@ -1741,6 +1745,10 @@ int kvmppc_clear_tsr_bits(PowerPCCPU *cpu, uint32_t tsr_bits)
         .addr = (uintptr_t) &bits,
     };
 
+    if (!kvm_enabled()) {
+        return 0;
+    }
+
     return kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
 }
 
@@ -1755,6 +1763,10 @@ int kvmppc_set_tcr(PowerPCCPU *cpu)
         .addr = (uintptr_t) &tcr,
     };
 
+    if (!kvm_enabled()) {
+        return 0;
+    }
+
     return kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
 }