Message ID | 2eeb4425572785d1f05d8761dba1cf88c2105304.1675461757.git.jpoimboe@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1082172wrn; Fri, 3 Feb 2023 14:13:01 -0800 (PST) X-Google-Smtp-Source: AK7set9JOy8ofJQIOeBJaccP8juSa4I+P4FPR/46x8eNHljorfpEw6jA2yKGInKJIGpv6tOBTysC X-Received: by 2002:a17:906:c243:b0:87f:546d:7cb5 with SMTP id bl3-20020a170906c24300b0087f546d7cb5mr11476192ejb.37.1675462381473; Fri, 03 Feb 2023 14:13:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675462381; cv=none; d=google.com; s=arc-20160816; b=TT4GI2jHKY4s+v1DLqqwH70nfVcnOjtjsH41cBJsJV8ZwfPtkrE/cgX3CeqolAEfaX T3bCpYFWR/+MiIHmrpE4zkvyaRvdlxya1xRH0/ExY7fmJCMO5oI8tANXd5pbINSZRq4M AfqurZPKTnXDi2FdQ87Jp8H68x17FlXH8YvpoU7KPIYtKWqPbo2MXFmMXd+A3pA3YQ8m F/2KdXuszx7ukWRDUoncYw/7VJW1MyN+lWcojZ70eNKsJcGNIuIZvurCQmwNHRudA0ag guvasA25GVDRHvgFCgUOhHoROGaB3B3m0SIqAc/s3KXtSiDVSMerWIASOIXZS9g1OtyS WaSw== 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 :dkim-signature; bh=p7pRaZjDGsvyfB7jdhVLOUDYk0tGHrRc6egR9vIlrmw=; b=xDTpaULEq+1qarwt84nypP54UFSDbrU4ZaM04HJwoL2MGsqJmwBAHt8094bELEQ2b0 EJ/zXV6O9lbzhYD6sKhQKbpVKSueudwQavWA1GMbbyqg6QjmmdiiQOy8U/mVgSxkVibv Cup28Svh1iiDa1ouh1jBqi2huG0B0AVOCufxgR8wkINvMEhqAGpkr9TLWCdvF7UpKUsX epUOCi5S7Qpk9GSrHMMoRvU689DihxrXdkAOa/65HUjlPaeIUMp5chpRGTkiNoFBhFtN I+2PzRi38soAZ2a1AuAfYwXoIqweVPYKyuWmfvtQscVtme1NDdLivtnBbH98jL78nqZ2 jL4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=o8eHohIT; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h10-20020a056402280a00b004a0916f3e12si5536103ede.218.2023.02.03.14.12.34; Fri, 03 Feb 2023 14:13:01 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=o8eHohIT; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233390AbjBCWJJ (ORCPT <rfc822;il.mystafa@gmail.com> + 99 others); Fri, 3 Feb 2023 17:09:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233871AbjBCWIQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 3 Feb 2023 17:08:16 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AA32AF0FA; Fri, 3 Feb 2023 14:06:34 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1361062038; Fri, 3 Feb 2023 22:06:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C566CC433EF; Fri, 3 Feb 2023 22:06:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675461982; bh=nXrabXpKFkbXCMFjc3rmCrrnT82/WMJleHEGw691mcc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o8eHohITAVmxjRXNbpfeL/cd8yNdoWWWFTWag8bI9FPvrbMJMbn7FDeWO6jeb5YOD 09wPFTEb38+tMtIgPe9CHEcvDL5qejhmyy++aNANFxprUQblrITcsG2eqHUbL8gmjP 4gSQVCoZOcsy77T+LMkCLBQL3ugwMFw9fYlynnFYPAuVOyx0fjaF1UNV9fyR8q62PB h633UkAqPNNQmIqlOFdeaLl3kp8E9fQrbTqg4QDEu+JRFrn1I6ApIrNEekrHOTvbXp jHiZ0SPsYXyBzSGzOGZrRgHnyMS++i5x/iAEJAM5eK7R7f/TB4A4nPAJaqn+bn24YL BOf5EfzEJfk4Q== From: Josh Poimboeuf <jpoimboe@kernel.org> To: linux-kernel@vger.kernel.org Cc: jgross@suse.com, richard.henderson@linaro.org, ink@jurassic.park.msu.ru, mattst88@gmail.com, linux-alpha@vger.kernel.org, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will@kernel.org, guoren@kernel.org, linux-csky@vger.kernel.org, linux-ia64@vger.kernel.org, chenhuacai@kernel.org, kernel@xen0n.name, loongarch@lists.linux.dev, f.fainelli@gmail.com, bcm-kernel-feedback-list@broadcom.com, tsbogend@alpha.franken.de, linux-mips@vger.kernel.org, jiaxun.yang@flygoat.com, mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, linuxppc-dev@lists.ozlabs.org, ysato@users.sourceforge.jp, dalias@libc.org, linux-sh@vger.kernel.org, davem@davemloft.net, sparclinux@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, chris@zankel.net, jcmvbkbc@gmail.com, linux-xtensa@linux-xtensa.org, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, paulmck@kernel.org Subject: [PATCH 22/22] sched/idle: Mark arch_cpu_idle_dead() __noreturn Date: Fri, 3 Feb 2023 14:05:31 -0800 Message-Id: <2eeb4425572785d1f05d8761dba1cf88c2105304.1675461757.git.jpoimboe@kernel.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <cover.1675461757.git.jpoimboe@kernel.org> References: <cover.1675461757.git.jpoimboe@kernel.org> MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756849642175048377?= X-GMAIL-MSGID: =?utf-8?q?1756849642175048377?= |
Series |
cpu,sched: Mark arch_cpu_idle_dead() __noreturn
|
|
Commit Message
Josh Poimboeuf
Feb. 3, 2023, 10:05 p.m. UTC
Before commit 076cbf5d2163 ("x86/xen: don't let xen_pv_play_dead() return"), in Xen, when a previously offlined CPU was brought back online, it unexpectedly resumed execution where it left off in the middle of the idle loop. There were some hacks to make that work, but the behavior was surprising as do_idle() doesn't expect an offlined CPU to return from the dead (in arch_cpu_idle_dead()). Now that Xen has been fixed, and the arch-specific implementations of arch_cpu_idle_dead() also don't return, give it a __noreturn attribute. This will cause the compiler to complain if an arch-specific implementation might return. It also improves code generation for both caller and callee. Also fixes the following warning: vmlinux.o: warning: objtool: do_idle+0x25f: unreachable instruction Reported-by: Paul E. McKenney <paulmck@kernel.org> Tested-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> --- include/linux/cpu.h | 2 +- tools/objtool/check.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index f83e4519c5f0..8582a7142623 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -182,7 +182,7 @@ void arch_cpu_idle(void); void arch_cpu_idle_prepare(void); void arch_cpu_idle_enter(void); void arch_cpu_idle_exit(void); -void arch_cpu_idle_dead(void); +void __noreturn arch_cpu_idle_dead(void); int cpu_report_state(int cpu); int cpu_check_up_prepare(int cpu); diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 0f67c6a8bc98..e3fa2279d612 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -167,6 +167,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func, "__reiserfs_panic", "__stack_chk_fail", "__ubsan_handle_builtin_unreachable", + "arch_cpu_idle_dead", "cpu_bringup_and_idle", "cpu_startup_entry", "do_exit",