From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04BFAC433DF for ; Thu, 15 Oct 2020 03:32:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 41CE822245 for ; Thu, 15 Oct 2020 03:32:23 +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="dhXzwO7T" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 41CE822245 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 83AA66B0062; Wed, 14 Oct 2020 23:32:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7C2D76B0068; Wed, 14 Oct 2020 23:32:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 68ACC6B006E; Wed, 14 Oct 2020 23:32:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0124.hostedemail.com [216.40.44.124]) by kanga.kvack.org (Postfix) with ESMTP id 3752F6B0062 for ; Wed, 14 Oct 2020 23:32:22 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A921E8249980 for ; Thu, 15 Oct 2020 03:32:21 +0000 (UTC) X-FDA: 77372736882.24.dolls15_010a8ff27211 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 8B89F1A4A0 for ; Thu, 15 Oct 2020 03:32:21 +0000 (UTC) X-HE-Tag: dolls15_010a8ff27211 X-Filterd-Recvd-Size: 4209 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Thu, 15 Oct 2020 03:32:20 +0000 (UTC) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09F3GB0V047021; Wed, 14 Oct 2020 23:32:18 -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=15VWw2AFltuDYg7bBruxmDbCNOmBFDkYMaDZKmmBOWA=; b=dhXzwO7TWiVIMpsKAnG58tJy86QLDzHgsMccLdBCbMKy4M+20ppwswjAkWnInxvm/3O2 KKoYlbPysyevd2rI1nfakgo02kaTHtPnz/xgU6LwW3ocw+HfTjYXg++QNuef04WPRURy ZHjo9hROuYaiSq1csd1h/W17QJQkRwNv5b/0T9VCymwERn2JQtPPM5ofxuDgJ3XR/qmc wGve+St8AXBF1l8tOjXqV8M4T6xxoA/erK1iUj8a7RwXTpV5wBZYWdRAjMN/3KpE9DCj 7ixVqpmBzPhrYE978kRq7rzGieXdye3+BTi7k7UourOnDreM7r7Mxl+PkQFF1gul4cMQ TQ== Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0a-001b2d01.pphosted.com with ESMTP id 346ecdg8jf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 14 Oct 2020 23:32:18 -0400 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 09F3R28h013455; Thu, 15 Oct 2020 03:32:18 GMT Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by ppma05wdc.us.ibm.com with ESMTP id 3434k9ehrx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Oct 2020 03:32:17 +0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 09F3WHP520971914 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Oct 2020 03:32:17 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6E110124054; Thu, 15 Oct 2020 03:32:17 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 44E5E124053; Thu, 15 Oct 2020 03:32:15 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.199.63.66]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 15 Oct 2020 03:32:14 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, linux-riscv@lists.infradead.org Cc: akpm@linux-foundation.org, Anshuman Khandual , "Aneesh Kumar K.V" Subject: [PATCH] mm/debug_vm_pgtable: Avoid kernel crash with riscv Date: Thu, 15 Oct 2020 09:02:06 +0530 Message-Id: <20201015033206.140550-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-10-15_01:2020-10-14,2020-10-15 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 mlxlogscore=917 malwarescore=0 mlxscore=0 clxscore=1015 phishscore=0 bulkscore=0 impostorscore=0 priorityscore=1501 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010150022 Content-Transfer-Encoding: quoted-printable 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: It was observed that the usage of RANDOM_ORVALUE with a valid pte cause kernel crash on riscv. Comment out the usage of random value on riscv Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index c36530c69e33..98b101a8fd2a 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -548,7 +548,9 @@ static void __init pte_clear_tests(struct mm_struct *= mm, pte_t *ptep, pte_t pte =3D pfn_pte(pfn, prot); =20 pr_debug("Validating PTE clear\n"); +#ifndef CONFIG_RISCV pte =3D __pte(pte_val(pte) | RANDOM_ORVALUE); +#endif set_pte_at(mm, vaddr, ptep, pte); barrier(); pte_clear(mm, vaddr, ptep); --=20 2.26.2