From patchwork Tue Feb 18 08:00:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: BillXiang X-Patchwork-Id: 13979234 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 46B3CC02198 for ; Tue, 18 Feb 2025 08:10:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:Cc:Message-Id:Mime-Version:From :To:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=tHRASqz1groi1MySmji9GI+YKVVnI2YhXIiAsaQ+NHA=; b=ZdJn3aclx4p79P vx3Jv6o4dorCk6l2YTIsi3/j9a5b0x3GAF0Yzmhj9GqL7r1B5lQuBpUwYwi2FFOR4c7sl4C+HU9FN NHcY1gEbCExOqQ8nUZ7TimBNEhNh4u9Ssy0XAd1qbgWxeWoeLAELh1g7ROEg9RMrKbzcXQwvYZl4I 904GYv0Aq8kWZVMfURLvjJeATtcS2pdOwvboGg8wtpciFujT/tESN8BjIjoSzP0vaVeYaLylYBwJD 35uUTUtA1w6ObSVsqW1qf1aWFwocOaX7BmkCcFKJjV+2GOqoERpdOpLQQApY6Y16wJMH1L7yqJpGd XiJpHcObYqKkR90ZKXRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tkIgg-00000007Bv4-0aEP; Tue, 18 Feb 2025 08:10:38 +0000 Received: from va-2-36.ptr.blmpb.com ([209.127.231.36]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tkIX0-00000007AKG-0lRc for linux-riscv@lists.infradead.org; Tue, 18 Feb 2025 08:00:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=s1; d=lanxincomputing-com.20200927.dkim.feishu.cn; t=1739865627; h=from:subject:mime-version:from:date:message-id:subject:to:cc: reply-to:content-type:mime-version:in-reply-to:message-id; bh=MMO+Pgdg8WUeZitp0y2WePnN5QHq5BURFZjY8A/MeFs=; b=Z2aH6/8CrVCpu9NtMyfc9p0Q5oAdZWHEBbQYGKCrg6wQR3tVN3hiIRpT7CclZQiYu9H8A2 a2UGYxq4on4qGPxKSUOexkslLkeDC6W4cpTDLZfEKgO7S2WMxtucEJ9FehcVGtmFjeAiYN kjG4l9CYzaagPWUqDJkyEkQ9DPXHrI+B6KEm4hUKVHz+eQMHxcxtS6eLACjTw5nT4WCo0v zID8WhTSDTLXp0CsEnlRlcEqOJZp00c+4+MmRAmE20rlIGs2vL6e/HU8WOjCNB1RDShUpH 12+4ZSwWTuHc6Z+xKOJRZsCkzzCizyNxg2zvDFz9Nfjf0/9kH05i/p+46ay2dQ== Date: Tue, 18 Feb 2025 16:00:24 +0800 To: "kvm-riscv@lists.infradead.org" From: =?utf-8?b?6aG55paH5oiQ?= Mime-Version: 1.0 X-Lms-Return-Path: Message-Id: <38cc241c40a8ef2775e304d366bcd07df733ecf0.1d66512d.85e4.41a5.8cf7.4c1fdb05d775@feishu.cn> Cc: "anup@brainfault.org" , "atishp@atishpatra.org" , "paul.walmsley@sifive.com" , "palmer@dabbelt.com" , "aou@eecs.berkeley.edu" , "kvm@vger.kernel.org" , "linux-riscv@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH] riscv: KVM: Remove unnecessary vcpu kick X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250218_000038_870585_A65E2086 X-CRM114-Status: UNSURE ( 7.52 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From 30dd00f6886119ecc5c39b6b88f8617a57e598fc Mon Sep 17 00:00:00 2001 From: BillXiang Date: Tue, 18 Feb 2025 15:45:52 +0800 Subject: [PATCH] riscv: KVM: Remove unnecessary vcpu kick Hello everyone, I'm wondering whether it's necessary to kick the virtual hart after writing to the vsfile of IMSIC. From my understanding, writing to the vsfile should directly forward the interrupt as MSI to the virtual hart. This means that an additional kick should not be necessary, as it would cause the vCPU to exit unnecessarily and potentially degrade performance. I've tested this behavior in QEMU, and it seems to work perfectly fine without the extra kick. Would appreciate any insights or confirmation on this! Best regards. Signed-off-by: BillXiang ---  arch/riscv/kvm/aia_imsic.c | 1 -  1 file changed, 1 deletion(-) -- 2.46.2 diff --git a/arch/riscv/kvm/aia_imsic.c b/arch/riscv/kvm/aia_imsic.c index a8085cd8215e..29ef9c2133a9 100644 --- a/arch/riscv/kvm/aia_imsic.c +++ b/arch/riscv/kvm/aia_imsic.c @@ -974,7 +974,6 @@ int kvm_riscv_vcpu_aia_imsic_inject(struct kvm_vcpu *vcpu,         if (imsic->vsfile_cpu >= 0) {                 writel(iid, imsic->vsfile_va + IMSIC_MMIO_SETIPNUM_LE); -               kvm_vcpu_kick(vcpu);         } else {                 eix = &imsic->swfile->eix[iid / BITS_PER_TYPE(u64)];                 set_bit(iid & (BITS_PER_TYPE(u64) - 1), eix->eip);