Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1892594ybn; Thu, 26 Sep 2019 03:55:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqwq20kihv82Sd1xdH/8f2mgB1JvRCbAqb8AFLVejr5+/y5KTQwg9qMUb7KjuVwss5//li9I X-Received: by 2002:aa7:c71a:: with SMTP id i26mr2865885edq.68.1569495303414; Thu, 26 Sep 2019 03:55:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569495303; cv=none; d=google.com; s=arc-20160816; b=XUUxeLX/mj4uRB2GDrk8Cq+1RJzidUByum58iuUrptMoX2/E6cGCRO2bQCnxHjpD1K 5acWpxYWEEf3S9rGwED8Altc4m5em+0x0IIPOYltLRX0d6FT3U1E4OOLJX+/YkeolTIY yZn+dwQEkTXM5e9R5WvwdNQ9dVwwpTrDdPG1UxEtpFSvbjUn545j2p/yChA4VOP7Ujeb SkSvmrZ48zcH/QGkHSEkjJWLXRxB1tnugqCo9O/Hehb18zJ7RfZFfkaAmgLoTqfDxRnA 8TirrMs9Jg4OD+t9lNCfgC+lXNBnLL/QEXHn8M+iVvBeDtJQnzerrJ9XcwtMPnWmw2N+ LMxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=4/q1zFhasZ3whpoSBEazZ+VMHBd9MeCnzus018R/GLU=; b=ezkA9fU7+cX/QOtDRwHgjRBG3cFkO6fk/ZxNT2KJEXi5Ct657Vvwe37m0eKa4O8CMI KmeYo/93HkXnL3gvAioUkhrwfPT9gCQAEh4EuWmrR7ARWMoD5T1XvBHPO2AYcZcXPJ+d cLHzgxnsU0Eaif9L61NrBfN0xaVM6P1PS3mnSqr/OftNhfKI57k18ldo20qw9BKgOlB/ Ajv2+Ai1aDfGJKs0AKYAuic3yII1fXdmX8NE2QZYF0Nh25uyQVM9KiyzZPR/zNljELVl 8NUyRrrUcmESB+qNNA1easqGLcRLQ1zXBW/6mfp+kKfsEffTonXLCDiQE6GfYujiFmUN 214A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j24si1009460edt.259.2019.09.26.03.54.39; Thu, 26 Sep 2019 03:55:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2633585AbfIXV0j (ORCPT + 99 others); Tue, 24 Sep 2019 17:26:39 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:8108 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2633530AbfIXV0J (ORCPT ); Tue, 24 Sep 2019 17:26:09 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8OLMU5J124981; Tue, 24 Sep 2019 17:25:23 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 2v7r8x68d0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Sep 2019 17:25:23 -0400 Received: from m0098413.ppops.net (m0098413.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x8OLMkUk125689; Tue, 24 Sep 2019 17:25:22 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0b-001b2d01.pphosted.com with ESMTP id 2v7r8x68cd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Sep 2019 17:25:22 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x8OLJxwa018560; Tue, 24 Sep 2019 21:25:21 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma02dal.us.ibm.com with ESMTP id 2v5bg7fy9d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Sep 2019 21:25:21 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8OLPJse36110624 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Sep 2019 21:25:19 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 845F0C605D; Tue, 24 Sep 2019 21:25:19 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E060BC605A; Tue, 24 Sep 2019 21:25:14 +0000 (GMT) Received: from LeoBras.aus.stglabs.ibm.com (unknown [9.18.235.184]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 24 Sep 2019 21:25:14 +0000 (GMT) From: Leonardo Bras To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org Cc: Leonardo Bras , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Arnd Bergmann , "Aneesh Kumar K.V" , Christophe Leroy , Andrew Morton , Dan Williams , Nicholas Piggin , Mahesh Salgaonkar , Greg Kroah-Hartman , Thomas Gleixner , Ganesh Goudar , Allison Randal , Mike Rapoport , YueHaibing , Ira Weiny , Jason Gunthorpe , John Hubbard , Keith Busch Subject: [PATCH v3 07/11] powerpc/kvm/e500: Applies counting method to monitor lockless pgtbl walks Date: Tue, 24 Sep 2019 18:24:24 -0300 Message-Id: <20190924212427.7734-8-leonardo@linux.ibm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190924212427.7734-1-leonardo@linux.ibm.com> References: <20190924212427.7734-1-leonardo@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-09-24_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909240173 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Applies the counting-based method for monitoring lockless pgtable walks on kvmppc_e500_shadow_map(). Signed-off-by: Leonardo Bras --- arch/powerpc/kvm/e500_mmu_host.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c index 321db0fdb9db..a1b8bfe20bc8 100644 --- a/arch/powerpc/kvm/e500_mmu_host.c +++ b/arch/powerpc/kvm/e500_mmu_host.c @@ -473,6 +473,7 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500, * We are holding kvm->mmu_lock so a notifier invalidate * can't run hence pfn won't change. */ + start_lockless_pgtbl_walk(kvm->mm); local_irq_save(flags); ptep = find_linux_pte(pgdir, hva, NULL, NULL); if (ptep) { @@ -484,12 +485,15 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500, local_irq_restore(flags); } else { local_irq_restore(flags); + end_lockless_pgtbl_walk(kvm->mm); pr_err_ratelimited("%s: pte not present: gfn %lx,pfn %lx\n", __func__, (long)gfn, pfn); ret = -EINVAL; goto out; } } + end_lockless_pgtbl_walk(kvm->mm); + kvmppc_e500_ref_setup(ref, gtlbe, pfn, wimg); kvmppc_e500_setup_stlbe(&vcpu_e500->vcpu, gtlbe, tsize, -- 2.20.1