Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp171459rwe; Fri, 26 Aug 2022 02:58:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR4GH2bPSfVFvCdwsY7J08w1tsyt5iF/W37eDRZvZSjXYxwrEhCz8cjUdPapWlsy4WoTj2C+ X-Received: by 2002:a65:6d0b:0:b0:42a:19dc:e76e with SMTP id bf11-20020a656d0b000000b0042a19dce76emr2659295pgb.6.1661507928971; Fri, 26 Aug 2022 02:58:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661507928; cv=none; d=google.com; s=arc-20160816; b=odu5aquWnTkOgfx2lN4twT8ntdM8teUfnbaG9DC82MM1UIMopSNS9j2jPr7sPLnJYi uBDBtZNwMEPLsVhzF6RlhI1G9L9D7Ru8zV+ZQRp13ft+fQkBXQ7PLRryaJfOpe42NAHM g4mSDDwbgMJbIYPxHM1VZx9v87ewVMNyFpvD8/YZgrKCNd0r5GRR94kZu7qveTryjHqL oMRzP24QZPkW1vY4C2sN8jg7K6JiSsB6n94g23s5iwu43Icfn/91gkpxSsPw6mdu0Ygi dRwuczHE+FQE8KJnSQqEXmlsyQSYM0kLKwriDpqc5p2IqITnXsKKlaE256CacOtogkco LgUw== 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=ocVuZKpNk0JygCzVQn/+WicbBbrQi2F8DxGVkrp3XqY=; b=RcqU7E6GsO0rFT/2LohXCNHPccY4kv93he7UjdmaHQv3ppCLsxSiZ0lEFwEEPyimsN R//OikrQpy3DDvHGRbFgxlJCHTkDZbwDi//HtS5KNuElblPaGhTxOR8F2uvyBY0gQY8h rNoDw5M1ZYb0nKETfZCb1Hu+XyyCeJTH+AtN/lG+bBYTUN1pgovd4zl42cNHp0SazCDk dfaTDtv3pwK0ySvj/l3tVXdQ00JJINbE3ixZHPdYBIcGslGEBXwT5cB8q/YYdv7LysVk 9Ue69OTbG2HXauqn7C5Gxrf8q0aQbHLZjjTC2s0TJm2xKHd/w9MIBeWo7TZgteCKQkmC kmJg== 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 nn17-20020a17090b38d100b001f14520fd96si1714524pjb.19.2022.08.26.02.58.38; Fri, 26 Aug 2022 02:58:48 -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 S1344059AbiHZJ5M (ORCPT + 99 others); Fri, 26 Aug 2022 05:57:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344132AbiHZJ5C (ORCPT ); Fri, 26 Aug 2022 05:57:02 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B7FCD599C for ; Fri, 26 Aug 2022 02:56:54 -0700 (PDT) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MDZsC1TxyzkWhK; Fri, 26 Aug 2022 17:53:19 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) 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.24; Fri, 26 Aug 2022 17:56:20 +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 1/2] arm64/traps: Replace this_cpu_* with raw_cpu_* in panic_bad_stack() Date: Fri, 26 Aug 2022 17:51:11 +0800 Message-ID: <20220826095112.289-2-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 --- arch/arm64/kernel/traps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index b7fed33981f7b76..e6b6f4650e3d895 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -871,8 +871,8 @@ DEFINE_PER_CPU(unsigned long [OVERFLOW_STACK_SIZE/sizeof(long)], overflow_stack) void panic_bad_stack(struct pt_regs *regs, unsigned long esr, unsigned long far) { unsigned long tsk_stk = (unsigned long)current->stack; - unsigned long irq_stk = (unsigned long)this_cpu_read(irq_stack_ptr); - unsigned long ovf_stk = (unsigned long)this_cpu_ptr(overflow_stack); + unsigned long irq_stk = (unsigned long)raw_cpu_read(irq_stack_ptr); + unsigned long ovf_stk = (unsigned long)raw_cpu_ptr(overflow_stack); console_verbose(); pr_emerg("Insufficient stack space to handle exception!"); -- 2.25.1