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=1796381047; b=SeF+CDDh2lWZWESoJ3g5FyTy6nbulP++0VIkUvWQygIuXY2SvdGTIb9lJvlVWwOeEeZq s28TZcsMnsyxHpcEz9Ztzh24H0fIhVQmVWQUvMN0cdKaQ2R7sdkd7u6WFBcqfdfUl0Gft Dvy3sriHBJGj7ctXbvG7tefzisESRQObeYzdIid1F/61btP7TJq2G56eScpAiizzenapE YA39P3DpsHnGH96esWzbWSXLN0bz39M9CmxjPlqBo+9RG8brQrWrzwCWDcbRo/N5b5XSD h3S8UwnCavu9yAPLxUIq0pivhUNGh/uY7aK5nn1kGQvE7NT8G6YzxP88/HuXrJogbNg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381047; 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=m+2zSIRej1c+LJ9qYR4WFEyzmpQkG3MQ1Xu3Enfw09E=; b=Zd11roJ1UracH7Z6LajOB8MYnbwlgmPRO6CGg6rTdj9Zvw905mjcRTQT3OdWG9Jc8XKd iSMtcqpG6F1/IcG76O1004YiK2Bs3/X6gnPIuNCRguT2EAQ2McdVEw/fbxc5pcstbE0sw P4SEmmEii206YimeH3c+tvYIzgHuikV5SU8jqyFNTldxd66olOIFsXymLQuER3c/3NVyy GJHldRXOr0KjSS49jLd8QpGOvWTWxDpBTs80OZXgZuYyem2+lg7bHna+Fu2yLXLglL6ec w2+Vo+lfGNJfiRPpxKyJzf2lwCm86CUEI4eI2FFemH+E1Q60zxVgnOoTBm0b8sO1LWA== 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=fzqzuRL0; 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 5FE8F606A333; Fri, 4 Dec 2026 10:44:07 +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=fzqzuRL0 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C93DC1F000CE; Fri, 4 Dec 2026 10:44:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381047; bh=m+2zSIRej1c+LJ9qYR4WFEyzmpQkG3MQ1Xu3Enfw09E=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fzqzuRL0M5dbbnbHIiDpMi+xWbZRCLhEmzpBbU9uzVyVMNQdO9BKe0f6UdwQ1E4WS kHcoKwobvYra+MuSvjAFK27b0Wc2lL8wd9Dl9AILpxrj78DC4yHyICS1sNk7Eu/AKg 0u5HZvftQzDZYTvwPiXPcWgVGnAcsIDXXeCwzBIg= 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 7.3 528/742] KVM: PPC: Book3S HV: Avoid spurious interrupts caused by LPCR_MER bit Date: Fri, 4 Dec 2026 19:06:32 +0900 Message-ID: <20261204100649.193507251@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-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 @@ -4984,7 +4984,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 { /*