Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp2404716ybj; Mon, 23 Sep 2019 03:16:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqw60+TTu0sTfyaq3IhGJManaQKdo7OE9RT/pONOjjapt+8FerMF5avHQDgaYz2BMEDtUOOo X-Received: by 2002:a50:ef12:: with SMTP id m18mr35632700eds.18.1569233818234; Mon, 23 Sep 2019 03:16:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569233818; cv=none; d=google.com; s=arc-20160816; b=LqIHe/3t5YyjFRJSTSFLYcuw694Z111lSRdt/fX56Xna61UbHhqgv+rQVR//xJiNI2 aTMNbJ191oKyCPyU9/bBUX9twa0Yva7wrOVGiDSj8bi8lSNuvN8WVxwIslCD2aWmnSL9 JxqX5LfEht/jPaS6OfHIThos55DhKONslGhW/2/sK74rOZ0swE4NYx0yp+ijXzrmD9j3 inxq65cYPB4fJkzImKic3TE/suFVaJWMvsVDqselaczqEkZ5/5UsiYtxuTgqMBd55pPS v9q4nF4Gj+Qgk0gqsF1o1o2R//vIgAVGpUBjuFaWaZAlsj257PfJcbeBB37f6plbm2Kb gNhA== 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=CR5bcE+2cKRG0/6/eXWtyTIDf43kZHnlzNJmAIYaMBtaH5gWQUfKxMwrLb54LczRi+ NgcvY+Owsn6YoAHNKrCUlWF5BLfRTR9L4IfiI/DHgFjZCl7x50v4DckdSqGDq7qiW0Jr NIaSH8wn5Fd3zEbn3ZYcD7E/aE0u90sriQCCPeqDJzDMAdG5nNPT/Wvwx+M9TRERjl6A bsK7XJLU39hiYBtFAPLzkeeUibzKxgOCC4o2V5gAIAEenJ4w4dpkPzlg6jZuYifpa/Il OkWPacpOsyiyM/W6rNgQcul6CFpuQJmG9xKjW8XNYFbE9MEyVaMMA/AGm1biEpnf3ris qYqg== 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 v4si6259327edm.183.2019.09.23.03.16.35; Mon, 23 Sep 2019 03:16:58 -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 S2436826AbfITTw1 (ORCPT + 99 others); Fri, 20 Sep 2019 15:52:27 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:31952 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436818AbfITTwY (ORCPT ); Fri, 20 Sep 2019 15:52:24 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8KJlw32134571; Fri, 20 Sep 2019 15:51:56 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2v53ju40ha-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Sep 2019 15:51:55 -0400 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x8KJmSBS139341; Fri, 20 Sep 2019 15:51:55 -0400 Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com with ESMTP id 2v53ju40gq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Sep 2019 15:51:55 -0400 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x8KJoIqV013702; Fri, 20 Sep 2019 19:51:54 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma04wdc.us.ibm.com with ESMTP id 2v3vc5rq5f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Sep 2019 19:51:53 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8KJpqgA56885528 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Sep 2019 19:51:52 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5D8A878064; Fri, 20 Sep 2019 19:51:52 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C0C7F7805E; Fri, 20 Sep 2019 19:51:47 +0000 (GMT) Received: from LeoBras.aus.stglabs.ibm.com (unknown [9.18.235.184]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 20 Sep 2019 19:51:47 +0000 (GMT) From: Leonardo Bras To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.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 , Thomas Gleixner , Richard Fontana , Ganesh Goudar , Allison Randal , Greg Kroah-Hartman , Mike Rapoport , YueHaibing , Ira Weiny , Jason Gunthorpe , John Hubbard , Keith Busch Subject: [PATCH v2 07/11] powerpc/kvm/e500: Applies counting method to monitor lockless pgtbl walks Date: Fri, 20 Sep 2019 16:50:43 -0300 Message-Id: <20190920195047.7703-8-leonardo@linux.ibm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190920195047.7703-1-leonardo@linux.ibm.com> References: <20190920195047.7703-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-20_07:,, 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-1909200161 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