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=1796382486; b=ga+96NHFPpqCOLVz1twA0omHY50NGTvnBHNM5Q1/7DSJqCvE5v5D+dMisXUFgGLQLDjS z6iHkQBavdWGFquEDL/H2yv/N2PRWhmhbX3XWxtBgEg03AbP3o5rN5usUc8FcrlGcaMrJ T1n+Lt6kSrUObHQ8JhpZRZdhaLyUz1e9CTqq7k4SHSwkvnEX60UPQHjD0ebT+WSoleBtX pLzCzCio9uINSHCgJU6JeVVZL7AZrHKXmIbmLHCZImGtImxEbONMGeYIdqiq8H3VjugHh xesMnZkQH1mU5npz0JuaN+T1vOutvxOoGgGswsyHBiB549VTNgkWsLiUkf7NUUjy68g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382486; 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=aCHbSxcRnqjZWEkwH5zhcL5CEIbKdeD0i0e4+IEQksU=; b=bbKloXLKQZ36TEreRwwQeVyV3esCm7hXGbkA9i81aGAbmWpm0dOhz3TvNHdyDWHWCZn0 QBcFThcfpgVAqlKa6zv9DXAhCmcQAb4VxJcxCFj8+e5lP1iO6iNaEuS1DPyy+kPhhJh4w OOM+PWM5tn5BViOgaKhStwI/eqeyg+Z1Us5TX86FtbwndQtk5Vw9Z+lXd9narxMZU+YqY RNvZKQ3K7B7BvTZ5kfIzUbFsnPUu26ya4PU0Z4wFaeHF7mFdKSleU0EU9fod2UCuM2MAZ G4FkJxpGVZdj1JgVjwCd5aNJIJ0hJb9gjWLYX0Pna3WZ4+F/DFXKvB3X14CQbKnjwxA== 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=mRttcW1i; 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 3AF3F606A32D; Fri, 4 Dec 2026 11:08:06 +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=mRttcW1i Received: by smtp.kernel.org (Postfix) with ESMTPSA id A38581F000CE; Fri, 4 Dec 2026 11:08:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382486; bh=aCHbSxcRnqjZWEkwH5zhcL5CEIbKdeD0i0e4+IEQksU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=mRttcW1iNiCFVbXTPRj5GBdYyXelH2gr0icwfRb4KBmRuO5N14CQPKqLIXS0IsesC sl9IdHMEp3bo0BmFcdCOywkT7bLLsyaAl0OFp+kw+6HASW+yd/kZrPen3YcdY80/mP NqGkNl9TuB2o5EUhQYSoh5NMpULJb2JWNK/qreyw= 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.18 475/703] KVM: PPC: Book3S HV: Avoid spurious interrupts caused by LPCR_MER bit Date: Fri, 4 Dec 2026 19:06:14 +0900 Message-ID: <20261204100640.425799069@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@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 6.18-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 @@ -4967,7 +4967,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 { /*