From: Bibo Mao <maobibo@loongson.cn>
To: Huacai Chen <chenhuacai@kernel.org>
Cc: kernel@xen0n.name, kvm@vger.kernel.org,
loongarch@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH v2] LoongArch: KVM: Remove timer interrupt injection with SW timer expired
Date: Wed, 13 May 2026 09:55:25 +0800 [thread overview]
Message-ID: <20260513015525.1152240-1-maobibo@loongson.cn> (raw)
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
reply other threads:[~2026-05-13 1:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260513015525.1152240-1-maobibo@loongson.cn \
--to=maobibo@loongson.cn \
--cc=chenhuacai@kernel.org \
--cc=kernel@xen0n.name \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).