Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp567334rwi; Mon, 10 Oct 2022 04:33:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7TB3Bdo2HtGvBZkiqFZT4qJutc9p7Gt7osNU8sNIkokOQO1L7gCDxdCDIlBsvgrFwYKPk/ X-Received: by 2002:a17:902:b597:b0:182:8547:ae57 with SMTP id a23-20020a170902b59700b001828547ae57mr4468827pls.92.1665401580953; Mon, 10 Oct 2022 04:33:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665401580; cv=none; d=google.com; s=arc-20160816; b=khXlNudI73r3zj4vLqfqRbUjcZftYIKllPjJqOVypXuQ1NqR3nyBeBrJAeelsa6ede 9793/YS+edcQl56QxIcQkRxE/YAulRoi+XChL2J8wbIJxqdRFp08VbFIuOANVkKmW0Ec kn1GOmtMsMEVRv9BFMu6mXLwItoLv/KKCww86fA/gROSAmptdJ47Q70qZIPw/CSHKDmD ktVz1pQCe4ePfZ873SRP5DTzhEyo4SPdTaj/G9shQwNwutDxlwEZtUFaSj+ANENNnWIw yUZLxKL383+8nmME11gogcORWNWFuRl9T7Py3PrVIvw4TjArtbE3Q2j0B1yJG6R4XlJr SoaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=mHLQcyvQ7WL7DQH+kdaL8eQSG5DvKZiaUwEyDrZvq74=; b=F3RITLbinaLQQwwpaq8PTSQF10ESRwaRxtvFGBwtCF4d7+SYWjIa3EBMD9fjCTJgLd GahdLtCXNdbUt4kDPuY0zAEmWqUUbi2iBtJcNGJwakHwBV4MTTJrleWPeSQI9/f9xGtw Z+TtO/yPRljvmfvdnFiAik6851ctopnsrX7uOJKU88i8XWLVxlJ6auXS/eSKtWThMCDP jtpg483/xizlnSSlfDWLg2b41bQuyF6auE9bgAjiavNroFF6YQiPuioE3qwShV9THQMV UBxGk25Gk9dp0t0c6s/KASfufOWm9RN+pcNjqVbQKq18xPMPPXDh2AkO6Ova/RWBLvX3 9O4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id om11-20020a17090b3a8b00b00202a519f846si17859529pjb.173.2022.10.10.04.32.48; Mon, 10 Oct 2022 04:33:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231389AbiJJLYU (ORCPT + 99 others); Mon, 10 Oct 2022 07:24:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230410AbiJJLYT (ORCPT ); Mon, 10 Oct 2022 07:24:19 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FFE066A7A for ; Mon, 10 Oct 2022 04:24:18 -0700 (PDT) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MmGhV3qPxzwPYT; Mon, 10 Oct 2022 19:21:46 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 10 Oct 2022 19:24:16 +0800 Received: from [10.174.177.243] (10.174.177.243) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 10 Oct 2022 19:24:16 +0800 Message-ID: <4339e1f4-b5c1-0b61-3a37-e63aafe22857@huawei.com> Date: Mon, 10 Oct 2022 19:24:15 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v3] ARM: mm: Provide better message when kernel fault Content-Language: en-US To: Russell King CC: , References: <20220927062134.99019-1-wangkefeng.wang@huawei.com> From: Kefeng Wang In-Reply-To: <20220927062134.99019-1-wangkefeng.wang@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/9/27 14:21, Kefeng Wang wrote: > If there is a kernel fault, see do_kernel_fault(), we only print > the generic "paging request" or "NULL pointer dereference" message > which don't show read, write or excute information, let's provide > better fault message for them. Hi Russell, what's your option about this one, if no object, I will send to ARM patch system, thanks, > Signed-off-by: Kefeng Wang > --- > v3: show the infos in die_kernel_fault() > arch/arm/mm/fault.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c > index 46cccd6bf705..f8fe0ec64c23 100644 > --- a/arch/arm/mm/fault.c > +++ b/arch/arm/mm/fault.c > @@ -111,8 +111,9 @@ static void die_kernel_fault(const char *msg, struct mm_struct *mm, > { > bust_spinlocks(1); > pr_alert("8<--- cut here ---\n"); > - pr_alert("Unable to handle kernel %s at virtual address %08lx\n", > - msg, addr); > + pr_alert("Unable to handle kernel %s at virtual address %08lx when %s\n", > + msg, addr, fsr & FSR_LNX_PF ? "execute" : > + fsr & FSR_WRITE ? "write" : "read"); > > show_pte(KERN_ALERT, mm, addr); > die("Oops", regs, fsr);