From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796384023; b=a84OLV+ApuuDYLdJAfPRTNTUGLvzWmgSaXGP2t9hBJZdH1k9fKJRldh125OopSu4BL03 h6McFQzqoyfReKtXe91jO/hV3iMe1RhyEnaS8UodmlZJ2V2NIXNuXp3dIb2f5qD2sx/H2 vrwYSAwVKCgx4s/kIRH9d13URYFueDgrb7oS37ZTFtbRp/VxhE4h6fB6DUcgTTfW3xPWW DC82pjJrUAzqPsj7Hbm2jI0NCpjx+/C6Jgr90Dpby3YTwSBMsppU4PpQTTp4OR3MbC+J5 ZPclDsnK5V9FQLHjygY7YaGrd/QQspDN1BAnArubCSuv8qrkoWGI+Uq0yMJEGguqVZA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384023; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=nQzomoh7GHpelghss0/NPVF34EU/VpYKljSARs+cV1c=; b=zdIBRwjS4QiZhIrMlNggZC6+1Bp3QlYQxEd4LYH++fOT5wcT9PYcgBClzMeKsPrsUSaF 4c88jyFX1/nBdVc+dLTerQn1hApkdTHh1HY91u0ANVN57xkaTpBh1yeAcsUnSQdkQh8O/ hBel1wsXWJvYoL6K0kic0g3QRRfx2u4i1s17rWNjpdVptayQW3H55yCd/JS9cmg/t72us D+dfHttEw+sHiZpe9z9R32WoCY8JFueEbhOZqaB2kca6Goi5V0JoaxCqGy8HJN52XOXrR 1rxmBHOTEWCLpHFbKlqo5FuoUWw9hcoCHHP6MFZ+vZBc1G7ikYdRMer77ou85AhaiVQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Jchtwx7I; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D587606A322; Fri, 4 Dec 2026 11:33:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Jchtwx7I Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD4141F000CE; Fri, 4 Dec 2026 11:33:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384023; bh=nQzomoh7GHpelghss0/NPVF34EU/VpYKljSARs+cV1c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Jchtwx7IyNFsEJXPduvECrVpWTzfIU++nyT09PzP3WbVU/Y5moVz5SRqEkimOWhgr 1JrrXcrkcJd2DPoQqfxAm8rdcCxA96Y29DRQiP7lMfkclxhBXX6bdsHINHu7bnehtC krOLsYjaOthefYaggEX8GC/k4rTbFu2Vj5vnnDMg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Timothy Pearson , Gautam Menghani , "Ritesh Harjani (IBM)" , Madhavan Srinivasan Subject: [PATCH 6.12 413/555] KVM: PPC: Book3S HV: Avoid spurious interrupts caused by LPCR_MER bit Date: Fri, 4 Dec 2026 19:07:36 +0900 Message-ID: <20261204100625.451499647@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gautam Menghani commit 9751c361cb234f000261879b1b5015bf08f6a428 upstream. A huge number of spurious interrupts can be seen immediately after a KVM on PowerNV guest boots up in XIVE mode. $ cat /proc/interrupts | grep SPU SPU: 223705 192439 273526 147623 Spurious interrupts This bug was introduced by commit ecd10702baae5 ("KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with MSR_EE"). The root cause is that once LPCR_MER bit is set, it is supposed to be reset by software. But when a vCPU starts running with LPCR_MER set, the vCPU does not exit back to the host until the decrementer expires or there is an hcall, etc. This is because KVM on PowerNV guests have support for native XIVE, so they are not dependent on host for interrupt emulation. Due to this behaviour, a huge number of spurious interrupts are seen since LPCR_MER continues to be set and LPCR_MER cannot be reset until the vCPU exits to the host. Fix this behaviour by not using the LPCR_MER bit whenever native XIVE is available (currently in case of KVM on PowerNV only), as the XIVE hardware can present interrupts to the KVM guest vCPU directly. So the LPCR_MER functionality is not required. This reduces the number of spurious interrupts drastically. Fixes: ecd10702baae5 ("KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with MSR_EE") Cc: stable@vger.kernel.org # 6.8+ Reported-by: Timothy Pearson Closes: https://lore.kernel.org/linuxppc-dev/582904882.11159.1786719390349.JavaMail.zimbra@raptorengineeringinc.com Signed-off-by: Gautam Menghani Reviewed-by: Ritesh Harjani (IBM) Signed-off-by: Madhavan Srinivasan Link: https://patch.msgid.link/20261102091700.253381-1-gautam@linux.ibm.com Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kvm/book3s_hv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c @@ -4911,7 +4911,7 @@ int kvmhv_run_single_vcpu(struct kvm_vcp if (!kvmhv_on_pseries() && (__kvmppc_get_msr_hv(vcpu) & MSR_EE)) kvmppc_inject_interrupt_hv(vcpu, BOOK3S_INTERRUPT_EXTERNAL, 0); - else + else if (!kvmppc_xive_enabled(vcpu)) lpcr |= LPCR_MER; } else { /*