From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mahesh J Salgaonkar Subject: [PATCH 3/3] KVM: PPC: Book3S HV: Fix soft lockups in KVM on HMI for time base errors Date: Thu, 14 Jan 2016 08:45:28 +0530 Message-ID: <20160114031528.1287.7326.stgit@mars> References: <20160114031457.1287.32132.stgit@mars> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: KVM-PPC , KVM To: linuxppc-dev , Paul Mackerras , Michael Ellerman Return-path: Received: from e23smtp02.au.ibm.com ([202.81.31.144]:52715 "EHLO e23smtp02.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753164AbcANDQ0 (ORCPT ); Wed, 13 Jan 2016 22:16:26 -0500 Received: from localhost by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 14 Jan 2016 13:16:24 +1000 In-Reply-To: <20160114031457.1287.32132.stgit@mars> Sender: kvm-owner@vger.kernel.org List-ID: From: Mahesh Salgaonkar When secondaries are napping in kvm_unsplit_nap() with hwthread_req = 1, the HMI goes ignored even though subcores are already exited the guest. Hence HMI keeps waking up secondaries from nap in a loop and secondaries always go back to nap since no vcore is assigned to them. This makes impossible for primary thread to get hold of secondary threads resulting into a soft lockup in KVM path. This patch fixes this by adding a HMI check just before the thread goes to unsplit nap. Signed-off-by: Mahesh Salgaonkar --- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S index e8a456e..c5d43b9 100644 --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S @@ -440,6 +440,12 @@ kvm_no_guest: * whole-core mode, so we need to nap. */ kvm_unsplit_nap: + /* Before we head down to nap, check if HMI is pending and handle it */ + cmpwi r12, BOOK3S_INTERRUPT_HMI + bne 55f + li r3, 0 /* NULL argument */ + bl hmi_exception_realmode +55: /* * Ensure that secondary doesn't nap when it has * its vcore pointer set.