From patchwork Thu Aug 25 06:31:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen (ThunderTown)" X-Patchwork-Id: 12954218 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 5F004C28D13 for ; Thu, 25 Aug 2022 06:34:18 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=RLXSLfEhKb+fRKQp4MInoGtuBopFCtAsNsqLvzshENk=; b=2BKT9c4NBoeUT0 TZibKx+qafsPVxnbcT1gj1AxKyRasWp4E/jKkh2/t+xURL2ajED2Z5pwK3B/7tFlA2Smr4smdkedM psEYZ8jKxdChXt4zvbgu1hHyTAB5lr0p4SC4OgKro2AwP3AukrVv+VjiF3S6IHYAh94Qzb4ZFHK3E s/nl5ajc7AjLZgUNcC8TRRU+qfg5aXwEu0iEgeddtYezMuqZjjb4D2WY69tWtFHVLuKFT8H7fct/r vDKktm36PSf8vAQi94YFAdq2HOCAxw+2ygeUDpP2P6qZ320ovkACOzQITuyhOtBFkBhrF2ZQldeNO qc+1btVSNk/KQ+Wi22Yg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oR6QV-007uhX-NR; Thu, 25 Aug 2022 06:33:15 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oR6Q7-007u7q-B7 for linux-arm-kernel@lists.infradead.org; Thu, 25 Aug 2022 06:32:53 +0000 Received: from dggpemm500024.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MCtPR4tZqznTkB; Thu, 25 Aug 2022 14:30:19 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggpemm500024.china.huawei.com (7.185.36.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 25 Aug 2022 14:32:39 +0800 Received: from thunder-town.china.huawei.com (10.174.178.55) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 25 Aug 2022 14:32:39 +0800 From: Zhen Lei To: Catalin Marinas , Will Deacon , Mark Rutland , Russell King , , , CC: Zhen Lei Subject: [PATCH 0/2] arm: Replace this_cpu_* with raw_cpu_* in panic_bad_stack() Date: Thu, 25 Aug 2022 14:31:52 +0800 Message-ID: <20220825063154.69-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.178.55] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220824_233251_808356_74BE5DFB X-CRM114-Status: GOOD ( 10.09 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org I'm analyzing a strange problem these days, and I find that there are some areas in panic_bad_stack() that can be optimized. That is, replace this_cpu_* with raw_cpu_* . Just optimization, it is unlikely to cause the following exception nesting, because of "lr : __bad_stack+0x88/0x8c". [20220819163739]Unable to handle kernel paging request at virtual address f7ffff94901b8048 [20220819163739]Mem abort info: [20220819163739] ESR = 0x96000004 [20220819163739] EC = 0x25: DABT (current EL), IL = 32 bits [20220819163739] SET = 0, FnV = 0 [20220819163739] EA = 0, S1PTW = 0 [20220819163739]Data abort info: [20220819163739] ISV = 0, ISS = 0x00000004 [20220819163739] CM = 0, WnR = 0 [20220819163739][f7ffff94901b8048] address between user and kernel address ranges [20220819163739]Internal error: Oops: 96000004 [#1] PREEMPT SMP [20220819163739]Modules linked in: ... [20220819163740]CPU: 2 PID: 1272 Comm: 00002SWDLMain Tainted: G W O 5.10.0 #1 [20220819163740]Hardware name: hisilicon,hi1213-fpga (DT) [20220819163740]pstate: 000003c5 (nzcv DAIF -PAN -UAO -TCO BTYPE=--) [20220819163740]pc : __bad_stack+0x4c/0x8c [20220819163740]lr : __bad_stack+0x88/0x8c [20220819163740]sp : ffffff953ffa8160 [20220819163740]x29: f7ffff953ffa8120 x28: f7ffff94901b8040 [20220819163740]x27: ffffffeb72ea6940 x26: ffffffebeee6cf10 [20220819163740]x25: ffffffebef627000 x24: 0000000000000000 [20220819163740]x23: 00000000600003c5 x22: f7ffffebeee11904 [20220819163740]x21: ffffff953ffa82b0 x20: 0000007fffffffff [20220819163740]x19: f7ffffc0133ab898 x18: 0000000000000000 [20220819163740]x17: 0000000000000000 x16: ffffffebef32f0a0 [20220819163740]x15: 00000000624057a0 x14: 953325a7da350fb3 [20220819163740]x13: 09bbbe32ce2b3c11 x12: c15a0e2d1991997b [20220819163740]x11: 0bc8be839e7850d0 x10: cafa1cb223203045 [20220819163740]x9 : f36bed299e5840dc x8 : ffffffc0133aba48 [20220819163740]x7 : ffffff953b1b0480 x6 : ffffffebef3e1000 [20220819163740]x5 : 0000000000000000 x4 : 0000000000000001 [20220819163740]x3 : f7ffffc0133ab750 x2 : 0000000000000025 [20220819163740]x1 : 0000000096000004 x0 : ffffff953ffa8160 [20220819163740]Call trace: [20220819163740] __bad_stack+0x4c/0x8c [20220819163740]Code: a90d6ffa a90e77fc 910543f5 d538411c (f9400794) [20220819163740]---[ end trace 07532bfa2c24851c ]--- [20220819163740]Kernel panic - not syncing: Oops: Fatal exception Zhen Lei (2): arm64/traps: Replace this_cpu_* with raw_cpu_* in panic_bad_stack() ARM: Replace this_cpu_* with raw_cpu_* in panic_bad_stack() arch/arm/kernel/traps.c | 4 ++-- arch/arm64/kernel/traps.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)