Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp477138rwb; Mon, 26 Sep 2022 23:23:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6zISKVQiW6N2pSe9MqpcwBx9hmL5LVb+c2/OQvBxraGtg4beRvXfVizORn9fVyjyOAl/Bc X-Received: by 2002:a05:6402:428f:b0:454:c988:4bb1 with SMTP id g15-20020a056402428f00b00454c9884bb1mr25861732edc.196.1664259804969; Mon, 26 Sep 2022 23:23:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664259804; cv=none; d=google.com; s=arc-20160816; b=mgMfOub15jBMADvF4IuwEuqipTxLfS0QNv4/fo1k77428FeYsCMaBmNIxSweI516MZ 64HQim5gPswUfYLBeQEjGXzXCax87BiFCADV4C9BSicPkMoz0AtNFa+R0FvLs/BghbYr pPXgy5hQe6x+VndVtyv2sMM1qbuZ7+YajfwnfV0uQcmLSXtcnKGFe6QBMsBWBBRLgWbR WFVdBas/i9YwgcNCgwyZjaS4NU22lJwSCjT1WAvn8NBZhFlp08moqHOH+A8z27b02nr2 CH9bqxD1Ed8vErUFWQIo3iF33z8uGMEI1bgyqUoWA2QCTT9UXIT2vZcTPxT1Lu8g6Zah 72mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=yqXNZj/q8lxvJaqqncq2ulSOSla4z46hmJ5jkSXy57M=; b=sWqxtLDcEQJBXiTnq2x/3iub+r0dhxE5vujmX3piCGpWx3rmpjz4gZj1l0/aTIeQxR tWK/mNAs7VhlvqufZuzCbcaaOOxYSmqXqc/GnOWHBzjdPkGytk5e640nkV6AW8jeTy4+ mBC3e2GjHoKaSGILDJrpgc5245tEx9I+/WoXVL1K4rkYgBF0HKlC9T5M8SVasgXQkQ4G KkwD43Pf0tjTrslA4ZfTL/rMykKYbxKHX3++RYk9iVWXiNLPAJcIBhwmyP4Blufxi5WK KrAk5wZ2hVsacSja2FpefeQNuBFWSGIf3h0EvoG+fEyAn5OhzXjf2E5sy3VhgJvisQ2u Lm5Q== 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 q16-20020a056402519000b004534c7d4ebfsi897234edd.434.2022.09.26.23.22.59; Mon, 26 Sep 2022 23:23:24 -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 S229531AbiI0GSU (ORCPT + 99 others); Tue, 27 Sep 2022 02:18:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbiI0GSR (ORCPT ); Tue, 27 Sep 2022 02:18:17 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 550C65E30F for ; Mon, 26 Sep 2022 23:18:15 -0700 (PDT) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Mc8TL4dXSzlXG0; Tue, 27 Sep 2022 14:13:58 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 27 Sep 2022 14:18:13 +0800 Received: from localhost.localdomain.localdomain (10.175.113.25) 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; Tue, 27 Sep 2022 14:18:13 +0800 From: Kefeng Wang To: Russell King CC: , , Kefeng Wang Subject: [PATCH v3] ARM: mm: Provide better message when kernel fault Date: Tue, 27 Sep 2022 14:21:34 +0800 Message-ID: <20220927062134.99019-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] 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=-4.2 required=5.0 tests=BAYES_00,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 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. 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); -- 2.35.3