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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BB2C9CD128A for ; Wed, 10 Apr 2024 12:49:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:CC:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9GicTM7NenDV+oSOxV5nCIAoQmtnQPjrL3mQhg3qoL0=; b=Cftw1uV+pQuP1/ 3/47jd+uM9sb4Suxww0WIDjwGNF6BdJ6kZnLh8kkxNQYIz/ATMgO9ohHG1kGUvW4jH6h1c1lvAH9i t8g7Z+Qbla+ikC0VMZxVm4LcMQrB4hkmuwtEwSlA3RdZiR7GPu4wls4aPCysA8rXa2ZrQH8Nm4qgZ zMIeci7KYL917963KwSS/fw+9Y+nyLIBbiCIaDiFZERFAVKAnHsZG4Uq9NMYmppEr22swPlnSSvGS EFkFglTZZbj7cMcCNroKU3L1yo8N6s1/tmMV1LH2RLaslt7Qcs4k5ci72BoFjNOh0Fqhest9QLXqq bXMnTG+CTEMNYwO1GCKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruXOb-00000006yXk-3MPs; Wed, 10 Apr 2024 12:49:45 +0000 Received: from szxga05-in.huawei.com ([45.249.212.191]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruXNc-00000006xzs-3Hiz for linux-arm-kernel@lists.infradead.org; Wed, 10 Apr 2024 12:49:11 +0000 Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4VF2cK27dWz2NW6B; Wed, 10 Apr 2024 20:45:37 +0800 (CST) Received: from dggpemm100001.china.huawei.com (unknown [7.185.36.93]) by mail.maildlp.com (Postfix) with ESMTPS id 18FC01A0172; Wed, 10 Apr 2024 20:48:29 +0800 (CST) Received: from [10.174.177.243] (10.174.177.243) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 10 Apr 2024 20:48:28 +0800 Message-ID: <8a695c3f-a5eb-4012-a14c-1d76ad79c0dc@huawei.com> Date: Wed, 10 Apr 2024 20:48:28 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] arm64: mm: drop VM_FAULT_BADMAP/VM_FAULT_BADACCESS Content-Language: en-US To: Cristian Marussi CC: Aishwarya TCV , , , Will Deacon , Catalin Marinas , Russell King , Andrew Morton , Mark Brown References: <20240407081211.2292362-1-wangkefeng.wang@huawei.com> <20240407081211.2292362-2-wangkefeng.wang@huawei.com> <681e3bf8-dedf-469e-8fd3-0a67b8e6e625@arm.com> <0977b553-b0ae-4e4b-8cb4-007204381c0b@huawei.com> From: Kefeng Wang In-Reply-To: X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm100001.china.huawei.com (7.185.36.93) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240410_054845_722191_FDAC280F X-CRM114-Status: GOOD ( 17.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2024/4/10 20:39, Cristian Marussi wrote: > On Wed, Apr 10, 2024 at 07:53:21PM +0800, Kefeng Wang wrote: >> >> >> On 2024/4/10 19:24, Aishwarya TCV wrote: >>> > > Hi, > >>> >>> On 07/04/2024 09:12, Kefeng Wang wrote: >>>> If bad map or access, directly set si_code to SEGV_MAPRR or SEGV_ACCERR, >>>> also set fault to 0 and goto error handling, which make us to drop the >>>> arch's special vm fault reason. >>>> >>>> Signed-off-by: Kefeng Wang >>>> --- >>>> arch/arm64/mm/fault.c | 41 ++++++++++++++++++----------------------- >>>> 1 file changed, 18 insertions(+), 23 deletions(-) >>> >>> Hi Kefeng, >>> >>> While running LTP test suite, I observed that few test cases are unable >>> to kill exe when run against next-master(next-20240409) kernel with >>> Arm64 on JUNO in our CI. I can send the full logs if required, but it >>> doesn't say much. >> >> Sorry about it, as Catalin pointed, there is issue in this patch, and >> I replied today, could you help to test with following changes, many thanks. >> >> diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c >> index 61a2acae0dca..451ba7cbd5ad 100644 >> --- a/arch/arm64/mm/fault.c >> +++ b/arch/arm64/mm/fault.c >> @@ -604,6 +604,7 @@ static int __kprobes do_page_fault(unsigned long far, >> unsigned long esr, >> } >> >> if (!(vma->vm_flags & vm_flags)) { >> + mmap_read_unlock(mm); >> fault = 0; >> si_code = SEGV_ACCERR; >> goto bad_area; >> @@ -632,6 +633,7 @@ static int __kprobes do_page_fault(unsigned long far, >> unsigned long esr, >> if (likely(!(fault & VM_FAULT_ERROR))) >> return 0; >> >> + si_code = SEGV_MAPERR; >> bad_area: >> /* >> * If we are in kernel mode at this point, we have no context to >> > > On my JUNO setup, the above patch solves the 'un-killable tests' issues and > all the previously failing tests passes. (I have NOT run the full LTP > test-suite, though, only replayed the tests that were failing before as > mentioned by Aishwarya) Thanks, I will resend v2, but let's wait for Catalin to see if there is any other opinion. > > Thanks, > Cristian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel