]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: arm64: Simplify kvm_cpu_has_pending_timer()
authorMarc Zyngier <maz@kernel.org>
Tue, 19 Apr 2022 18:27:48 +0000 (19:27 +0100)
committerMarc Zyngier <maz@kernel.org>
Wed, 20 Apr 2022 12:24:44 +0000 (13:24 +0100)
kvm_cpu_has_pending_timer() ends up checking all the possible
timers for a wake-up cause. However, we already check for
pending interrupts whenever we try to wake-up a vcpu, including
the timer interrupts.

Obviously, doing the same work twice is once too many. Reduce
this helper to almost nothing, but keep it around, as we are
going to make use of it soon.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220419182755.601427-4-maz@kernel.org
arch/arm64/kvm/arch_timer.c
arch/arm64/kvm/arm.c
include/kvm/arm_arch_timer.h

index 6e542e2eae32bc420333a7f9e2c93add11847f3d..16dda1a383a6f77ebc08fc2bc494df4bfbcf7ffe 100644 (file)
@@ -350,15 +350,9 @@ static bool kvm_timer_should_fire(struct arch_timer_context *timer_ctx)
        return cval <= now;
 }
 
-bool kvm_timer_is_pending(struct kvm_vcpu *vcpu)
+int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu)
 {
-       struct timer_map map;
-
-       get_timer_map(vcpu, &map);
-
-       return kvm_timer_should_fire(map.direct_vtimer) ||
-              kvm_timer_should_fire(map.direct_ptimer) ||
-              kvm_timer_should_fire(map.emul_ptimer);
+       return 0;
 }
 
 /*
index 523bc934fe2f66687b2bb605776f4b239b6114d3..2122c699af06203e221f4d26b86718448f7d9796 100644 (file)
@@ -356,11 +356,6 @@ void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
        kvm_arm_vcpu_destroy(vcpu);
 }
 
-int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu)
-{
-       return kvm_timer_is_pending(vcpu);
-}
-
 void kvm_arch_vcpu_blocking(struct kvm_vcpu *vcpu)
 {
 
index 51c19381108cf70051bcb0f784d04862b9be84bd..cd6d8f260eab1415dad7feec0ebf5c868b5275b1 100644 (file)
@@ -76,8 +76,6 @@ int kvm_arm_timer_set_attr(struct kvm_vcpu *vcpu, struct kvm_device_attr *attr);
 int kvm_arm_timer_get_attr(struct kvm_vcpu *vcpu, struct kvm_device_attr *attr);
 int kvm_arm_timer_has_attr(struct kvm_vcpu *vcpu, struct kvm_device_attr *attr);
 
-bool kvm_timer_is_pending(struct kvm_vcpu *vcpu);
-
 u64 kvm_phys_timer_read(void);
 
 void kvm_timer_vcpu_load(struct kvm_vcpu *vcpu);