From patchwork Wed Jun 18 15:45:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihai Caraman X-Patchwork-Id: 4377691 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 03E72BEEAA for ; Wed, 18 Jun 2014 16:01:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0DA072034F for ; Wed, 18 Jun 2014 16:01:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F1E31201C8 for ; Wed, 18 Jun 2014 16:01:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752953AbaFRQBX (ORCPT ); Wed, 18 Jun 2014 12:01:23 -0400 Received: from mail-bn1lp0142.outbound.protection.outlook.com ([207.46.163.142]:27180 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751888AbaFRQBW (ORCPT ); Wed, 18 Jun 2014 12:01:22 -0400 Received: from BY2PR03CA052.namprd03.prod.outlook.com (10.141.249.25) by BY2PR03MB569.namprd03.prod.outlook.com (10.141.142.153) with Microsoft SMTP Server (TLS) id 15.0.949.11; Wed, 18 Jun 2014 15:45:22 +0000 Received: from BL2FFO11FD057.protection.gbl (2a01:111:f400:7c09::159) by BY2PR03CA052.outlook.office365.com (2a01:111:e400:2c5d::25) with Microsoft SMTP Server (TLS) id 15.0.959.24 via Frontend Transport; Wed, 18 Jun 2014 15:45:11 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD057.mail.protection.outlook.com (10.173.161.185) with Microsoft SMTP Server (TLS) id 15.0.959.15 via Frontend Transport; Wed, 18 Jun 2014 15:45:10 +0000 Received: from fsr-fed1764-012.ea.freescale.net (fsr-fed1764-012-010171073213.ea.freescale.net [10.171.73.213]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id s5IFj7HT022240; Wed, 18 Jun 2014 08:45:08 -0700 From: Mihai Caraman To: CC: , , Mihai Caraman , Bharat Bhushan Subject: [PATCH] KVM: PPC: Book3E: Unlock mmu_lock when setting caching atttribute Date: Wed, 18 Jun 2014 18:45:05 +0300 Message-ID: <1403106305-11565-1-git-send-email-mihai.caraman@freescale.com> X-Mailer: git-send-email 1.7.11.7 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(199002)(189002)(4396001)(50226001)(79102001)(21056001)(85852003)(87286001)(26826002)(77156001)(95666004)(104016002)(83322001)(19580395003)(19580405001)(89996001)(44976005)(87936001)(6806004)(88136002)(33646001)(83072002)(105606002)(104166001)(81542001)(50986999)(69596002)(86362001)(97736001)(62966002)(31966008)(102836001)(74662001)(76482001)(36756003)(74502001)(99396002)(93916002)(575784001)(92566001)(80022001)(64706001)(48376002)(92726001)(20776003)(68736004)(81342001)(46102001)(85306003)(47776003)(77982001)(84676001)(50466002)(81156003)(32563001); DIR:OUT; SFP:; SCL:1; SRVR:BY2PR03MB569; H:az84smr01.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: BL:0; ACTION:Default; RISK:Low; SCL:0; SPMLVL:NotSpam; PCL:0; RULEID: X-Forefront-PRVS: 02462830BE Received-SPF: Fail (: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=mihai.caraman@freescale.com; X-OriginatorOrg: freescale.com 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, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 The patch 08c9a188d0d0fc0f0c5e17d89a06bb59c493110f kvm: powerpc: use caching attributes as per linux pte do not handle properly the error case, letting mmu_lock locked. The lock will further generate a RCU stall from kvmppc_e500_emul_tlbwe() caller. In case of an error go to out label. Signed-off-by: Mihai Caraman Cc: Bharat Bhushan --- arch/powerpc/kvm/e500_mmu_host.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c index 0528fe5..54144c7 100644 --- a/arch/powerpc/kvm/e500_mmu_host.c +++ b/arch/powerpc/kvm/e500_mmu_host.c @@ -473,7 +473,8 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500, if (printk_ratelimit()) pr_err("%s: pte not present: gfn %lx, pfn %lx\n", __func__, (long)gfn, pfn); - return -EINVAL; + ret = -EINVAL; + goto out; } kvmppc_e500_ref_setup(ref, gtlbe, pfn, wimg);