From patchwork Thu Jan 14 03:15:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mahesh J Salgaonkar X-Patchwork-Id: 8029311 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4067BBEEE5 for ; Thu, 14 Jan 2016 03:16:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 448DF20497 for ; Thu, 14 Jan 2016 03:16:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4C343204AE for ; Thu, 14 Jan 2016 03:16:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753198AbcANDQ1 (ORCPT ); Wed, 13 Jan 2016 22:16:27 -0500 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 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp02.au.ibm.com (202.81.31.208) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 14 Jan 2016 13:16:22 +1000 X-IBM-Helo: d23dlp01.au.ibm.com X-IBM-MailFrom: mahesh@linux.vnet.ibm.com X-IBM-RcptTo: kvm-ppc@vger.kernel.org;kvm@vger.kernel.org Received: from d23relay08.au.ibm.com (d23relay08.au.ibm.com [9.185.71.33]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 24DA72CE8056; Thu, 14 Jan 2016 14:16:20 +1100 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u0E3Fod922413442; Thu, 14 Jan 2016 14:15:58 +1100 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u0E3FkRC018606; Thu, 14 Jan 2016 14:15:47 +1100 Received: from [192.168.0.3] ([9.79.179.157]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u0E3FiT7018057; Thu, 14 Jan 2016 14:15:45 +1100 Subject: [PATCH 3/3] KVM: PPC: Book3S HV: Fix soft lockups in KVM on HMI for time base errors From: Mahesh J Salgaonkar To: linuxppc-dev , Paul Mackerras , Michael Ellerman Cc: KVM-PPC , KVM Date: Thu, 14 Jan 2016 08:45:28 +0530 Message-ID: <20160114031528.1287.7326.stgit@mars> In-Reply-To: <20160114031457.1287.32132.stgit@mars> References: <20160114031457.1287.32132.stgit@mars> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16011403-0005-0000-0000-000003167DA7 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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.