From: Narayana Murty N <nnmlinux@linux.ibm.com>
To: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>,
Gautam Menghani <gautam@linux.ibm.com>,
maddy@linux.ibm.com, npiggin@gmail.com, mpe@ellerman.id.au,
chleroy@kernel.org, sshegde@linux.ibm.com
Cc: linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Timothy Pearson <tpearson@raptorengineering.com>
Subject: Re: [PATCH v5] KVM: PPC: Book3S HV: Avoid spurious interrupts caused by LPCR_MER bit
Date: Tue, 3 Nov 2026 13:17:18 +0530 [thread overview]
Message-ID: <95e84bb2-ce01-4876-b124-1c756df69b10@linux.ibm.com> (raw)
In-Reply-To: <y0bb5vxv.ritesh.list@gmail.com>
Hi Gautam,
Thanks for the update.
On 02/11/26 4:42 PM, Ritesh Harjani (IBM) wrote:
> Gautam Menghani <gautam@linux.ibm.com> writes:
>
>> 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 <tpearson@raptorengineering.com>
>> Closes: https://lore.kernel.org/linuxppc-dev/582904882.11159.1786719390349.JavaMail.zimbra@raptorengineeringinc.com
>> Signed-off-by: Gautam Menghani <gautam@linux.ibm.com>
>> ---
>> v5:
>> 1. Drop the redundant check for the presence of the native XIVE
>> device. (Ritesh)
>>
>
> Thanks Gautam for confirming that.
>
> The patch looks good to me. Feel free to add:
> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Using kvmppc_xive_enabled(vcpu) looks sufficient here since
KVMPPC_IRQ_XIVE specifically represents XIVE native exploitation mode.
It also preserves the required behaviour when switching back to XICS and
when the in-kernel irqchip is not being used.
The earlier case where both BOOK3S_IRQPRIO_EXTERNAL and
xive_interrupt_pending() are set also remains handled by the outer
condition.
Reviewed-by: Narayana Murty N nnmlinux@linux.ibm.com
>
prev parent reply other threads:[~2026-11-03 7:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 9:16 Gautam Menghani
2026-11-02 11:12 ` Ritesh Harjani
2026-11-03 7:47 ` Narayana Murty N [this message]
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=95e84bb2-ce01-4876-b124-1c756df69b10@linux.ibm.com \
--to=nnmlinux@linux.ibm.com \
--cc=chleroy@kernel.org \
--cc=gautam@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=ritesh.list@gmail.com \
--cc=sshegde@linux.ibm.com \
--cc=stable@vger.kernel.org \
--cc=tpearson@raptorengineering.com \
/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
all inboxes | Powered by JetHome®