From patchwork Wed Aug 12 06:33:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 11710307 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4EFC413B1 for ; Wed, 12 Aug 2020 06:34:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1AA6F20781 for ; Wed, 12 Aug 2020 06:34:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="GrgbhBIX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1AA6F20781 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 17E898D0003; Wed, 12 Aug 2020 02:34:30 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 131188D0001; Wed, 12 Aug 2020 02:34:30 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 046158D0003; Wed, 12 Aug 2020 02:34:30 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0190.hostedemail.com [216.40.44.190]) by kanga.kvack.org (Postfix) with ESMTP id E564E8D0001 for ; Wed, 12 Aug 2020 02:34:29 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 8FA7C8248D52 for ; Wed, 12 Aug 2020 06:34:29 +0000 (UTC) X-FDA: 77140952658.05.hand13_110589b26fe9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id 60A6B1802D4E6 for ; Wed, 12 Aug 2020 06:34:29 +0000 (UTC) X-Spam-Summary: 1,0,0,4de8225e381e307c,d41d8cd98f00b204,aneesh.kumar@linux.ibm.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1261:1311:1314:1345:1431:1437:1515:1534:1541:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3867:4321:5007:6117:6261:6653:8634:10004:11026:11473:11657:11658:11914:12043:12296:12297:12555:12895:12986:13069:13311:13357:13894:14096:14181:14384:14394:14721:21080:21451:21627:30054,0,RBL:148.163.158.5:@linux.ibm.com:.lbl8.mailshell.net-64.201.201.201 62.14.0.100;04yfj9gcawzeagjm8oqukh7hdt1mcoce5w7w7swcheius7nqghzbkyw7m71cptr.pgtzq4dpdbqjkf9fgbw847xsnnqdc9fgjr49m3cq4hi8a8ngihk4k4uffuixhwz.1-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:31,LUA_SUMMARY:none X-HE-Tag: hand13_110589b26fe9 X-Filterd-Recvd-Size: 4866 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Aug 2020 06:34:28 +0000 (UTC) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07C6W2gi103009; Wed, 12 Aug 2020 02:34:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=LVwTeyKe/+eadJkxhdcPDPb/XZX3HzejRljrDbr75SI=; b=GrgbhBIXQXEVCTLaUj0UAfJEf4ckUn5XbScEB3A3lCJP+4rIpgZJ69D6KQTzRwW/5TA6 Iux4HpWFKnzBKx2GfKJC2jsDhzckE6qMqxnLwYkLC4macRVR2qrFjUC/fDMzRFyzcR/D b5PylWXH27ffAA5JAuyc1k6+uGgOaEJ6jln6RsQmsIU279nxrtAcQ+N/FmprlJz8omgz QlBw9U79sI9a3z6H8CDvk87o3R6GUsV/1Tn/M0guSyFoKlrWgqGU0T7FpD8f2P1cSDtN U2FRu2SbWtqOKPuE3wU/2i5bmIO0t8pMZ2wdXa/GlNXDNX9fmn5lFiVaYdQztzTlLIh4 og== Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0b-001b2d01.pphosted.com with ESMTP id 32uqp3s8r5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 02:34:20 -0400 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07C6FtW7023219; Wed, 12 Aug 2020 06:34:20 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma02wdc.us.ibm.com with ESMTP id 32skp97cbu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 06:34:20 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07C6YJKi45875632 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Aug 2020 06:34:19 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5447113604F; Wed, 12 Aug 2020 06:34:19 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 09459136055; Wed, 12 Aug 2020 06:34:16 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.85.71.109]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 12 Aug 2020 06:34:16 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, Anshuman Khandual , "Aneesh Kumar K.V" Subject: [PATCH 01/16] powerpc/mm: Add DEBUG_VM WARN for pmd_clear Date: Wed, 12 Aug 2020 12:03:43 +0530 Message-Id: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-11_19:2020-08-11,2020-08-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 spamscore=0 priorityscore=1501 mlxscore=0 impostorscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 adultscore=0 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008120044 X-Rspamd-Queue-Id: 60A6B1802D4E6 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: With the hash page table, the kernel should not use pmd_clear for clearing huge pte entries. Add a DEBUG_VM WARN to catch the wrong usage. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/pgtable.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h index 6de56c3b33c4..079211968987 100644 --- a/arch/powerpc/include/asm/book3s/64/pgtable.h +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h @@ -868,6 +868,13 @@ static inline bool pte_ci(pte_t pte) static inline void pmd_clear(pmd_t *pmdp) { + if (IS_ENABLED(CONFIG_DEBUG_VM) && !radix_enabled()) { + /* + * Don't use this if we can possibly have a hash page table + * entry mapping this. + */ + WARN_ON((pmd_val(*pmdp) & (H_PAGE_HASHPTE | _PAGE_PTE)) == (H_PAGE_HASHPTE | _PAGE_PTE)); + } *pmdp = __pmd(0); } @@ -916,6 +923,13 @@ static inline int pmd_bad(pmd_t pmd) static inline void pud_clear(pud_t *pudp) { + if (IS_ENABLED(CONFIG_DEBUG_VM) && !radix_enabled()) { + /* + * Don't use this if we can possibly have a hash page table + * entry mapping this. + */ + WARN_ON((pud_val(*pudp) & (H_PAGE_HASHPTE | _PAGE_PTE)) == (H_PAGE_HASHPTE | _PAGE_PTE)); + } *pudp = __pud(0); } From patchwork Wed Aug 12 06:33:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 11710309 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 60CB413B1 for ; Wed, 12 Aug 2020 06:34:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2CF9220768 for ; Wed, 12 Aug 2020 06:34:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="QawE1FWF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2CF9220768 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9965D8D0005; Wed, 12 Aug 2020 02:34:31 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9469B8D0001; Wed, 12 Aug 2020 02:34:31 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 836658D0005; Wed, 12 Aug 2020 02:34:31 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0172.hostedemail.com [216.40.44.172]) by kanga.kvack.org (Postfix) with ESMTP id 6E69A8D0001 for ; Wed, 12 Aug 2020 02:34:31 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 3065A8248D52 for ; Wed, 12 Aug 2020 06:34:31 +0000 (UTC) X-FDA: 77140952742.06.train28_2b0471426fe9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id F40EE100A11D0 for ; Wed, 12 Aug 2020 06:34:30 +0000 (UTC) X-Spam-Summary: 1,0,0,1d21f18692929e2a,d41d8cd98f00b204,aneesh.kumar@linux.ibm.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1261:1311:1314:1345:1359:1431:1437:1515:1534:1541:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3866:3867:3870:3871:3872:3874:5007:6261:6653:8634:10004:11026:11473:11658:11914:12114:12296:12297:12555:12895:13069:13311:13357:13894:14096:14181:14384:14394:14721:21080:21451:21627:21740:21990:30054:30070,0,RBL:148.163.156.1:@linux.ibm.com:.lbl8.mailshell.net-62.2.0.100 64.100.201.201;04yrq1i7ct9egf8ngbzi7jpzgk4zfocznu9efe5em8zdkjf3ixfocs97a6h4g93.xmykpm3kw5ce44qs5gt99wrgup8c6p9iro9x9fmo9oqixwxu736nuedi3gxgyp4.o-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: train28_2b0471426fe9 X-Filterd-Recvd-Size: 4701 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Aug 2020 06:34:30 +0000 (UTC) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07C6WfZE102644; Wed, 12 Aug 2020 02:34:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=01h9NthFNTz1VdfrGerYI8+qshgZzQy4a8rvxY2rA0I=; b=QawE1FWF/mmxINi4g0OgFJ5D4EI6bleaY0l5G7MO7k0+H2JH3oHiWsyxXJwv0g4/fXQ2 hU+vX8s7jmPEd22Gz7G2fMK36slEpPVUdiRrCCrN5VUgdoflemSw7WLaojOfKREEY71T UXJPW+2IrE3E9C1FJDSdIRWPXI4+3DSw2zslk5spaDVx49uBBoBnDajJe0VTQ2JUkymG 1lUXAp+Am/ibrGZsR5iDN6f25aLDHF/fIofGxVG7NOYC4WFrtJtqiSstjGLRFfkQ1wDu NAmX6bDiiDbREBfJ8ZDUdNg4vRi/6uZEN+Rxb61erQKj1ib/LchCyS/kGgtzBKKAyOFD xg== 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 32uytmgyyg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 02:34:24 -0400 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07C6YKMu007212; Wed, 12 Aug 2020 06:34:23 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma04wdc.us.ibm.com with ESMTP id 32skp97a92-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 06:34:23 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07C6YJ7414746274 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Aug 2020 06:34:19 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 55E5D13605D; Wed, 12 Aug 2020 06:34:22 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0F42A13605E; Wed, 12 Aug 2020 06:34:20 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.85.71.109]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 12 Aug 2020 06:34:19 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, Anshuman Khandual , "Aneesh Kumar K.V" Subject: [PATCH 02/16] debug_vm_pgtable/ppc64: Avoid setting top bits in radom value Date: Wed, 12 Aug 2020 12:03:44 +0530 Message-Id: <20200812063358.369514-2-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> References: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-11_19:2020-08-11,2020-08-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=903 spamscore=0 phishscore=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 malwarescore=0 priorityscore=1501 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008120047 X-Rspamd-Queue-Id: F40EE100A11D0 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: ppc64 use bit 62 to indicate a pte entry (_PAGE_PTE). Avoid setting that bit in random value. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 086309fb9b6f..4c32063a8acf 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -45,9 +45,12 @@ * pxx_clear() because of how dynamic page table folding works on s390. So * while loading up the entries do not change the lower 4 bits. It does not * have affect any other platform. + * + * Also avoid the 62nd bit on ppc64 that is used to mark a pte entry. */ #define S390_MASK_BITS 4 -#define RANDOM_ORVALUE GENMASK(BITS_PER_LONG - 1, S390_MASK_BITS) +#define PPC_MASK_BITS 2 +#define RANDOM_ORVALUE GENMASK(BITS_PER_LONG - 1 - PPC_MASK_BITS, S390_MASK_BITS) #define RANDOM_NZVALUE GENMASK(7, 0) static void __init pte_basic_tests(unsigned long pfn, pgprot_t prot) From patchwork Wed Aug 12 06:33:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 11710311 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CE3E914F6 for ; Wed, 12 Aug 2020 06:34:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9B0BF20781 for ; Wed, 12 Aug 2020 06:34:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="BEjXLNGY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B0BF20781 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8D29E8D0006; Wed, 12 Aug 2020 02:34:34 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 883118D0001; Wed, 12 Aug 2020 02:34:34 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7C0148D0006; Wed, 12 Aug 2020 02:34:34 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0139.hostedemail.com [216.40.44.139]) by kanga.kvack.org (Postfix) with ESMTP id 68B9C8D0001 for ; Wed, 12 Aug 2020 02:34:34 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 2E5595833 for ; Wed, 12 Aug 2020 06:34:34 +0000 (UTC) X-FDA: 77140952868.04.cub93_400ee1c26fe9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id F233D8010C1F for ; Wed, 12 Aug 2020 06:34:33 +0000 (UTC) X-Spam-Summary: 1,0,0,81826566f6233133,d41d8cd98f00b204,aneesh.kumar@linux.ibm.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1261:1311:1314:1345:1359:1431:1437:1515:1535:1541:1711:1730:1747:1777:1792:2393:2559:2562:2689:3138:3139:3140:3141:3142:3352:3867:3868:3870:3872:3874:4250:4321:5007:6119:6261:6653:8634:10004:11026:11658:11914:12043:12114:12296:12297:12438:12555:12895:13069:13255:13311:13357:13894:14096:14181:14384:14394:14721:21080:21451:21627:30054:30070,0,RBL:148.163.156.1:@linux.ibm.com:.lbl8.mailshell.net-64.100.201.201 62.2.0.100;04yr6zy4d4174etm87e9gyak6qzn3ypzs8znw5866758rjsdokktu4ny63o8f6j.y9p4kusdwhqy4mskb3rrw5wmamyxk6doyzt99cyysw5i45qhfpbqu6aicdcbn8e.n-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: cub93_400ee1c26fe9 X-Filterd-Recvd-Size: 5101 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Aug 2020 06:34:33 +0000 (UTC) Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07C6WiLg050542; Wed, 12 Aug 2020 02:34:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=szU68rPUX/AfgNy1BXm8Zx5Os8c/TkQtJ+EKW2ihKoQ=; b=BEjXLNGYi5hE+BzbqAFOqCagLnpTl9PnsU9exSc6gxnGo+xltHx+4k7lMhUKUdsDhKnE xT5WieCxdg85Sd8FJ0V7rbUw0jYVEyrPFFOQ+RHnmRE1+P5m4idy5wOt+t2qijfnuhdG IfourM72OrQ+dUqgo+eLo827yGk0r/c/CJtesYlcV23SuZN6v0GXRU2tObETMbn4MbBa hJjA+gA3k1GZ/VAv11gGQwbLr72L2Oy0ZnH94lX4H2+J9BwFPRjGMvAqO09MItaL2QVp LHSwR1QSJ5850epg7leiBuiVTvahHte8e0oa/kJSQZcTYCfky/BHUm3uPpbW33CPeCCu 1A== 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 32v7nyvsty-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 02:34:27 -0400 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07C6YKMv007212; Wed, 12 Aug 2020 06:34:26 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 32skp97a9b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 06:34:26 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07C6YPbf66126238 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Aug 2020 06:34:25 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1BF4913604F; Wed, 12 Aug 2020 06:34:25 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E319F136059; Wed, 12 Aug 2020 06:34:22 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.85.71.109]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 12 Aug 2020 06:34:22 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, Anshuman Khandual , "Aneesh Kumar K.V" Subject: [PATCH 03/16] debug_vm_pgtable/set_pte: Don't use set_pte_at to update an existing pte entry Date: Wed, 12 Aug 2020 12:03:45 +0530 Message-Id: <20200812063358.369514-3-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> References: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-11_19:2020-08-11,2020-08-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 clxscore=1015 adultscore=0 mlxlogscore=674 lowpriorityscore=0 suspectscore=0 mlxscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008120047 X-Rspamd-Queue-Id: F233D8010C1F X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: set_pte_at() should not be used to set a pte entry at locations that already holds a valid pte entry. Architectures like ppc64 don't do TLB invalidate in set_pte_at() and hence expect it to be used to set locations that are not a valid PTE. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 4c32063a8acf..02a7c20aa4a2 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -81,8 +81,6 @@ static void __init pte_advanced_tests(struct mm_struct *mm, pte = ptep_get(ptep); WARN_ON(pte_write(pte)); - pte = pfn_pte(pfn, prot); - set_pte_at(mm, vaddr, ptep, pte); ptep_get_and_clear(mm, vaddr, ptep); pte = ptep_get(ptep); WARN_ON(!pte_none(pte)); @@ -97,12 +95,14 @@ static void __init pte_advanced_tests(struct mm_struct *mm, pte = ptep_get(ptep); WARN_ON(!(pte_write(pte) && pte_dirty(pte))); - pte = pfn_pte(pfn, prot); - set_pte_at(mm, vaddr, ptep, pte); ptep_get_and_clear_full(mm, vaddr, ptep, 1); pte = ptep_get(ptep); WARN_ON(!pte_none(pte)); + /* + * We should clear pte before we do set_pte_at + */ + pte = ptep_get_and_clear(mm, vaddr, ptep); pte = pte_mkyoung(pte); set_pte_at(mm, vaddr, ptep, pte); ptep_test_and_clear_young(vma, vaddr, ptep); From patchwork Wed Aug 12 06:33:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 11710313 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4C66614F6 for ; Wed, 12 Aug 2020 06:34:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 18FEB20768 for ; Wed, 12 Aug 2020 06:34:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="Kh4/a+qN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 18FEB20768 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B92348D0007; Wed, 12 Aug 2020 02:34:36 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B6E158D0001; Wed, 12 Aug 2020 02:34:36 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A5A058D0007; Wed, 12 Aug 2020 02:34:36 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0120.hostedemail.com [216.40.44.120]) by kanga.kvack.org (Postfix) with ESMTP id 942CA8D0001 for ; Wed, 12 Aug 2020 02:34:36 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 5E10840CD for ; Wed, 12 Aug 2020 06:34:36 +0000 (UTC) X-FDA: 77140952952.09.owner18_111101126fe9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id 3925A180AD80F for ; Wed, 12 Aug 2020 06:34:36 +0000 (UTC) X-Spam-Summary: 1,0,0,5aaee56708c9ec7d,d41d8cd98f00b204,aneesh.kumar@linux.ibm.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1261:1311:1314:1345:1359:1431:1437:1515:1534:1539:1568:1711:1714:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3865:3867:4250:4321:5007:6119:6261:6653:8634:10004:11026:11473:11658:11914:12043:12114:12297:12438:12555:12895:13069:13255:13311:13357:13894:14181:14384:14394:14721:21080:21451:21627:21990:30054,0,RBL:148.163.156.1:@linux.ibm.com:.lbl8.mailshell.net-64.100.201.201 62.2.0.100;04y81bajh4errf6tm7nixymq4emcnopawodfbxkwyrun74gbp67ygw7a44a7b8p.xq3bbp4w6jjq4eohjcg9tmqawisc9tsfzu4buxebrqwxdownobyy7h1d6t99ahx.w-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: owner18_111101126fe9 X-Filterd-Recvd-Size: 4381 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Aug 2020 06:34:35 +0000 (UTC) Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07C6WlRc050790; Wed, 12 Aug 2020 02:34:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=wEElQX4SU8TSF/GkEsuENMhr5H68yIhbg7IIcZiA7IQ=; b=Kh4/a+qN3TVrQFUvQGh5wDGpFvVdubXW6gENRbtPVL3bItuggOxG4Qebbsf92nemsnUa 1+0YEw2lW3fT1lAxKxx+AAEOE1oFzxB9s1JUwYzErQGje/4ttGLkCoHxftUK6Tvp13vq aThn6zGfEPzhbVCCR+CB6koJ0STdDY4PZWHkS3r81ex5M1zjOLiZ2Oxaohm8SV7MjR8v BmUfZWFdDOMG0g9IyFvXEEex9A0llXKioHiVaG75R3052Ukq46g93JZ37hq6u8V2ubfG IdlfefO0zTMaz58wRpklW0zHRl29UcI4J0GaB19mC1BugmiKmPZKRvxSrhg6lS3eTC0j xg== Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0a-001b2d01.pphosted.com with ESMTP id 32v7nyvsuy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 02:34:30 -0400 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07C6FuCn023227; Wed, 12 Aug 2020 06:34:29 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma02wdc.us.ibm.com with ESMTP id 32skp97ccp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 06:34:29 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07C6YPLI26214966 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Aug 2020 06:34:25 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1073F136051; Wed, 12 Aug 2020 06:34:28 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9E9E213604F; Wed, 12 Aug 2020 06:34:25 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.85.71.109]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 12 Aug 2020 06:34:25 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, Anshuman Khandual , "Aneesh Kumar K.V" Subject: [PATCH 04/16] debug_vm_pgtables/hugevmap: Use the arch helper to identify huge vmap support. Date: Wed, 12 Aug 2020 12:03:46 +0530 Message-Id: <20200812063358.369514-4-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> References: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-11_19:2020-08-11,2020-08-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 clxscore=1015 adultscore=0 mlxlogscore=999 lowpriorityscore=0 suspectscore=0 mlxscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008120047 X-Rspamd-Queue-Id: 3925A180AD80F X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: ppc64 supports huge vmap only with radix translation. Hence use arch helper to determine the huge vmap support. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 02a7c20aa4a2..679bb3d289a3 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -206,7 +206,7 @@ static void __init pmd_huge_tests(pmd_t *pmdp, unsigned long pfn, pgprot_t prot) { pmd_t pmd; - if (!IS_ENABLED(CONFIG_HAVE_ARCH_HUGE_VMAP)) + if (!arch_ioremap_pmd_supported()) return; pr_debug("Validating PMD huge\n"); From patchwork Wed Aug 12 06:33:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 11710315 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 84CF413B1 for ; Wed, 12 Aug 2020 06:34:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 51AF120768 for ; Wed, 12 Aug 2020 06:34:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="osAv2Jy+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 51AF120768 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 180DD8D0008; Wed, 12 Aug 2020 02:34:40 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 10A2C8D0001; Wed, 12 Aug 2020 02:34:40 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F3A2C8D0008; Wed, 12 Aug 2020 02:34:39 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0146.hostedemail.com [216.40.44.146]) by kanga.kvack.org (Postfix) with ESMTP id DE7E28D0001 for ; Wed, 12 Aug 2020 02:34:39 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 9C6E852C5 for ; Wed, 12 Aug 2020 06:34:39 +0000 (UTC) X-FDA: 77140953078.11.board00_5e093d026fe9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id 6BA9C180F8B80 for ; Wed, 12 Aug 2020 06:34:39 +0000 (UTC) X-Spam-Summary: 1,0,0,69459c34d65e9e2f,d41d8cd98f00b204,aneesh.kumar@linux.ibm.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1261:1311:1314:1345:1359:1431:1437:1515:1535:1542:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3871:3872:3874:4250:4321:5007:6119:6261:6653:7903:8634:10004:11026:11473:11658:11914:12043:12114:12296:12297:12438:12555:12895:12986:13255:13894:14096:14181:14394:14721:21080:21433:21451:21627:30054:30070,0,RBL:148.163.156.1:@linux.ibm.com:.lbl8.mailshell.net-64.100.201.201 62.2.0.100;04yrtrp5iyuhk5a5gymoygds975b9ycxozb37pjqyoa9m697gfpb5tsmdj6jh1x.41n5dcg4jebshu5pupbk6pudtxx3abeo6z3tp6oum8hqswq7apggk5fsodaadtw.y-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: board00_5e093d026fe9 X-Filterd-Recvd-Size: 5982 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Aug 2020 06:34:38 +0000 (UTC) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07C6Wv6u021056; Wed, 12 Aug 2020 02:34:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=w2O0K40T6vFDlHS9Tu0UhSkYgj6D2CMlRHQso96e5oc=; b=osAv2Jy+u5kF0W8VcMi2QA1CBTpAOIbHJbYbZBztRwOULjIR2zJlmMixHM7uaEH8dBq5 KJtndtEGt/Rtt2zKdPYXxDyuUmKcqXfpfivIpVpvN0psBGfuaEUwTKMeEmEUd0ztHt6H MprCilfNDn/nt78kekAMEz3QbjtVwLrWzGvi8vESPrN71esdcX8xnQkwUIzc3ly4aj81 zhBqBMhmMlLFMJlgjeCYraFwz968WNPRseNa9gSDuNRQIcel6WWSlFVhHlA5Y/6cZA69 9Hu4cdy0F3e7fFMHdyDg1mf2blZiXOUDpChO3dedyPv9P5hRiYy6/82V/g6O5W6P8jlP Kw== Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 32vakp106w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 02:34:33 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07C6GFUf027849; Wed, 12 Aug 2020 06:34:32 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma01dal.us.ibm.com with ESMTP id 32skp9f6j0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 06:34:32 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07C6YVm063701326 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Aug 2020 06:34:31 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0EBB2136051; Wed, 12 Aug 2020 06:34:31 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AFC02136053; Wed, 12 Aug 2020 06:34:28 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.85.71.109]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 12 Aug 2020 06:34:28 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, Anshuman Khandual , "Aneesh Kumar K.V" Subject: [PATCH 05/16] debug_vm_pgtable/savedwrite: Enable savedwrite test with CONFIG_NUMA_BALANCING Date: Wed, 12 Aug 2020 12:03:47 +0530 Message-Id: <20200812063358.369514-5-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> References: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-11_19:2020-08-11,2020-08-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 adultscore=0 impostorscore=0 phishscore=0 mlxlogscore=862 lowpriorityscore=0 bulkscore=0 spamscore=0 malwarescore=0 suspectscore=0 clxscore=1015 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008120047 X-Rspamd-Queue-Id: 6BA9C180F8B80 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Saved write support was added to track the write bit of a pte after marking the pte protnone. This was done so that AUTONUMA can convert a write pte to protnone and still track the old write bit. When converting it back we set the pte write bit correctly thereby avoiding a write fault again. Hence enable the test only when CONFIG_NUMA_BALANCING is enabled. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 679bb3d289a3..de8a62d0a931 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -110,6 +110,7 @@ static void __init pte_advanced_tests(struct mm_struct *mm, WARN_ON(pte_young(pte)); } +#ifdef CONFIG_NUMA_BALANCING static void __init pte_savedwrite_tests(unsigned long pfn, pgprot_t prot) { pte_t pte = pfn_pte(pfn, prot); @@ -118,6 +119,8 @@ static void __init pte_savedwrite_tests(unsigned long pfn, pgprot_t prot) WARN_ON(!pte_savedwrite(pte_mk_savedwrite(pte_clear_savedwrite(pte)))); WARN_ON(pte_savedwrite(pte_clear_savedwrite(pte_mk_savedwrite(pte)))); } +#endif + #ifdef CONFIG_TRANSPARENT_HUGEPAGE static void __init pmd_basic_tests(unsigned long pfn, pgprot_t prot) { @@ -221,6 +224,7 @@ static void __init pmd_huge_tests(pmd_t *pmdp, unsigned long pfn, pgprot_t prot) WARN_ON(!pmd_none(pmd)); } +#ifdef CONFIG_NUMA_BALANCING static void __init pmd_savedwrite_tests(unsigned long pfn, pgprot_t prot) { pmd_t pmd = pfn_pmd(pfn, prot); @@ -229,6 +233,7 @@ static void __init pmd_savedwrite_tests(unsigned long pfn, pgprot_t prot) WARN_ON(!pmd_savedwrite(pmd_mk_savedwrite(pmd_clear_savedwrite(pmd)))); WARN_ON(pmd_savedwrite(pmd_clear_savedwrite(pmd_mk_savedwrite(pmd)))); } +#endif #ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD static void __init pud_basic_tests(unsigned long pfn, pgprot_t prot) @@ -1005,8 +1010,10 @@ static int __init debug_vm_pgtable(void) pmd_huge_tests(pmdp, pmd_aligned, prot); pud_huge_tests(pudp, pud_aligned, prot); +#ifdef CONFIG_NUMA_BALANCING pte_savedwrite_tests(pte_aligned, prot); pmd_savedwrite_tests(pmd_aligned, prot); +#endif pte_unmap_unlock(ptep, ptl); From patchwork Wed Aug 12 06:33:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 11710317 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 83F5F14F6 for ; Wed, 12 Aug 2020 06:34:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 508A720768 for ; Wed, 12 Aug 2020 06:34:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="Yz0FNgU5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 508A720768 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E02CC8D0009; Wed, 12 Aug 2020 02:34:42 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id DDAFF8D0001; Wed, 12 Aug 2020 02:34:42 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CF4E38D0009; Wed, 12 Aug 2020 02:34:42 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0171.hostedemail.com [216.40.44.171]) by kanga.kvack.org (Postfix) with ESMTP id AE78B8D0001 for ; Wed, 12 Aug 2020 02:34:42 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 6CBD1584C for ; Wed, 12 Aug 2020 06:34:42 +0000 (UTC) X-FDA: 77140953204.20.ghost97_4801b3d26fe9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 3BA26180C07A3 for ; Wed, 12 Aug 2020 06:34:42 +0000 (UTC) X-Spam-Summary: 1,0,0,bf514068a88505ee,d41d8cd98f00b204,aneesh.kumar@linux.ibm.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1261:1311:1314:1345:1359:1431:1437:1515:1535:1541:1711:1730:1747:1777:1792:2393:2559:2562:2689:3138:3139:3140:3141:3142:3352:3865:3867:4321:4605:5007:6119:6261:6653:7903:8634:10004:11026:11473:11658:11914:12114:12296:12297:12438:12555:12895:13069:13255:13311:13357:13894:14096:14181:14384:14394:14721:21080:21451:21627:21990:30054,0,RBL:148.163.156.1:@linux.ibm.com:.lbl8.mailshell.net-64.100.201.201 62.2.0.100;04y8mcfo5zp5y56bfq891yu6e6h8coptmdb68ouns7ot7o6ooh7d1dp7wtjnw4u.dqedyziufpak6144pbx7mmzoefm6iwo7k6rrw441bgiyuebd7h5bspg3qy7ab1n.g-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: ghost97_4801b3d26fe9 X-Filterd-Recvd-Size: 5100 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Aug 2020 06:34:41 +0000 (UTC) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07C6Weh2102564; Wed, 12 Aug 2020 02:34:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=au96KxPyhYMSxa3OakSfB4kXUx13ETnjvuPIjxtgYs0=; b=Yz0FNgU5J7QjqqpOKx+0GlNjl7Xv56vz86L3bYoMsbor/gldfRY/agO5RMul2jP4Wm3T Va1AfZy2DhwYGfCGg5vFo0b9L278EGXQYFqQyCgxaTGS2MXyrb+YDYJzHfM1ZSkWKnAt Lc6IMiL5eCiFDdjfnvO6nHNcJCFhZEQnEpMk4GtzDzWoAe2RJmXJ+1TXLDFR0PW52XSi ngie6CmhfOXHSuhaE9YiGRsKpcwRT6xxjyX3jrGmc2FDh7h0VkbM9DbXKl0QJagD+yB1 S6w8mdtAk3ADmK5ZVAyZ/tfx+wv5CxcBDwLKp6mHyNiEbXWtJ+1V2n+faFBxhDhoVm5c ww== Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 32uytmh048-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 02:34:36 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07C6F79w009601; Wed, 12 Aug 2020 06:34:35 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma03dal.us.ibm.com with ESMTP id 32skp977ec-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 06:34:35 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07C6YU6O37880254 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Aug 2020 06:34:30 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E5905136059; Wed, 12 Aug 2020 06:34:33 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8EC8F13604F; Wed, 12 Aug 2020 06:34:31 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.85.71.109]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 12 Aug 2020 06:34:31 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, Anshuman Khandual , "Aneesh Kumar K.V" Subject: [PATCH 06/16] debug_vm_pgtable/THP: Mark the pte entry huge before using set_pmd_at Date: Wed, 12 Aug 2020 12:03:48 +0530 Message-Id: <20200812063358.369514-6-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> References: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-11_19:2020-08-11,2020-08-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 spamscore=0 phishscore=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 malwarescore=0 priorityscore=1501 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008120047 X-Rspamd-Queue-Id: 3BA26180C07A3 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: kernel expect entries to be marked huge before we use set_pmd_at(). Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index de8a62d0a931..b6aca2526e01 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -149,7 +149,7 @@ static void __init pmd_advanced_tests(struct mm_struct *mm, unsigned long pfn, unsigned long vaddr, pgprot_t prot) { - pmd_t pmd = pfn_pmd(pfn, prot); + pmd_t pmd; if (!has_transparent_hugepage()) return; @@ -158,19 +158,19 @@ static void __init pmd_advanced_tests(struct mm_struct *mm, /* Align the address wrt HPAGE_PMD_SIZE */ vaddr = (vaddr & HPAGE_PMD_MASK) + HPAGE_PMD_SIZE; - pmd = pfn_pmd(pfn, prot); + pmd = pmd_mkhuge(pfn_pmd(pfn, prot)); set_pmd_at(mm, vaddr, pmdp, pmd); pmdp_set_wrprotect(mm, vaddr, pmdp); pmd = READ_ONCE(*pmdp); WARN_ON(pmd_write(pmd)); - pmd = pfn_pmd(pfn, prot); + pmd = pmd_mkhuge(pfn_pmd(pfn, prot)); set_pmd_at(mm, vaddr, pmdp, pmd); pmdp_huge_get_and_clear(mm, vaddr, pmdp); pmd = READ_ONCE(*pmdp); WARN_ON(!pmd_none(pmd)); - pmd = pfn_pmd(pfn, prot); + pmd = pmd_mkhuge(pfn_pmd(pfn, prot)); pmd = pmd_wrprotect(pmd); pmd = pmd_mkclean(pmd); set_pmd_at(mm, vaddr, pmdp, pmd); From patchwork Wed Aug 12 06:33:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 11710319 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8454E13B1 for ; Wed, 12 Aug 2020 06:34:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4735420768 for ; Wed, 12 Aug 2020 06:34:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="ASqc5sEy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4735420768 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 306778D000A; Wed, 12 Aug 2020 02:34:47 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2676B8D0001; Wed, 12 Aug 2020 02:34:47 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 12FF58D000A; Wed, 12 Aug 2020 02:34:47 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0091.hostedemail.com [216.40.44.91]) by kanga.kvack.org (Postfix) with ESMTP id E53878D0001 for ; Wed, 12 Aug 2020 02:34:46 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A9E81181AEF1A for ; Wed, 12 Aug 2020 06:34:46 +0000 (UTC) X-FDA: 77140953372.10.voice79_480d4b026fe9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 7313C16A4AD for ; Wed, 12 Aug 2020 06:34:46 +0000 (UTC) X-Spam-Summary: 1,0,0,15ca8f5e96d07a3d,d41d8cd98f00b204,aneesh.kumar@linux.ibm.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1261:1311:1314:1345:1359:1431:1437:1515:1535:1541:1711:1730:1747:1777:1792:2393:2559:2562:2689:3138:3139:3140:3141:3142:3352:3865:3867:4321:4605:5007:6119:6261:6653:7903:8634:10004:11026:11473:11658:11914:12043:12114:12296:12297:12438:12555:12895:13069:13255:13311:13357:13894:14096:14181:14384:14394:14721:21080:21451:21627:21990:30054,0,RBL:148.163.158.5:@linux.ibm.com:.lbl8.mailshell.net-62.2.0.100 64.100.201.201;04yf5opcaid3ghwjcoebnyutk3yphycyu3suetsyqc5euhar44c8dkryeg71n7a.b6qkibb54us85zy1yattwttqiu3ahakwdezupbzsgajgr4pdq79fkdwk97yfpyj.4-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: voice79_480d4b026fe9 X-Filterd-Recvd-Size: 5369 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Aug 2020 06:34:45 +0000 (UTC) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07C6W43o103228; Wed, 12 Aug 2020 02:34:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=oT8owc/FxXk+Quf/+EJdK0oP43wbSs4e+VpmBc7KWGI=; b=ASqc5sEyK4SKYSpqxq5kUcp3NTnf8AGbKsvtkshy7sG90lLZWGFbAh4XkJtGbHtVjv04 D7mBY67m+LCe5X9glFruxX45gDkssGYWE+deTSf+MvMPfBGMJo/EvmygrrtuBfvb2yDk maokU9LvChRIsTQzWyPk+SxwS9nWUQXHwIGk0QqLVv0LoVo5dwSJ/1t92hBbk9f8/6q3 KHZt7zqg42fZLA0LpI8Ods0ilF3it5fp/apoM/G273IRwMsQozVWqpDWL0HYwnAoUNJ4 2v0ZOfwLRtkwz8T+EUNGQ21+yYyas4DlMT/KtD6jpLsw/W9nu763gznvx2cGly+cXL4K 7A== Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0b-001b2d01.pphosted.com with ESMTP id 32uqp3s8yk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 02:34:38 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07C6GE1i027839; Wed, 12 Aug 2020 06:34:38 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma01dal.us.ibm.com with ESMTP id 32skp9f6jq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 06:34:38 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07C6YYd023527734 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Aug 2020 06:34:34 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D5F9813604F; Wed, 12 Aug 2020 06:34:36 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8579C136053; Wed, 12 Aug 2020 06:34:34 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.85.71.109]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 12 Aug 2020 06:34:34 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, Anshuman Khandual , "Aneesh Kumar K.V" Subject: [PATCH 07/16] debug_vm_pgtable/THP: Mark the pte entry huge before using set_pud_at Date: Wed, 12 Aug 2020 12:03:49 +0530 Message-Id: <20200812063358.369514-7-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> References: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-11_19:2020-08-11,2020-08-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 spamscore=0 priorityscore=1501 mlxscore=0 impostorscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 adultscore=0 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008120044 X-Rspamd-Queue-Id: 7313C16A4AD X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: kernel expect entries to be marked huge before we use set_pud_at(). Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index b6aca2526e01..cd609a212dd4 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -265,7 +265,7 @@ static void __init pud_advanced_tests(struct mm_struct *mm, unsigned long pfn, unsigned long vaddr, pgprot_t prot) { - pud_t pud = pfn_pud(pfn, prot); + pud_t pud; if (!has_transparent_hugepage()) return; @@ -274,25 +274,28 @@ static void __init pud_advanced_tests(struct mm_struct *mm, /* Align the address wrt HPAGE_PUD_SIZE */ vaddr = (vaddr & HPAGE_PUD_MASK) + HPAGE_PUD_SIZE; + pud = pud_mkhuge(pfn_pud(pfn, prot)); set_pud_at(mm, vaddr, pudp, pud); pudp_set_wrprotect(mm, vaddr, pudp); pud = READ_ONCE(*pudp); WARN_ON(pud_write(pud)); #ifndef __PAGETABLE_PMD_FOLDED - pud = pfn_pud(pfn, prot); + + pud = pud_mkhuge(pfn_pud(pfn, prot)); set_pud_at(mm, vaddr, pudp, pud); pudp_huge_get_and_clear(mm, vaddr, pudp); pud = READ_ONCE(*pudp); WARN_ON(!pud_none(pud)); - pud = pfn_pud(pfn, prot); + pud = pud_mkhuge(pfn_pud(pfn, prot)); set_pud_at(mm, vaddr, pudp, pud); pudp_huge_get_and_clear_full(mm, vaddr, pudp, 1); pud = READ_ONCE(*pudp); WARN_ON(!pud_none(pud)); #endif /* __PAGETABLE_PMD_FOLDED */ - pud = pfn_pud(pfn, prot); + + pud = pud_mkhuge(pfn_pud(pfn, prot)); pud = pud_wrprotect(pud); pud = pud_mkclean(pud); set_pud_at(mm, vaddr, pudp, pud); From patchwork Wed Aug 12 06:33:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 11710321 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E2D4213B1 for ; Wed, 12 Aug 2020 06:34:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A36E120768 for ; Wed, 12 Aug 2020 06:34:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="Rj5Vyz9/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A36E120768 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 68C9B8D000B; Wed, 12 Aug 2020 02:34:48 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 578E98D0001; Wed, 12 Aug 2020 02:34:48 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 32E848D000B; Wed, 12 Aug 2020 02:34:48 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0174.hostedemail.com [216.40.44.174]) by kanga.kvack.org (Postfix) with ESMTP id 07D2F8D0001 for ; Wed, 12 Aug 2020 02:34:48 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 816FB8248047 for ; Wed, 12 Aug 2020 06:34:47 +0000 (UTC) X-FDA: 77140953414.15.joke21_0b0930c26fe9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id 57B301814B0C1 for ; Wed, 12 Aug 2020 06:34:47 +0000 (UTC) X-Spam-Summary: 1,0,0,bab0d03936c99ff3,d41d8cd98f00b204,aneesh.kumar@linux.ibm.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1261:1311:1314:1345:1359:1431:1437:1515:1535:1541:1711:1730:1747:1777:1792:2393:2559:2562:2689:3138:3139:3140:3141:3142:3352:3867:3868:3870:3872:3874:4250:4321:5007:6119:6120:6261:6653:7901:8634:10004:11026:11658:11914:12043:12114:12296:12297:12438:12555:12895:13069:13255:13311:13357:13894:14096:14181:14384:14394:14721:21080:21451:21627:30054:30070,0,RBL:148.163.158.5:@linux.ibm.com:.lbl8.mailshell.net-62.2.0.100 64.100.201.201;04yrn5qqwsysozqei1zot8wo8d4kdypx4re3uc3hebqdax9f15kwqj1jowztgc9.bpdq9nkzm8rxhekchkqmyrnboogo6yjwh5e3ru7sftdatsoqp9fc8pe6o7ogdii.r-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: joke21_0b0930c26fe9 X-Filterd-Recvd-Size: 5075 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Aug 2020 06:34:46 +0000 (UTC) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07C6W8hB192164; Wed, 12 Aug 2020 02:34:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=N28Vl/sog25bvuqRNzOMK32gdfoiIFtQHaSjc0Dgk8c=; b=Rj5Vyz9/9ro1crW2R0Mvieastwbn4vlAKaOgKZamD7xiDNsNwTJOD4eXFsdI6S2PWURs xdVWDNXcph8U366EHqGkoJFU9Yxc1ck4NmoS92FJgpVB2/zq9eQZ5fmEbDGlAOUK3N7i jECtcCVBUq8KAIAzZhvS/XCVphDZ5vfs81fkPpGCDRc56J+DMZ5st7H+KvtoGZZfGC+I 6Wj8aXuBr58cHqraqeevRS4A10prStHamcSp+JbaFjxSB1tt/UuEUp8ZzxVk44qGFa1a eDiMXo3DKvnYIlso/gEqgCx6v092YxYK6js7URC4zB6HfHLaCluT4Bug1ctFXzkhMfFw DA== Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0b-001b2d01.pphosted.com with ESMTP id 32v7utv6hr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 02:34:41 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07C6F6qb009593; Wed, 12 Aug 2020 06:34:41 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma03dal.us.ibm.com with ESMTP id 32skp977f1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 06:34:41 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07C6YZBM66126176 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Aug 2020 06:34:36 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D6ECD13604F; Wed, 12 Aug 2020 06:34:39 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 67DD5136051; Wed, 12 Aug 2020 06:34:37 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.85.71.109]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 12 Aug 2020 06:34:37 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, Anshuman Khandual , "Aneesh Kumar K.V" Subject: [PATCH 08/16] debug_vm_pgtable/set_pmd: Don't use set_pmd_at to update an existing pmd entry Date: Wed, 12 Aug 2020 12:03:50 +0530 Message-Id: <20200812063358.369514-8-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> References: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-11_19:2020-08-11,2020-08-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 malwarescore=0 adultscore=0 phishscore=0 impostorscore=0 mlxlogscore=674 lowpriorityscore=0 clxscore=1015 mlxscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008120044 X-Rspamd-Queue-Id: 57B301814B0C1 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: set_pmd_at() should not be used to set a pte entry at locations that already holds a valid pte entry. Architectures like ppc64 don't do TLB invalidate in set_pmd_at() and hence expect it to be used to set locations that are not a valid PTE. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index cd609a212dd4..60bf876081b8 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -164,8 +164,6 @@ static void __init pmd_advanced_tests(struct mm_struct *mm, pmd = READ_ONCE(*pmdp); WARN_ON(pmd_write(pmd)); - pmd = pmd_mkhuge(pfn_pmd(pfn, prot)); - set_pmd_at(mm, vaddr, pmdp, pmd); pmdp_huge_get_and_clear(mm, vaddr, pmdp); pmd = READ_ONCE(*pmdp); WARN_ON(!pmd_none(pmd)); @@ -180,12 +178,11 @@ static void __init pmd_advanced_tests(struct mm_struct *mm, pmd = READ_ONCE(*pmdp); WARN_ON(!(pmd_write(pmd) && pmd_dirty(pmd))); - pmd = pmd_mkhuge(pfn_pmd(pfn, prot)); - set_pmd_at(mm, vaddr, pmdp, pmd); pmdp_huge_get_and_clear_full(vma, vaddr, pmdp, 1); pmd = READ_ONCE(*pmdp); WARN_ON(!pmd_none(pmd)); + pmd = pmd_mkhuge(pfn_pmd(pfn, prot)); pmd = pmd_mkyoung(pmd); set_pmd_at(mm, vaddr, pmdp, pmd); pmdp_test_and_clear_young(vma, vaddr, pmdp); From patchwork Wed Aug 12 06:33:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 11710323 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1F8AA13B1 for ; Wed, 12 Aug 2020 06:34:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D946820768 for ; Wed, 12 Aug 2020 06:34:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="IrdEkC7I" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D946820768 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 883978D000C; Wed, 12 Aug 2020 02:34:52 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 812F38D0001; Wed, 12 Aug 2020 02:34:52 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 639918D000C; Wed, 12 Aug 2020 02:34:52 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0121.hostedemail.com [216.40.44.121]) by kanga.kvack.org (Postfix) with ESMTP id 48B898D0001 for ; Wed, 12 Aug 2020 02:34:52 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 01899180AD80F for ; Wed, 12 Aug 2020 06:34:52 +0000 (UTC) X-FDA: 77140953624.24.cable25_5d04a8626fe9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id CF1A31A4A0 for ; Wed, 12 Aug 2020 06:34:51 +0000 (UTC) X-Spam-Summary: 1,0,0,e5a98fa22c8fa620,d41d8cd98f00b204,aneesh.kumar@linux.ibm.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1261:1311:1314:1345:1359:1431:1437:1515:1535:1541:1711:1730:1747:1777:1792:2393:2559:2562:2689:3138:3139:3140:3141:3142:3352:3867:3868:3870:3872:3874:4250:4321:5007:6119:6261:6653:8634:9592:10004:11026:11473:11658:11914:12043:12114:12296:12297:12438:12555:12895:13069:13255:13311:13357:13894:14096:14181:14384:14394:14721:21080:21451:21611:21627:30054:30070,0,RBL:148.163.156.1:@linux.ibm.com:.lbl8.mailshell.net-64.100.201.201 62.2.0.100;04yfriqs9hs5o8aw5bybjetrifye1oca5j4sra6zbgtyz7whodte3eg36brhus4.x7yqzr57rgus8djry5a8tw3tc8sy88kuoo1s6m87737ufehxdxa8gabk9pi3sdz.y-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: cable25_5d04a8626fe9 X-Filterd-Recvd-Size: 5011 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Aug 2020 06:34:51 +0000 (UTC) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07C6WvIW167339; Wed, 12 Aug 2020 02:34:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=SQ4C72HHWlSHM+9+6/yaE6PBuXHCkFKzcrZXPOYeWpQ=; b=IrdEkC7Ix7I/2GkBN+MjfHdnhaClfw95ZoFPJjf1s8bTHpZo3gIXSF+zfvgYo6PJPUbW VO+M3ALIZIaNdPmZJ9G/Eu5+FfNtqFuomrXGpnhjtiBLpLrakWtOYRozLC56hL8hhogl njHVb8+M+R3+I7pAe4/1+AnopzjXf+6HGVnSJQAYhhCFtqn7ChBwzmmfTAKb467A7T99 TwYxBrvLA5zYWZdI8qk8eYs50Ae61HYkKVO4hmYZlDcSnkYUqBYcc40UYOzVk1o/GJPa C5UMfIKoIdoDejFrPoOS+NfHPWnt6OUpucEkGslMzFFltg+dBHROYin0AGkkDGD3q/Hr gw== Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 32utn8kqan-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 02:34:44 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07C6GHgT028013; Wed, 12 Aug 2020 06:34:44 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma01dal.us.ibm.com with ESMTP id 32skp9f6k9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 06:34:44 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07C6YcRe41746698 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Aug 2020 06:34:38 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B6763136053; Wed, 12 Aug 2020 06:34:42 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6B526136055; Wed, 12 Aug 2020 06:34:40 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.85.71.109]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 12 Aug 2020 06:34:40 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, Anshuman Khandual , "Aneesh Kumar K.V" Subject: [PATCH 09/16] debug_vm_pgtable/set_pud: Don't use set_pud_at to update an existing pud entry Date: Wed, 12 Aug 2020 12:03:51 +0530 Message-Id: <20200812063358.369514-9-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> References: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-11_19:2020-08-11,2020-08-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 spamscore=0 malwarescore=0 bulkscore=0 mlxscore=0 suspectscore=0 mlxlogscore=629 clxscore=1015 impostorscore=0 priorityscore=1501 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008120047 X-Rspamd-Queue-Id: CF1A31A4A0 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: set_pud_at() should not be used to set a pte entry at locations that already holds a valid pte entry. Architectures like ppc64 don't do TLB invalidate in set_pud_at() and hence expect it to be used to set locations that are not a valid PTE. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 60bf876081b8..644d28861ce9 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -278,9 +278,6 @@ static void __init pud_advanced_tests(struct mm_struct *mm, WARN_ON(pud_write(pud)); #ifndef __PAGETABLE_PMD_FOLDED - - pud = pud_mkhuge(pfn_pud(pfn, prot)); - set_pud_at(mm, vaddr, pudp, pud); pudp_huge_get_and_clear(mm, vaddr, pudp); pud = READ_ONCE(*pudp); WARN_ON(!pud_none(pud)); @@ -302,6 +299,11 @@ static void __init pud_advanced_tests(struct mm_struct *mm, pud = READ_ONCE(*pudp); WARN_ON(!(pud_write(pud) && pud_dirty(pud))); + pudp_huge_get_and_clear_full(vma, vaddr, pudp, 1); + pud = READ_ONCE(*pudp); + WARN_ON(!pud_none(pud)); + + pud = pud_mkhuge(pfn_pud(pfn, prot)); pud = pud_mkyoung(pud); set_pud_at(mm, vaddr, pudp, pud); pudp_test_and_clear_young(vma, vaddr, pudp); From patchwork Wed Aug 12 06:33:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 11710325 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9B6113B1 for ; Wed, 12 Aug 2020 06:34:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ABC3520768 for ; Wed, 12 Aug 2020 06:34:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="T3qCkjP7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ABC3520768 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DB41C8D000D; Wed, 12 Aug 2020 02:34:54 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D3E6A8D0001; Wed, 12 Aug 2020 02:34:54 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B906C8D000D; Wed, 12 Aug 2020 02:34:54 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0029.hostedemail.com [216.40.44.29]) by kanga.kvack.org (Postfix) with ESMTP id 9CD838D0001 for ; Wed, 12 Aug 2020 02:34:54 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 64EF340CD for ; Wed, 12 Aug 2020 06:34:54 +0000 (UTC) X-FDA: 77140953708.09.army74_600b16a26fe9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id 3BDE3180AD807 for ; Wed, 12 Aug 2020 06:34:54 +0000 (UTC) X-Spam-Summary: 1,0,0,5be73da04e584fc6,d41d8cd98f00b204,aneesh.kumar@linux.ibm.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1261:1311:1314:1345:1359:1431:1437:1515:1535:1541:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:4321:4605:5007:6119:6261:6653:7903:8634:10004:11026:11473:11658:11914:12043:12114:12216:12296:12297:12438:12555:12895:13069:13311:13357:13894:14096:14181:14384:14394:14721:21080:21451:21611:21627:30054,0,RBL:148.163.156.1:@linux.ibm.com:.lbl8.mailshell.net-64.100.201.201 62.2.0.100;04yr9djhkh8og4m71adig168rigpeycrbzqofb3t7rph65h3r6nwwh6kxs64bmp.hczbtw57nmf4ip6576k57tjwpna9uomwb1qx99xa6mrobgh3m8stjepoi3mrkme.e-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: army74_600b16a26fe9 X-Filterd-Recvd-Size: 5544 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Aug 2020 06:34:53 +0000 (UTC) Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07C63WZx171816; Wed, 12 Aug 2020 02:34:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=RtkaILFdBuX5r44GZ6XLkIS9TWPQdNkQWVgo1kIes1c=; b=T3qCkjP7Wgc/fSLdUuTMcJ+nEipFKIK7u0qbtMXbiw4evukh+B5tHhYbrb+GrFLBrU2S wdEEmcovHWsCyfESQKbw6xrUA/SAz1OHCv9JG8pQn0xfjnmAb9LYhRKiK1HjmcimEbUJ /W5W3+5WJTjLGtTkGt/DYhu3dH/jyvGbxA28tVMbYeh6Qhv7kvdjiqq2iZbpf56/WqaQ 4kWelzNPZiyeFU7XlN6kii4OEhu5bEfmBy5i62CQUlB3o3bl+OKeY73TGlLF4KvqMjdh FQ1oQoy2MlryF9o3OF7vMlpKGqZmYRBItQTqNhsGx88D1gpUzqTDBzMUHqptfVQo7moA fA== Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 32uya7h1gr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 02:34:47 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07C6EwAH013845; Wed, 12 Aug 2020 06:34:46 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma04dal.us.ibm.com with ESMTP id 32skp975sn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 06:34:46 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07C6YfXe57540966 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Aug 2020 06:34:41 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 963BE136055; Wed, 12 Aug 2020 06:34:45 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5823913604F; Wed, 12 Aug 2020 06:34:43 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.85.71.109]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 12 Aug 2020 06:34:43 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, Anshuman Khandual , "Aneesh Kumar K.V" Subject: [PATCH 10/16] debug_vm_pgtable/thp: Use page table depost/withdraw with THP Date: Wed, 12 Aug 2020 12:03:52 +0530 Message-Id: <20200812063358.369514-10-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> References: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-11_19:2020-08-11,2020-08-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 priorityscore=1501 mlxlogscore=999 impostorscore=0 malwarescore=0 phishscore=0 clxscore=1015 mlxscore=0 bulkscore=0 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008120044 X-Rspamd-Queue-Id: 3BDE3180AD807 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Architectures like ppc64 use deposited page table while updating the huge pte entries. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 644d28861ce9..48475d288df1 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -147,7 +147,7 @@ static void __init pmd_basic_tests(unsigned long pfn, pgprot_t prot) static void __init pmd_advanced_tests(struct mm_struct *mm, struct vm_area_struct *vma, pmd_t *pmdp, unsigned long pfn, unsigned long vaddr, - pgprot_t prot) + pgprot_t prot, pgtable_t pgtable) { pmd_t pmd; @@ -158,6 +158,8 @@ static void __init pmd_advanced_tests(struct mm_struct *mm, /* Align the address wrt HPAGE_PMD_SIZE */ vaddr = (vaddr & HPAGE_PMD_MASK) + HPAGE_PMD_SIZE; + pgtable_trans_huge_deposit(mm, pmdp, pgtable); + pmd = pmd_mkhuge(pfn_pmd(pfn, prot)); set_pmd_at(mm, vaddr, pmdp, pmd); pmdp_set_wrprotect(mm, vaddr, pmdp); @@ -188,6 +190,8 @@ static void __init pmd_advanced_tests(struct mm_struct *mm, pmdp_test_and_clear_young(vma, vaddr, pmdp); pmd = READ_ONCE(*pmdp); WARN_ON(pmd_young(pmd)); + + pgtable = pgtable_trans_huge_withdraw(mm, pmdp); } static void __init pmd_leaf_tests(unsigned long pfn, pgprot_t prot) @@ -1002,7 +1006,7 @@ static int __init debug_vm_pgtable(void) pgd_clear_tests(mm, pgdp); pte_advanced_tests(mm, vma, ptep, pte_aligned, vaddr, prot); - pmd_advanced_tests(mm, vma, pmdp, pmd_aligned, vaddr, prot); + pmd_advanced_tests(mm, vma, pmdp, pmd_aligned, vaddr, prot, saved_ptep); pud_advanced_tests(mm, vma, pudp, pud_aligned, vaddr, prot); hugetlb_advanced_tests(mm, vma, ptep, pte_aligned, vaddr, prot); From patchwork Wed Aug 12 06:33:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 11710327 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 88E8914F6 for ; Wed, 12 Aug 2020 06:34:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 55BF720768 for ; Wed, 12 Aug 2020 06:34:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="iAAlSZ+Z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 55BF720768 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A358A8D000E; Wed, 12 Aug 2020 02:34:57 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9953B8D0001; Wed, 12 Aug 2020 02:34:57 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 836B08D000E; Wed, 12 Aug 2020 02:34:57 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0219.hostedemail.com [216.40.44.219]) by kanga.kvack.org (Postfix) with ESMTP id 659128D0001 for ; Wed, 12 Aug 2020 02:34:57 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 29954584D for ; Wed, 12 Aug 2020 06:34:57 +0000 (UTC) X-FDA: 77140953834.08.blow77_261705c26fe9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id EB7A71819E793 for ; Wed, 12 Aug 2020 06:34:56 +0000 (UTC) X-Spam-Summary: 1,0,0,8b73397835c384c2,d41d8cd98f00b204,aneesh.kumar@linux.ibm.com,,RULES_HIT:41:69:355:379:541:800:960:966:973:981:988:989:1260:1261:1311:1314:1345:1359:1431:1437:1515:1535:1543:1711:1730:1747:1777:1792:2196:2199:2393:2559:2562:2693:3138:3139:3140:3141:3142:3354:3865:3870:4117:4321:4385:5007:6117:6261:6653:8634:9592:10004:11026:11473:11658:11914:12043:12114:12291:12297:12438:12555:12683:12895:12986:13255:13894:14096:14110:14181:14394:14721:21080:21451:21627:30054,0,RBL:148.163.156.1:@linux.ibm.com:.lbl8.mailshell.net-64.100.201.201 62.2.0.100;04yryzxg9m7rrexabxia8kgznm6oyopdmq5ucehsg7mjwcy4qeqb815aw984k8x.kypr37b4r7shtj6eny8446nehnt5fxa7tzqx7f37bmtxq3k1znrswd5sgr4t9yr.s-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: blow77_261705c26fe9 X-Filterd-Recvd-Size: 6907 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Aug 2020 06:34:56 +0000 (UTC) Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07C6XBmI057825; Wed, 12 Aug 2020 02:34:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=UKxTyadsK7tBaQtLOqCnvzFvwdpHDDNsgB5JmdYX2U0=; b=iAAlSZ+Z+goFHnSRl5EHaQh1u5wpZnPP/p7okx+avYGWWonzHcskjr4nPlbjGHIgFrhs +9Srbqfqf40fKO7B3sicoWCTbiqrxsqCsKQ8yl/8f9H0LImfRze+EgXiSmZwk0tf81PI ZXOXTVQ9qbVfdXo95tw5Ok2OBaPoHVCzk6gUL1GFNspXcaUtX/Y+1D81wOYNeI+f6dTG szDeASh2DUd0o2Sgh7hmNwu/9PvtRv6VxCOPNvkJBovo2H5ZtFskig84A+VDb1sRDb+k Z56knqL15+2CzuqNjxGWIGq1JpG7RytDLMXLCcD5yfpNgu20u6A1vu/a4XUqTcKA9skO GQ== Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 32srasj19x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 02:34:50 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07C6VKwF027990; Wed, 12 Aug 2020 06:34:49 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma02dal.us.ibm.com with ESMTP id 32skp9f8pa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 06:34:49 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07C6YjWI28049898 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Aug 2020 06:34:45 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 727E813605D; Wed, 12 Aug 2020 06:34:48 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2167513604F; Wed, 12 Aug 2020 06:34:46 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.85.71.109]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 12 Aug 2020 06:34:45 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, Anshuman Khandual , "Aneesh Kumar K.V" Subject: [PATCH 11/16] debug_vm_pgtable/locks: Move non page table modifying test together Date: Wed, 12 Aug 2020 12:03:53 +0530 Message-Id: <20200812063358.369514-11-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> References: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-11_19:2020-08-11,2020-08-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 suspectscore=2 priorityscore=1501 impostorscore=0 bulkscore=0 adultscore=0 malwarescore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008120047 X-Rspamd-Queue-Id: EB7A71819E793 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This will help in adding proper locks in a later patch Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 53 +++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 48475d288df1..90e9c2d3a092 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -979,7 +979,7 @@ static int __init debug_vm_pgtable(void) p4dp = p4d_alloc(mm, pgdp, vaddr); pudp = pud_alloc(mm, p4dp, vaddr); pmdp = pmd_alloc(mm, pudp, vaddr); - ptep = pte_alloc_map_lock(mm, pmdp, vaddr, &ptl); + ptep = pte_alloc_map(mm, pmdp, vaddr); /* * Save all the page table page addresses as the page table @@ -999,35 +999,13 @@ static int __init debug_vm_pgtable(void) p4d_basic_tests(p4d_aligned, prot); pgd_basic_tests(pgd_aligned, prot); - pte_clear_tests(mm, ptep, vaddr); - pmd_clear_tests(mm, pmdp); - pud_clear_tests(mm, pudp); - p4d_clear_tests(mm, p4dp); - pgd_clear_tests(mm, pgdp); - - pte_advanced_tests(mm, vma, ptep, pte_aligned, vaddr, prot); - pmd_advanced_tests(mm, vma, pmdp, pmd_aligned, vaddr, prot, saved_ptep); - pud_advanced_tests(mm, vma, pudp, pud_aligned, vaddr, prot); - hugetlb_advanced_tests(mm, vma, ptep, pte_aligned, vaddr, prot); - pmd_leaf_tests(pmd_aligned, prot); pud_leaf_tests(pud_aligned, prot); - pmd_huge_tests(pmdp, pmd_aligned, prot); - pud_huge_tests(pudp, pud_aligned, prot); - #ifdef CONFIG_NUMA_BALANCING pte_savedwrite_tests(pte_aligned, prot); pmd_savedwrite_tests(pmd_aligned, prot); #endif - - pte_unmap_unlock(ptep, ptl); - - pmd_populate_tests(mm, pmdp, saved_ptep); - pud_populate_tests(mm, pudp, saved_pmdp); - p4d_populate_tests(mm, p4dp, saved_pudp); - pgd_populate_tests(mm, pgdp, saved_p4dp); - pte_special_tests(pte_aligned, prot); pte_protnone_tests(pte_aligned, protnone); pmd_protnone_tests(pmd_aligned, protnone); @@ -1045,11 +1023,38 @@ static int __init debug_vm_pgtable(void) pmd_swap_tests(pmd_aligned, prot); swap_migration_tests(); - hugetlb_basic_tests(pte_aligned, prot); pmd_thp_tests(pmd_aligned, prot); pud_thp_tests(pud_aligned, prot); + /* + * Page table modifying tests + */ + pte_clear_tests(mm, ptep, vaddr); + pmd_clear_tests(mm, pmdp); + pud_clear_tests(mm, pudp); + p4d_clear_tests(mm, p4dp); + pgd_clear_tests(mm, pgdp); + + ptep = pte_alloc_map_lock(mm, pmdp, vaddr, &ptl); + pte_advanced_tests(mm, vma, ptep, pte_aligned, vaddr, prot); + pmd_advanced_tests(mm, vma, pmdp, pmd_aligned, vaddr, prot, saved_ptep); + pud_advanced_tests(mm, vma, pudp, pud_aligned, vaddr, prot); + hugetlb_advanced_tests(mm, vma, ptep, pte_aligned, vaddr, prot); + + + pmd_huge_tests(pmdp, pmd_aligned, prot); + pud_huge_tests(pudp, pud_aligned, prot); + + pte_unmap_unlock(ptep, ptl); + + pmd_populate_tests(mm, pmdp, saved_ptep); + pud_populate_tests(mm, pudp, saved_pmdp); + p4d_populate_tests(mm, p4dp, saved_pudp); + pgd_populate_tests(mm, pgdp, saved_p4dp); + + hugetlb_basic_tests(pte_aligned, prot); + p4d_free(mm, saved_p4dp); pud_free(mm, saved_pudp); pmd_free(mm, saved_pmdp); From patchwork Wed Aug 12 06:33:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 11710329 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 661BD14F6 for ; Wed, 12 Aug 2020 06:35:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3261920768 for ; Wed, 12 Aug 2020 06:35:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="i+KfGCNE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3261920768 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 094DC8D000F; Wed, 12 Aug 2020 02:35:00 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 01E548D0001; Wed, 12 Aug 2020 02:34:59 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D3FD18D000F; Wed, 12 Aug 2020 02:34:59 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0018.hostedemail.com [216.40.44.18]) by kanga.kvack.org (Postfix) with ESMTP id B5B318D0001 for ; Wed, 12 Aug 2020 02:34:59 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7A024181AEF1A for ; Wed, 12 Aug 2020 06:34:59 +0000 (UTC) X-FDA: 77140953918.24.brake89_080c6f426fe9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 50A591A4A0 for ; Wed, 12 Aug 2020 06:34:59 +0000 (UTC) X-Spam-Summary: 1,0,0,6ba6525a8c06bcad,d41d8cd98f00b204,aneesh.kumar@linux.ibm.com,,RULES_HIT:41:69:355:379:541:800:960:966:973:988:989:1260:1261:1311:1314:1345:1359:1431:1437:1515:1535:1542:1711:1730:1747:1777:1792:2196:2199:2393:2559:2562:3138:3139:3140:3141:3142:3353:3876:3877:4321:4385:5007:6114:6119:6261:6642:6653:8634:8660:9592:10004:11026:11658:11914:12043:12114:12291:12297:12438:12555:12683:12895:13148:13230:13894:14096:14110:14181:14394:14721:21080:21451:21627:21939:30054,0,RBL:148.163.158.5:@linux.ibm.com:.lbl8.mailshell.net-64.100.201.201 62.2.0.100;04yfy3bpbt16mrgemirxp1sik4ta3ypunggsx3xuib6cbq38n88s7gjhbjtu65q.gebexmap5h6y455xnx8mikp715pkaxwpyipkoepshq4t6qmjndc5qz47wz9nti6.y-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: brake89_080c6f426fe9 X-Filterd-Recvd-Size: 5879 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Aug 2020 06:34:58 +0000 (UTC) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07C6W7p6022384; Wed, 12 Aug 2020 02:34:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=cJKoBBeoeWgFe0pKzemrKhEmtIMXsehzlPaHAlaxBbA=; b=i+KfGCNEJl7XSJt0jSWn5wwUYw3NmQephvuK54W8RBmEynYva0wR9klbeJ2nCUfLgDo0 jhIEgzZvR1IgZOnP5Soo0+25dwTehSv6VsurDzcd53hRgyI5gwY+1bgHQXKLKhQCDcQy SkXbaoFHcNynhJzHWHTHU4qaS/5u5R5OTQzZqqGOa9t5x9wArsiAE0MEDDq9k3cAbgLP 96A1ZoqoGyKj1/5AbyHL0U1HVir4SD1AoWky5xoo3MIMbOKnMUaYlO4GUs9+kMP9AcwZ vDtmQrBRdKU98XBItLUOdCH4kENsG8BhqHSfq22zK3aG1QrhhOnu37w6BpGNLo4xT9FW 9A== Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0b-001b2d01.pphosted.com with ESMTP id 32v7uyvah2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 02:34:53 -0400 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07C6FtWF023219; Wed, 12 Aug 2020 06:34:52 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma02wdc.us.ibm.com with ESMTP id 32skp97cf0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 06:34:52 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07C6Ylo364553322 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Aug 2020 06:34:47 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 61039136053; Wed, 12 Aug 2020 06:34:51 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 28A0C136055; Wed, 12 Aug 2020 06:34:49 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.85.71.109]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 12 Aug 2020 06:34:48 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, Anshuman Khandual , "Aneesh Kumar K.V" Subject: [PATCH 12/16] debug_vm_pgtable/locks: Take correct page table lock Date: Wed, 12 Aug 2020 12:03:54 +0530 Message-Id: <20200812063358.369514-12-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> References: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-11_19:2020-08-11,2020-08-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 suspectscore=2 mlxscore=0 impostorscore=0 lowpriorityscore=0 spamscore=0 mlxlogscore=999 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008120044 X-Rspamd-Queue-Id: 50A591A4A0 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Make sure we call pte accessors with correct lock held. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 90e9c2d3a092..061c19bba7f0 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -1027,33 +1027,39 @@ static int __init debug_vm_pgtable(void) pmd_thp_tests(pmd_aligned, prot); pud_thp_tests(pud_aligned, prot); + hugetlb_basic_tests(pte_aligned, prot); + /* * Page table modifying tests */ - pte_clear_tests(mm, ptep, vaddr); - pmd_clear_tests(mm, pmdp); - pud_clear_tests(mm, pudp); - p4d_clear_tests(mm, p4dp); - pgd_clear_tests(mm, pgdp); ptep = pte_alloc_map_lock(mm, pmdp, vaddr, &ptl); + pte_clear_tests(mm, ptep, vaddr); pte_advanced_tests(mm, vma, ptep, pte_aligned, vaddr, prot); - pmd_advanced_tests(mm, vma, pmdp, pmd_aligned, vaddr, prot, saved_ptep); - pud_advanced_tests(mm, vma, pudp, pud_aligned, vaddr, prot); - hugetlb_advanced_tests(mm, vma, ptep, pte_aligned, vaddr, prot); - + pte_unmap_unlock(ptep, ptl); + ptl = pmd_lock(mm, pmdp); + pmd_clear_tests(mm, pmdp); + pmd_advanced_tests(mm, vma, pmdp, pmd_aligned, vaddr, prot, saved_ptep); pmd_huge_tests(pmdp, pmd_aligned, prot); + pmd_populate_tests(mm, pmdp, saved_ptep); + spin_unlock(ptl); + + ptl = pud_lock(mm, pudp); + pud_clear_tests(mm, pudp); + pud_advanced_tests(mm, vma, pudp, pud_aligned, vaddr, prot); pud_huge_tests(pudp, pud_aligned, prot); + pud_populate_tests(mm, pudp, saved_pmdp); + spin_unlock(ptl); - pte_unmap_unlock(ptep, ptl); + //hugetlb_advanced_tests(mm, vma, ptep, pte_aligned, vaddr, prot); - pmd_populate_tests(mm, pmdp, saved_ptep); - pud_populate_tests(mm, pudp, saved_pmdp); + spin_lock(&mm->page_table_lock); + p4d_clear_tests(mm, p4dp); + pgd_clear_tests(mm, pgdp); p4d_populate_tests(mm, p4dp, saved_pudp); pgd_populate_tests(mm, pgdp, saved_p4dp); - - hugetlb_basic_tests(pte_aligned, prot); + spin_unlock(&mm->page_table_lock); p4d_free(mm, saved_p4dp); pud_free(mm, saved_pudp); From patchwork Wed Aug 12 06:33:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 11710331 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 65C24109B for ; Wed, 12 Aug 2020 06:35:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 27E9420768 for ; Wed, 12 Aug 2020 06:35:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="DfYPgv4S" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 27E9420768 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 772FD8D0010; Wed, 12 Aug 2020 02:35:03 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6FD978D0001; Wed, 12 Aug 2020 02:35:03 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5C5338D0010; Wed, 12 Aug 2020 02:35:03 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0206.hostedemail.com [216.40.44.206]) by kanga.kvack.org (Postfix) with ESMTP id 3E5378D0001 for ; Wed, 12 Aug 2020 02:35:03 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 02C54181AEF1A for ; Wed, 12 Aug 2020 06:35:03 +0000 (UTC) X-FDA: 77140954086.07.cow27_3e17a2326fe9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id BCF921803F9B2 for ; Wed, 12 Aug 2020 06:35:02 +0000 (UTC) X-Spam-Summary: 1,0,0,5b39307f87c6f2b6,d41d8cd98f00b204,aneesh.kumar@linux.ibm.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1261:1311:1314:1345:1359:1431:1437:1515:1535:1541:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3867:5007:6119:6261:6653:7903:8634:10004:11026:11658:11914:12043:12114:12296:12297:12438:12555:12895:13069:13255:13311:13357:13894:14096:14181:14384:14394:14721:21080:21451:21627:30054,0,RBL:148.163.156.1:@linux.ibm.com:.lbl8.mailshell.net-64.100.201.201 62.2.0.100;04y8g1o5dm71qb7qfuu1xqgtjngn7yc6ygtnsn6d6ahfqikg7wfcz1ajr9msnig.1bgkik5ghtyugf9nj18u8kurn1byz38m9rhu7kt8wfgkwsrhtcqy94gn9otzn3z.a-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: cow27_3e17a2326fe9 X-Filterd-Recvd-Size: 5292 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Aug 2020 06:35:02 +0000 (UTC) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07C6XBe8133004; Wed, 12 Aug 2020 02:34:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=uA4jz9gzKKTbBFabLzOV/2F1mMcHovsWhX7nppVLnIQ=; b=DfYPgv4SulXsFMPfheSOHBxtRS8xkvVP3TTU7CzwcXxB2RIym9C/biFKSawl3jsfnJvi p5kqGKAA0u17gwLpxgC6E/cOFrzbpWkD5fmXboo/sHhfZc2tvRlbaLQF29Fyiqz3C8h6 K+Oju6lxB5hrHYvD0ezXBbvUmuUDrQRbRZIkMvbJsSv//Zj1gl3cilIpidGP4IxJSiwX SnLbijofy4SpbevZrhNHoTmvL/dbet+tz6G0iXtqIKazGUAbhoNGoMq9O9cZi+SiqJWY L3n1bmvOc8p+PdinOVRHwNtthh1isvNzBYMYGfjVNF5acHoLyeYmuH70sdyKgaxk8DnZ gA== Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 32v18464fh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 02:34:56 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07C6VFp7027950; Wed, 12 Aug 2020 06:34:55 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma02dal.us.ibm.com with ESMTP id 32skp9f8q4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 06:34:55 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07C6YssJ37749222 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Aug 2020 06:34:54 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5AE44136053; Wed, 12 Aug 2020 06:34:54 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EB44613604F; Wed, 12 Aug 2020 06:34:51 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.85.71.109]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 12 Aug 2020 06:34:51 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, Anshuman Khandual , "Aneesh Kumar K.V" Subject: [PATCH 13/16] debug_vm_pgtable/pmd_clear: Don't use pmd/pud_clear on pte entries Date: Wed, 12 Aug 2020 12:03:55 +0530 Message-Id: <20200812063358.369514-13-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> References: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-11_19:2020-08-11,2020-08-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 bulkscore=0 priorityscore=1501 phishscore=0 impostorscore=0 suspectscore=0 clxscore=1015 malwarescore=0 mlxscore=0 lowpriorityscore=0 spamscore=0 mlxlogscore=992 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008120044 X-Rspamd-Queue-Id: BCF921803F9B2 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: pmd_clear() should not be used to clear pmd level pte entries. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 061c19bba7f0..529892b9be2f 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -191,6 +191,8 @@ static void __init pmd_advanced_tests(struct mm_struct *mm, pmd = READ_ONCE(*pmdp); WARN_ON(pmd_young(pmd)); + /* Clear the pte entries */ + pmdp_huge_get_and_clear(mm, vaddr, pmdp); pgtable = pgtable_trans_huge_withdraw(mm, pmdp); } @@ -313,6 +315,8 @@ static void __init pud_advanced_tests(struct mm_struct *mm, pudp_test_and_clear_young(vma, vaddr, pudp); pud = READ_ONCE(*pudp); WARN_ON(pud_young(pud)); + + pudp_huge_get_and_clear(mm, vaddr, pudp); } static void __init pud_leaf_tests(unsigned long pfn, pgprot_t prot) @@ -431,8 +435,6 @@ static void __init pud_populate_tests(struct mm_struct *mm, pud_t *pudp, * This entry points to next level page table page. * Hence this must not qualify as pud_bad(). */ - pmd_clear(pmdp); - pud_clear(pudp); pud_populate(mm, pudp, pmdp); pud = READ_ONCE(*pudp); WARN_ON(pud_bad(pud)); @@ -564,7 +566,6 @@ static void __init pmd_populate_tests(struct mm_struct *mm, pmd_t *pmdp, * This entry points to next level page table page. * Hence this must not qualify as pmd_bad(). */ - pmd_clear(pmdp); pmd_populate(mm, pmdp, pgtable); pmd = READ_ONCE(*pmdp); WARN_ON(pmd_bad(pmd)); From patchwork Wed Aug 12 06:33:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 11710333 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 78FD114F6 for ; Wed, 12 Aug 2020 06:35:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3A02A20768 for ; Wed, 12 Aug 2020 06:35:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="eIzAxETK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3A02A20768 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A5E4E8D0011; Wed, 12 Aug 2020 02:35:06 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9BCBB8D0001; Wed, 12 Aug 2020 02:35:06 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 85C168D0011; Wed, 12 Aug 2020 02:35:06 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0190.hostedemail.com [216.40.44.190]) by kanga.kvack.org (Postfix) with ESMTP id 684358D0001 for ; Wed, 12 Aug 2020 02:35:06 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 3AFE82485 for ; Wed, 12 Aug 2020 06:35:06 +0000 (UTC) X-FDA: 77140954212.22.alarm77_280465526fe9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 0A15318038E67 for ; Wed, 12 Aug 2020 06:35:06 +0000 (UTC) X-Spam-Summary: 1,0,0,4a73f13c8fa68fea,d41d8cd98f00b204,aneesh.kumar@linux.ibm.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1261:1311:1314:1345:1359:1431:1437:1515:1535:1541:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3866:3867:3871:4321:5007:6261:6653:8634:10004:11026:11473:11658:11914:12043:12114:12219:12296:12297:12438:12555:12895:13069:13161:13229:13311:13357:13894:14096:14181:14384:14394:14721:21080:21451:21627:30054:30074,0,RBL:148.163.158.5:@linux.ibm.com:.lbl8.mailshell.net-62.2.0.100 64.100.201.201;04yf1ms46ooqpdhbtib3n6e8izm5cycwqrcy7m4goxstsu1na3o3tmsptp8ri15.iapbfdsh6wry7wtcn1fga8bo7imr8qb4eqzeia6t3t5efjuq5jn8hmforokazb3.h-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:26,LUA_SUMMARY:none X-HE-Tag: alarm77_280465526fe9 X-Filterd-Recvd-Size: 5367 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Aug 2020 06:35:05 +0000 (UTC) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07C6W9Ka192241; Wed, 12 Aug 2020 02:34:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=hxqRq4AhklRfi6JquNzN/5s6VlMNSeyU4S+2TsX6+/o=; b=eIzAxETKA2q/wEiD1SNSGTVb4jAiIFv2yQVTxfjnHFjhkfPXQa9D3mvl24iged7zurVG nsNg6vdweLLYbouY0V83xv5548lX2sG3L62YNbB1MLo+iE4Xi0h6vxcU9NzVzVVM6Jcn mt3bOaJXtg3ZLOywcF9Hh9LFLstDCOc67mrdCx1s+v+4LfvMIadpij4Tu5fHwNQkCIKp mm94gmoVUOkQ++oIooQM6flan8z2yp+ZKGHqceU+h/KuKkB9y3ljALv1lJ9dT3LHmEZQ gE29mzkgVtOmvGNZjqD6LbuBR9yl4JU1TBXPB5nJQhELme866uEFmZt8yba4Vfr1GCzh DA== 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 32v7utv6sj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 02:34:59 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07C6VFp8027950; Wed, 12 Aug 2020 06:34:58 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 32skp9f8qh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 06:34:58 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07C6Yr0o49938924 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Aug 2020 06:34:53 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5799913604F; Wed, 12 Aug 2020 06:34:57 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E3DA1136053; Wed, 12 Aug 2020 06:34:54 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.85.71.109]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 12 Aug 2020 06:34:54 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, Anshuman Khandual , "Aneesh Kumar K.V" Subject: [PATCH 14/16] debug_vm_pgtable/hugetlb: Disable hugetlb test on ppc64 Date: Wed, 12 Aug 2020 12:03:56 +0530 Message-Id: <20200812063358.369514-14-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> References: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-11_19:2020-08-11,2020-08-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 malwarescore=0 adultscore=0 phishscore=0 impostorscore=0 mlxlogscore=616 lowpriorityscore=0 clxscore=1015 mlxscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008120044 X-Rspamd-Queue-Id: 0A15318038E67 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The seems to be missing quite a lot of details w.r.t allocating the correct pgtable_t page (huge_pte_alloc()), holding the right lock (huge_pte_lock()) etc. The vma used is also not a hugetlb VMA. ppc64 do have runtime checks within CONFIG_DEBUG_VM for most of these. Hence disable the test on ppc64. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 529892b9be2f..3e112d0ba1b2 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -800,6 +800,7 @@ static void __init hugetlb_basic_tests(unsigned long pfn, pgprot_t prot) #endif /* CONFIG_ARCH_WANT_GENERAL_HUGETLB */ } +#ifndef CONFIG_PPC_BOOK3S_64 static void __init hugetlb_advanced_tests(struct mm_struct *mm, struct vm_area_struct *vma, pte_t *ptep, unsigned long pfn, @@ -842,6 +843,7 @@ static void __init hugetlb_advanced_tests(struct mm_struct *mm, pte = huge_ptep_get(ptep); WARN_ON(!(huge_pte_write(pte) && huge_pte_dirty(pte))); } +#endif #else /* !CONFIG_HUGETLB_PAGE */ static void __init hugetlb_basic_tests(unsigned long pfn, pgprot_t prot) { } static void __init hugetlb_advanced_tests(struct mm_struct *mm, @@ -1053,7 +1055,9 @@ static int __init debug_vm_pgtable(void) pud_populate_tests(mm, pudp, saved_pmdp); spin_unlock(ptl); - //hugetlb_advanced_tests(mm, vma, ptep, pte_aligned, vaddr, prot); +#ifndef CONFIG_PPC_BOOK3S_64 + hugetlb_advanced_tests(mm, vma, ptep, pte_aligned, vaddr, prot); +#endif spin_lock(&mm->page_table_lock); p4d_clear_tests(mm, p4dp); From patchwork Wed Aug 12 06:33:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 11710335 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1610D14F6 for ; Wed, 12 Aug 2020 06:35:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CD7EC20768 for ; Wed, 12 Aug 2020 06:35:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="a2yDuK6t" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CD7EC20768 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D8F048D0012; Wed, 12 Aug 2020 02:35:08 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D179F8D0001; Wed, 12 Aug 2020 02:35:08 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AF5A48D0012; Wed, 12 Aug 2020 02:35:08 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0111.hostedemail.com [216.40.44.111]) by kanga.kvack.org (Postfix) with ESMTP id 93FA98D0001 for ; Wed, 12 Aug 2020 02:35:08 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 58029180AD807 for ; Wed, 12 Aug 2020 06:35:08 +0000 (UTC) X-FDA: 77140954296.24.drum50_5514c8d26fe9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 2B0E61A4A0 for ; Wed, 12 Aug 2020 06:35:08 +0000 (UTC) X-Spam-Summary: 1,0,0,281e5cea8f84f396,d41d8cd98f00b204,aneesh.kumar@linux.ibm.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1261:1311:1314:1345:1359:1431:1437:1515:1534:1541:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3866:3867:3868:3872:3874:4250:5007:6261:6653:8634:10004:11026:11473:11658:11914:12043:12114:12297:12438:12555:12895:13069:13255:13311:13357:13894:14096:14181:14384:14394:14721:21080:21433:21451:21627:30054:30070,0,RBL:148.163.158.5:@linux.ibm.com:.lbl8.mailshell.net-62.2.0.100 64.100.201.201;04yrfxhh34jjbzb833w98a7mb1ksropq5kpd6ufo6beyjtx53w3pwguubfaa7z4.pahtdayigodr4wghiy8gxpsr5143chh139wip7juaq81rd17mittd87kj6wntjx.e-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: drum50_5514c8d26fe9 X-Filterd-Recvd-Size: 4712 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Aug 2020 06:35:07 +0000 (UTC) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07C6WARD011127; Wed, 12 Aug 2020 02:35:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=m8zBaf2lrZAVhsnROuCm2W0WawpDqGOkNemkR562PmU=; b=a2yDuK6t0HFs+pBmZ0T9xnLRrxOveF3zGSS33szhBAIr/Y8lxZDxLY1gNsP9iDiortpU A8hGUd+Ljim/pjxASDIFeFfdDQHuhiD27CUmI+yAg2zHPW5qQzG/sjARxQAUFNfHDOFe ikp7lf2yItdTnYLMLzMvpJD8N9jdbeK5aNlts8+g1cn8UhNnryqJvIXFz/A6qxWgsz7U JAcUFe/ff3SXAlR1/rT/KCHVT651yMeeGgN0ryCgrqFkjUsl9ZI/falWWfU98xSM2m3H 6EppBKvEuKyvkOC28/sUO65L2LA3pa/WtESSzIhwlYC9wu/7Wc8v0YTRUuRNHhjWXkhA zg== 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 32v6r7dudh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 02:35:01 -0400 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07C6YPGR007246; Wed, 12 Aug 2020 06:35:01 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 32skp97aca-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 06:35:01 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07C6Z0j462783862 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Aug 2020 06:35:00 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1C0CA136051; Wed, 12 Aug 2020 06:35:00 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DC3F1136053; Wed, 12 Aug 2020 06:34:57 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.85.71.109]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 12 Aug 2020 06:34:57 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, Anshuman Khandual , "Aneesh Kumar K.V" Subject: [PATCH 15/16] debug_vm_pgtable/savedwrite: Use savedwrite test with protnone ptes Date: Wed, 12 Aug 2020 12:03:57 +0530 Message-Id: <20200812063358.369514-15-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> References: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-11_19:2020-08-11,2020-08-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 malwarescore=0 impostorscore=0 priorityscore=1501 spamscore=0 clxscore=1015 bulkscore=0 phishscore=0 mlxscore=0 lowpriorityscore=0 mlxlogscore=785 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008120044 X-Rspamd-Queue-Id: 2B0E61A4A0 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Saved write support was added to track the write bit of a pte after marking the pte protnone. This was done so that AUTONUMA can convert a write pte to protnone and still track the old write bit. When converting it back we set the pte write bit correctly thereby avoiding a write fault again. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 3e112d0ba1b2..eea62d5e503b 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -1006,8 +1006,8 @@ static int __init debug_vm_pgtable(void) pud_leaf_tests(pud_aligned, prot); #ifdef CONFIG_NUMA_BALANCING - pte_savedwrite_tests(pte_aligned, prot); - pmd_savedwrite_tests(pmd_aligned, prot); + pte_savedwrite_tests(pte_aligned, protnone); + pmd_savedwrite_tests(pmd_aligned, protnone); #endif pte_special_tests(pte_aligned, prot); pte_protnone_tests(pte_aligned, protnone); From patchwork Wed Aug 12 06:33:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 11710337 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC7A51744 for ; Wed, 12 Aug 2020 06:35:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AAF9D20768 for ; Wed, 12 Aug 2020 06:35:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="Q0+0ot33" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AAF9D20768 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1AF5F8D0013; Wed, 12 Aug 2020 02:35:12 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 093AD8D0001; Wed, 12 Aug 2020 02:35:11 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E043B8D0013; Wed, 12 Aug 2020 02:35:11 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0035.hostedemail.com [216.40.44.35]) by kanga.kvack.org (Postfix) with ESMTP id C35138D0001 for ; Wed, 12 Aug 2020 02:35:11 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 66153181AEF1A for ; Wed, 12 Aug 2020 06:35:11 +0000 (UTC) X-FDA: 77140954422.28.wash28_370457626fe9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 22C326D62 for ; Wed, 12 Aug 2020 06:35:11 +0000 (UTC) X-Spam-Summary: 1,0,0,1b5f20f7096d01aa,d41d8cd98f00b204,aneesh.kumar@linux.ibm.com,,RULES_HIT:1:2:41:69:355:379:541:800:960:973:988:989:1260:1261:1311:1314:1345:1359:1431:1437:1515:1605:1730:1747:1777:1792:2380:2393:2559:2562:2689:3138:3139:3140:3141:3142:3865:3867:3870:3871:3874:4052:4250:4321:4605:5007:6119:6261:6653:7903:8634:10004:11026:11473:11658:11914:12043:12114:12291:12295:12296:12297:12438:12555:12683:12895:12986:13149:13161:13229:13230:13894:14096:14394:21080:21451:21611:21627:21740:21990:30054,0,RBL:148.163.158.5:@linux.ibm.com:.lbl8.mailshell.net-62.2.0.100 64.100.201.201;04y8jeoxcp91ztd5rfnpe8urn6cx4ocdei5rkk7zntsyam8qdxtqy6feepqwzgg.a7cp4ubixy6mua9sd9jxr73zz5yh3shkq8ftsm4pguqirc4jyu66t4fm87mkt3o.y-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: wash28_370457626fe9 X-Filterd-Recvd-Size: 13058 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Aug 2020 06:35:10 +0000 (UTC) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07C6W2h9103009; Wed, 12 Aug 2020 02:35:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=c/Ac+7NLl6kdjM7MoxMrVJ7TH0wF3LpYVbYsYB5RlNg=; b=Q0+0ot33WDyFWG3p9ITDJ6axhWIYsXThQm6oRtKhoEZ1ytTIGVLds1Bj9CoY5lWs5DTS mZHWVazxMRjil3dYZ22POc+W9oFlEEB9ajMvQbioDPUx7WjjBnPxB+OQlF0T6zz5N+tY N4DDwosAS5/H0R32DHm07fdCHHMTaIWYvj6zK4qHK1u8e3diw+mc9Ip6vPUvbZBC+kUj S8T9uc1mcHthJXwGwKAd5t7blelqr8dLIlP20vwcfW/tWqe6/uYItvgJiwOGOFrcuHGN ZIaDHx8EHLgPOCSy6jp9Boh6W+vZUshAnsfXNb0GGQlkyAjWmbV5K80GEYbyI8skFUo8 7A== Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0b-001b2d01.pphosted.com with ESMTP id 32uqp3s9a3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 02:35:04 -0400 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07C6YL5O007218; Wed, 12 Aug 2020 06:35:04 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma04wdc.us.ibm.com with ESMTP id 32skp97acs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 06:35:04 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07C6Yxbh48431390 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Aug 2020 06:34:59 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2DD29136060; Wed, 12 Aug 2020 06:35:03 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BC90C136051; Wed, 12 Aug 2020 06:35:00 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.85.71.109]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 12 Aug 2020 06:35:00 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, Anshuman Khandual , "Aneesh Kumar K.V" Subject: [PATCH 16/16] debug_vm_pgtable/ppc64: Add a variant of pfn_pte/pmd Date: Wed, 12 Aug 2020 12:03:58 +0530 Message-Id: <20200812063358.369514-16-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> References: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-11_19:2020-08-11,2020-08-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 spamscore=0 priorityscore=1501 mlxscore=0 impostorscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 adultscore=0 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008120044 X-Rspamd-Queue-Id: 22C326D62 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The tests do expect _PAGE_PTE bit set by different page table accessors. This is not true for the kernel. Within the kernel, _PAGE_PTE bits are usually set by set_pte_at(). To make the below tests work correctly add test specific pfn_pte/pmd helpers that set _PAGE_PTE bit. pte_t pte = pfn_pte(pfn, prot); WARN_ON(!pte_devmap(pte_mkdevmap(pte))); WARN_ON(!pte_savedwrite(pte_mk_savedwrite(pte_clear_savedwrite(pte)))); Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 65 +++++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 24 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index eea62d5e503b..153c925b5273 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -31,6 +31,23 @@ #include #include +#ifdef CONFIG_PPC_BOOK3S_64 +static inline pte_t debug_vm_pfn_pte(unsigned long pfn, pgprot_t pgprot) +{ + pte_t pte = pfn_pte(pfn, pgprot); + return __pte(pte_val(pte) | _PAGE_PTE); + +} +static inline pmd_t debug_vm_pfn_pmd(unsigned long pfn, pgprot_t pgprot) +{ + pmd_t pmd = pfn_pmd(pfn, pgprot); + return __pmd(pmd_val(pmd) | _PAGE_PTE); +} +#else +#define debug_vm_pfn_pte(pfn, pgprot) pfn_pte(pfn, pgprot) +#define debug_vm_pfn_pmd(pfn, pgprot) pfn_pmd(pfn, pgprot) +#endif + /* * Please refer Documentation/vm/arch_pgtable_helpers.rst for the semantics * expectations that are being validated here. All future changes in here @@ -55,7 +72,7 @@ static void __init pte_basic_tests(unsigned long pfn, pgprot_t prot) { - pte_t pte = pfn_pte(pfn, prot); + pte_t pte = debug_vm_pfn_pte(pfn, prot); pr_debug("Validating PTE basic\n"); WARN_ON(!pte_same(pte, pte)); @@ -72,10 +89,10 @@ static void __init pte_advanced_tests(struct mm_struct *mm, unsigned long pfn, unsigned long vaddr, pgprot_t prot) { - pte_t pte = pfn_pte(pfn, prot); + pte_t pte = debug_vm_pfn_pte(pfn, prot); pr_debug("Validating PTE advanced\n"); - pte = pfn_pte(pfn, prot); + pte = debug_vm_pfn_pte(pfn, prot); set_pte_at(mm, vaddr, ptep, pte); ptep_set_wrprotect(mm, vaddr, ptep); pte = ptep_get(ptep); @@ -85,7 +102,7 @@ static void __init pte_advanced_tests(struct mm_struct *mm, pte = ptep_get(ptep); WARN_ON(!pte_none(pte)); - pte = pfn_pte(pfn, prot); + pte = debug_vm_pfn_pte(pfn, prot); pte = pte_wrprotect(pte); pte = pte_mkclean(pte); set_pte_at(mm, vaddr, ptep, pte); @@ -113,7 +130,7 @@ static void __init pte_advanced_tests(struct mm_struct *mm, #ifdef CONFIG_NUMA_BALANCING static void __init pte_savedwrite_tests(unsigned long pfn, pgprot_t prot) { - pte_t pte = pfn_pte(pfn, prot); + pte_t pte = debug_vm_pfn_pte(pfn, prot); pr_debug("Validating PTE saved write\n"); WARN_ON(!pte_savedwrite(pte_mk_savedwrite(pte_clear_savedwrite(pte)))); @@ -124,7 +141,7 @@ static void __init pte_savedwrite_tests(unsigned long pfn, pgprot_t prot) #ifdef CONFIG_TRANSPARENT_HUGEPAGE static void __init pmd_basic_tests(unsigned long pfn, pgprot_t prot) { - pmd_t pmd = pfn_pmd(pfn, prot); + pmd_t pmd = debug_vm_pfn_pmd(pfn, prot); if (!has_transparent_hugepage()) return; @@ -160,7 +177,7 @@ static void __init pmd_advanced_tests(struct mm_struct *mm, pgtable_trans_huge_deposit(mm, pmdp, pgtable); - pmd = pmd_mkhuge(pfn_pmd(pfn, prot)); + pmd = pmd_mkhuge(debug_vm_pfn_pmd(pfn, prot)); set_pmd_at(mm, vaddr, pmdp, pmd); pmdp_set_wrprotect(mm, vaddr, pmdp); pmd = READ_ONCE(*pmdp); @@ -170,7 +187,7 @@ static void __init pmd_advanced_tests(struct mm_struct *mm, pmd = READ_ONCE(*pmdp); WARN_ON(!pmd_none(pmd)); - pmd = pmd_mkhuge(pfn_pmd(pfn, prot)); + pmd = pmd_mkhuge(debug_vm_pfn_pmd(pfn, prot)); pmd = pmd_wrprotect(pmd); pmd = pmd_mkclean(pmd); set_pmd_at(mm, vaddr, pmdp, pmd); @@ -184,7 +201,7 @@ static void __init pmd_advanced_tests(struct mm_struct *mm, pmd = READ_ONCE(*pmdp); WARN_ON(!pmd_none(pmd)); - pmd = pmd_mkhuge(pfn_pmd(pfn, prot)); + pmd = pmd_mkhuge(debug_vm_pfn_pmd(pfn, prot)); pmd = pmd_mkyoung(pmd); set_pmd_at(mm, vaddr, pmdp, pmd); pmdp_test_and_clear_young(vma, vaddr, pmdp); @@ -198,7 +215,7 @@ static void __init pmd_advanced_tests(struct mm_struct *mm, static void __init pmd_leaf_tests(unsigned long pfn, pgprot_t prot) { - pmd_t pmd = pfn_pmd(pfn, prot); + pmd_t pmd = debug_vm_pfn_pmd(pfn, prot); pr_debug("Validating PMD leaf\n"); /* @@ -230,7 +247,7 @@ static void __init pmd_huge_tests(pmd_t *pmdp, unsigned long pfn, pgprot_t prot) #ifdef CONFIG_NUMA_BALANCING static void __init pmd_savedwrite_tests(unsigned long pfn, pgprot_t prot) { - pmd_t pmd = pfn_pmd(pfn, prot); + pmd_t pmd = debug_vm_pfn_pmd(pfn, prot); pr_debug("Validating PMD saved write\n"); WARN_ON(!pmd_savedwrite(pmd_mk_savedwrite(pmd_clear_savedwrite(pmd)))); @@ -573,7 +590,7 @@ static void __init pmd_populate_tests(struct mm_struct *mm, pmd_t *pmdp, static void __init pte_special_tests(unsigned long pfn, pgprot_t prot) { - pte_t pte = pfn_pte(pfn, prot); + pte_t pte = debug_vm_pfn_pte(pfn, prot); if (!IS_ENABLED(CONFIG_ARCH_HAS_PTE_SPECIAL)) return; @@ -584,7 +601,7 @@ static void __init pte_special_tests(unsigned long pfn, pgprot_t prot) static void __init pte_protnone_tests(unsigned long pfn, pgprot_t prot) { - pte_t pte = pfn_pte(pfn, prot); + pte_t pte = debug_vm_pfn_pte(pfn, prot); if (!IS_ENABLED(CONFIG_NUMA_BALANCING)) return; @@ -597,7 +614,7 @@ static void __init pte_protnone_tests(unsigned long pfn, pgprot_t prot) #ifdef CONFIG_TRANSPARENT_HUGEPAGE static void __init pmd_protnone_tests(unsigned long pfn, pgprot_t prot) { - pmd_t pmd = pmd_mkhuge(pfn_pmd(pfn, prot)); + pmd_t pmd = pmd_mkhuge(debug_vm_pfn_pmd(pfn, prot)); if (!IS_ENABLED(CONFIG_NUMA_BALANCING)) return; @@ -613,7 +630,7 @@ static void __init pmd_protnone_tests(unsigned long pfn, pgprot_t prot) { } #ifdef CONFIG_ARCH_HAS_PTE_DEVMAP static void __init pte_devmap_tests(unsigned long pfn, pgprot_t prot) { - pte_t pte = pfn_pte(pfn, prot); + pte_t pte = debug_vm_pfn_pte(pfn, prot); pr_debug("Validating PTE devmap\n"); WARN_ON(!pte_devmap(pte_mkdevmap(pte))); @@ -622,7 +639,7 @@ static void __init pte_devmap_tests(unsigned long pfn, pgprot_t prot) #ifdef CONFIG_TRANSPARENT_HUGEPAGE static void __init pmd_devmap_tests(unsigned long pfn, pgprot_t prot) { - pmd_t pmd = pfn_pmd(pfn, prot); + pmd_t pmd = debug_vm_pfn_pmd(pfn, prot); pr_debug("Validating PMD devmap\n"); WARN_ON(!pmd_devmap(pmd_mkdevmap(pmd))); @@ -651,7 +668,7 @@ static void __init pud_devmap_tests(unsigned long pfn, pgprot_t prot) { } static void __init pte_soft_dirty_tests(unsigned long pfn, pgprot_t prot) { - pte_t pte = pfn_pte(pfn, prot); + pte_t pte = debug_vm_pfn_pte(pfn, prot); if (!IS_ENABLED(CONFIG_MEM_SOFT_DIRTY)) return; @@ -663,7 +680,7 @@ static void __init pte_soft_dirty_tests(unsigned long pfn, pgprot_t prot) static void __init pte_swap_soft_dirty_tests(unsigned long pfn, pgprot_t prot) { - pte_t pte = pfn_pte(pfn, prot); + pte_t pte = debug_vm_pfn_pte(pfn, prot); if (!IS_ENABLED(CONFIG_MEM_SOFT_DIRTY)) return; @@ -676,7 +693,7 @@ static void __init pte_swap_soft_dirty_tests(unsigned long pfn, pgprot_t prot) #ifdef CONFIG_TRANSPARENT_HUGEPAGE static void __init pmd_soft_dirty_tests(unsigned long pfn, pgprot_t prot) { - pmd_t pmd = pfn_pmd(pfn, prot); + pmd_t pmd = debug_vm_pfn_pmd(pfn, prot); if (!IS_ENABLED(CONFIG_MEM_SOFT_DIRTY)) return; @@ -688,7 +705,7 @@ static void __init pmd_soft_dirty_tests(unsigned long pfn, pgprot_t prot) static void __init pmd_swap_soft_dirty_tests(unsigned long pfn, pgprot_t prot) { - pmd_t pmd = pfn_pmd(pfn, prot); + pmd_t pmd = debug_vm_pfn_pmd(pfn, prot); if (!IS_ENABLED(CONFIG_MEM_SOFT_DIRTY) || !IS_ENABLED(CONFIG_ARCH_ENABLE_THP_MIGRATION)) @@ -711,7 +728,7 @@ static void __init pte_swap_tests(unsigned long pfn, pgprot_t prot) pte_t pte; pr_debug("Validating PTE swap\n"); - pte = pfn_pte(pfn, prot); + pte = debug_vm_pfn_pte(pfn, prot); swp = __pte_to_swp_entry(pte); pte = __swp_entry_to_pte(swp); WARN_ON(pfn != pte_pfn(pte)); @@ -724,7 +741,7 @@ static void __init pmd_swap_tests(unsigned long pfn, pgprot_t prot) pmd_t pmd; pr_debug("Validating PMD swap\n"); - pmd = pfn_pmd(pfn, prot); + pmd = debug_vm_pfn_pmd(pfn, prot); swp = __pmd_to_swp_entry(pmd); pmd = __swp_entry_to_pmd(swp); WARN_ON(pfn != pmd_pfn(pmd)); @@ -794,7 +811,7 @@ static void __init hugetlb_basic_tests(unsigned long pfn, pgprot_t prot) WARN_ON(huge_pte_write(huge_pte_wrprotect(huge_pte_mkwrite(pte)))); #ifdef CONFIG_ARCH_WANT_GENERAL_HUGETLB - pte = pfn_pte(pfn, prot); + pte = debug_vm_pfn_pte(pfn, prot); WARN_ON(!pte_huge(pte_mkhuge(pte))); #endif /* CONFIG_ARCH_WANT_GENERAL_HUGETLB */ @@ -874,7 +891,7 @@ static void __init pmd_thp_tests(unsigned long pfn, pgprot_t prot) * needs to return true. pmd_present() should be true whenever * pmd_trans_huge() returns true. */ - pmd = pfn_pmd(pfn, prot); + pmd = debug_vm_pfn_pmd(pfn, prot); WARN_ON(!pmd_trans_huge(pmd_mkhuge(pmd))); #ifndef __HAVE_ARCH_PMDP_INVALIDATE