[PATCH v2] LoongArch: KVM: Remove timer interrupt injection with SW timer expired

Bibo Mao posted 1 patch 1 month ago
arch/loongarch/kvm/timer.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH v2] LoongArch: KVM: Remove timer interrupt injection with SW timer expired
Posted by Bibo Mao 1 month ago
The software timer emulation is to wake up vCPU when vCPU executes idle
instruction and gives up host CPU, vCPU timer tick value and interrupt is
set when vCPU is scheduled in.

It is not necessary to inject timer interrupt when SW timer is expired.
Here remove it, also use common API kvm_vcpu_wake_up to wake up vCPU.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
---
v1 ... v2:
  1. Use common api kvm_vcpu_wake_up() rather than rcuwait_wake_up.
---
 arch/loongarch/kvm/timer.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/loongarch/kvm/timer.c b/arch/loongarch/kvm/timer.c
index 8356fce0043f..3829f35a4070 100644
--- a/arch/loongarch/kvm/timer.c
+++ b/arch/loongarch/kvm/timer.c
@@ -30,8 +30,7 @@ enum hrtimer_restart kvm_swtimer_wakeup(struct hrtimer *timer)
 	struct kvm_vcpu *vcpu;
 
 	vcpu = container_of(timer, struct kvm_vcpu, arch.swtimer);
-	kvm_queue_irq(vcpu, INT_TI);
-	rcuwait_wake_up(&vcpu->wait);
+	kvm_vcpu_wake_up(vcpu);
 
 	return HRTIMER_NORESTART;
 }

base-commit: 5d6919055dec134de3c40167a490f33c74c12581
-- 
2.39.3