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=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS 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 7919AC43219 for ; Wed, 1 May 2019 10:34:06 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B058E21670 for ; Wed, 1 May 2019 10:34:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B058E21670 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=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 44vFB33XCTzDqQ5 for ; Wed, 1 May 2019 20:34:03 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=linux.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=aneesh.kumar@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 44vF8W05ZYzDqNX for ; Wed, 1 May 2019 20:32:41 +1000 (AEST) Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x41ASHQs002749 for ; Wed, 1 May 2019 06:32:38 -0400 Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.151]) by mx0a-001b2d01.pphosted.com with ESMTP id 2s78ukht3r-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 01 May 2019 06:32:38 -0400 Received: from localhost by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 1 May 2019 11:32:37 +0100 Received: from b03cxnp08028.gho.boulder.ibm.com (9.17.130.20) by e33.co.us.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 1 May 2019 11:32:34 +0100 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x41AWX5w12452224 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 1 May 2019 10:32:33 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A8FFA6A04F; Wed, 1 May 2019 10:32:33 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D4E586A04D; Wed, 1 May 2019 10:32:32 +0000 (GMT) Received: from [9.80.235.148] (unknown [9.80.235.148]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 1 May 2019 10:32:32 +0000 (GMT) Subject: Re: [PATCH] powerpc/mm/radix: Fix kernel crash when running subpage protect test To: Michael Ellerman , npiggin@gmail.com, paulus@samba.org References: <20190430075907.7701-1-aneesh.kumar@linux.ibm.com> <875zqvaqxz.fsf@concordia.ellerman.id.au> From: "Aneesh Kumar K.V" Date: Wed, 1 May 2019 16:02:31 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <875zqvaqxz.fsf@concordia.ellerman.id.au> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19050110-0036-0000-0000-00000AB0F62C X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011028; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000285; SDB=6.01196980; UDB=6.00627772; IPR=6.00977833; MB=3.00026680; MTD=3.00000008; XFM=3.00000015; UTC=2019-05-01 10:32:35 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19050110-0037-0000-0000-00004B98D119 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-01_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905010070 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sachin Sant , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 5/1/19 7:14 AM, Michael Ellerman wrote: > "Aneesh Kumar K.V" writes: > >> This patch fixes the below crash by making sure we touch the subpage protection >> related structures only if we know they are allocated on the platform. With >> radix translation we don't allocate hash context at all and trying to access >> subpage_prot_table results in >> >> Faulting instruction address: 0xc00000000008bdb4 >> Oops: Kernel access of bad area, sig: 11 [#1] >> LE PAGE_SIZE=64K MMU=Radix MMU=Hash SMP NR_CPUS=2048 NUMA PowerNV >> .... >> NIP [c00000000008bdb4] sys_subpage_prot+0x74/0x590 >> LR [c00000000000b688] system_call+0x5c/0x70 >> Call Trace: >> [c00020002c6b7d30] [c00020002c6b7d90] 0xc00020002c6b7d90 (unreliable) >> [c00020002c6b7e20] [c00000000000b688] system_call+0x5c/0x70 >> Instruction dump: >> fb61ffd8 fb81ffe0 fba1ffe8 fbc1fff0 fbe1fff8 f821ff11 e92d1178 f9210068 >> 39200000 e92d0968 ebe90630 e93f03e8 60000000 3860fffe e9410068 >> >> We also move the subpage_prot_table with mmp_sem held to avoid racec >> between two parallel subpage_prot syscall. >> >> Reported-by: Sachin Sant >> Signed-off-by: Aneesh Kumar K.V > > Presumably it was: > > 701101865f5d ("powerpc/mm: Reduce memory usage for mm_context_t for radix") > > That caused the breakage? > that is correct. Sorry i missed the Fixes: line. -aneesh