Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp175667rwe; Fri, 26 Aug 2022 03:03:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR5vjPKtIWetCW1wUeQIlNgnza6kHc5YTqeQhpyrbihGnu1Uat4uYrKafus2joHgaPD9q7e4 X-Received: by 2002:a05:6a00:c96:b0:537:1537:988f with SMTP id a22-20020a056a000c9600b005371537988fmr3351486pfv.2.1661508186480; Fri, 26 Aug 2022 03:03:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661508186; cv=none; d=google.com; s=arc-20160816; b=tCT7oljVsKQ1Hyf00mYFuVZD2dvFwDCDty9brDvr1GMR71kKQgDRCqHm9iqjZJChVh JCnf6Wruw+4+KLcczA78UYkyzNqEVMD1sNEyHatS6a6CmxQQPwFCp/ICUK+/+PVnsBVm laWZzagATydWCpHCxWhUx7BTFtPhZDb2Ghq4CD1h7+44fAQvZyHfEGFS0l9GM0VG8n1W a0v6MWkl0BYS6/chl21KxRe7AtRUu6rg42SI///eSdc4+UfGBgvzWfTwy622rdmKU+65 hLUGh4/SLljnJA+x7Gxw/H28Ktj8ag1JAt7a4E2XSLLByvh7BaF7ut3tC6i41SSBNDDu j8fQ== 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=R7ONUk8bCexx/R41ODhuYyL5piugN5/7giLX27z2Roo=; b=AL60zFS3sMByVeBTg89hE5QY6z0GvyhR9iUSDxgrf0/ikgdqKXCSL3FpiG7pvFPGwK vx6bG5oKf4z7Jdc71f0P0s7nU5vOfPp50+KZKOzB4Qk3qT8T2yhdzFtRux2sE18Iw8qv 11xcnZhPJk6heXChTE8gYmo5i0LFHFSM7n+llLcoklhW2xvtd/dbUsoWAsuQpBjJx6Vu Fc6ur0vqkHpG0ZQHXnIoIAQ0FQX5mF40Y2VUy+QqwNCspHKp4u0vy0JejWNl05pXEsye 9MHPXUswKpr+UDCkvdZ5eczG0QTbTtnGn1dguZV8LwKpr+9ZdM47dcaQ/cG9JEpbSVw9 e6Mg== 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 u62-20020a638541000000b0041ccc0ff2b8si1370626pgd.95.2022.08.26.03.02.55; Fri, 26 Aug 2022 03:03:06 -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 S1343951AbiHZJ4o (ORCPT + 99 others); Fri, 26 Aug 2022 05:56:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343708AbiHZJ4Y (ORCPT ); Fri, 26 Aug 2022 05:56:24 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FDCD74DDA for ; Fri, 26 Aug 2022 02:56:22 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MDZtl11tNzGpZZ; Fri, 26 Aug 2022 17:54:39 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 26 Aug 2022 17:56:21 +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; Fri, 26 Aug 2022 17:56:20 +0800 From: Zhen Lei To: Catalin Marinas , Will Deacon , Mark Rutland , Russell King , , , CC: Zhen Lei Subject: [PATCH v2 2/2] ARM: replace this_cpu_* with raw_cpu_* in panic_bad_stack() Date: Fri, 26 Aug 2022 17:51:12 +0800 Message-ID: <20220826095112.289-3-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20220826095112.289-1-thunder.leizhen@huawei.com> References: <20220826095112.289-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.178.55] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500006.china.huawei.com (7.185.36.236) 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,T_SCC_BODY_TEXT_LINE 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 The hardware automatically disable the IRQ interrupt before jumping to the interrupt or exception vector. Therefore, the preempt_disable() operation in this_cpu_read() after macro expansion is unnecessary for exception handler. Use raw_cpu_* instead of this_cpu_* can reduce a few lines of assembly code. To be honest, the fewer unnecessary operations in exception handler, the better. Signed-off-by: Zhen Lei --- KernelVersion: v6.0-rc2 arch/arm/kernel/traps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 1518a1f443ff866..d5903d790cf3b7e 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c @@ -927,9 +927,9 @@ asmlinkage void handle_bad_stack(struct pt_regs *regs) { unsigned long tsk_stk = (unsigned long)current->stack; #ifdef CONFIG_IRQSTACKS - unsigned long irq_stk = (unsigned long)this_cpu_read(irq_stack_ptr); + unsigned long irq_stk = (unsigned long)raw_cpu_read(irq_stack_ptr); #endif - unsigned long ovf_stk = (unsigned long)this_cpu_read(overflow_stack_ptr); + unsigned long ovf_stk = (unsigned long)raw_cpu_read(overflow_stack_ptr); console_verbose(); pr_emerg("Insufficient stack space to handle exception!"); -- 2.25.1