diff options
author | Cédric Le Goater <clg@kaod.org> | 2023-06-20 07:59:11 +0200 |
---|---|---|
committer | Cédric Le Goater <clg@kaod.org> | 2023-06-25 22:41:30 +0200 |
commit | c4550e6e9824c3fb5ee980cc8c9b175b8baf3d1a (patch) | |
tree | 4d86e13e1032c7a215de2c311940b1e81acbf7e0 | |
parent | 518f72ec4bb395647921d5091d85c7335c3968ac (diff) | |
download | qemu-c4550e6e9824c3fb5ee980cc8c9b175b8baf3d1a.zip qemu-c4550e6e9824c3fb5ee980cc8c9b175b8baf3d1a.tar.gz qemu-c4550e6e9824c3fb5ee980cc8c9b175b8baf3d1a.tar.bz2 |
target/ppc: Fix timer register accessors when !KVM
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>
-rw-r--r-- | target/ppc/kvm.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index a7f2de9..a8a935e 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -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, ®); } @@ -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, ®); } @@ -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, ®); } |