Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6679430rwb; Tue, 22 Nov 2022 17:26:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf5K+Fl5j3EqsVWt8ISEzKOe/g19RVEpNmLXiL34WW6yVAg3d3lPAGWxaqufKu8b90SjVupx X-Received: by 2002:a17:90a:bd11:b0:206:64cd:4797 with SMTP id y17-20020a17090abd1100b0020664cd4797mr28188484pjr.103.1669166797698; Tue, 22 Nov 2022 17:26:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669166797; cv=none; d=google.com; s=arc-20160816; b=vcakQV9yxkwpDtczdb3bKB5lQuTTsM+Mp/sWfIo1NI8qmAVDqgta1KSmnDrRWPoZa1 XOSDjwvhGGXna+mzZ8rRdJ5JZkOwDrao3haVebv2Bx8Ze31xuR3zlL8qw91uL9ej7Ajy oUiclEiRlSJNdiWD18MgJ3pflOD8ajmKT0bznUD6q3IzrDn206C9UcXKqixBwk+CWZ5Z DTXAlr2fTnV8oRxO9NxYCFkWcm4ume/0osUewmbwpQCmxzbnkehhrrDkbvi/AjL/lFjL DRPdkBDjUmeg1G+PHPppz6x2wyqyIvYjRQ3d75xl4rlAjyrZ4T77BQ8AyDMBSYXuZ+kv zEVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=ftusTGM46J3O7cdXinggrpdZOBd6dMPvpPRMttEIzjc=; b=PRPeMx+kNT1BGEahnkoiz5GIzzRe2W4QRzF70dFRfYgcxcxPMZGe9NKt/a4+s9ROdw MDIxCiTFhNi91U6wB+BgHAagYlx0YGlPqSdWPii96qpk0GRX1Lz7FDZ9tefTI14b86a5 D/7hTJdIoPFx2P6vyM83dmWDg8KnS7rG0LJUXo9tP/hVhuf0njuEu11QCz0ZBG//q1ig 1FP1KPYoJ6Ffp+cQ6NvL8lICF1C4Wr50FuU94kGNGPqtNGRWcfJyCscabGE533YYuj2y l4VlRE7n7OWD6FOzxeyf3vPhNdYFSKdio6iKCL5I9FO3PDJph8lQcgK/dtza8eXu72x2 PWbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JdNjxC5m; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n3-20020a63e043000000b0046f4d395e6dsi15815769pgj.573.2022.11.22.17.26.26; Tue, 22 Nov 2022 17:26:37 -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=JdNjxC5m; 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 S234862AbiKWAXI (ORCPT + 89 others); Tue, 22 Nov 2022 19:23:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235239AbiKWAXE (ORCPT ); Tue, 22 Nov 2022 19:23:04 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4970786D4 for ; Tue, 22 Nov 2022 16:23:00 -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 CAAFA61988 for ; Wed, 23 Nov 2022 00:22:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31464C433D7; Wed, 23 Nov 2022 00:22:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669162979; bh=D+mZBOiCIC7JPWUavVmxGooy+V+EK3/V7Vh+09epscc=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=JdNjxC5mY4MD9P032W9yu2lo40UVR2OVMEhTplsSwnsXdG+UUcgud4L09vH9DUrff nMZshVfsk/54bfE53/ZDMJAUIS41mOMZ+1w9aA2ZdD4R/iguYnJsK+YRRMDeVh0aTT dHjjA+qkTuI/C1+dxlCMfiEk65oQeYJTi+bqSzy521ISeg/xmyPVCeUcAeFkr2F3Y/ FVQMa0CQcZY7WDGTzqB+GQ+sHhgC+LR4ECMqLygV4FioY9nLCkoYYHTa6Tcd8vuOSs iD485jSLECHx9n6Y6D2hYZDOlIYbkrmmb9w6e7iaDoESb5IA1pkI75Yj2KKBCNnaex AZNzBYyQi2iNA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id B5D165C0BE7; Tue, 22 Nov 2022 16:22:58 -0800 (PST) Date: Tue, 22 Nov 2022 16:22:58 -0800 From: "Paul E. McKenney" To: Peter Zijlstra Cc: Josh Poimboeuf , sfr@canb.auug.org.au, linux-kernel@vger.kernel.org Subject: Re: objtool warning for next-20221118 Message-ID: <20221123002258.GR4001@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20221121040736.GA3738360@paulmck-ThinkPad-P17-Gen-1> <20221121145215.GF4001@paulmck-ThinkPad-P17-Gen-1> <20221122051605.4hcbslwxez2trdvt@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,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 On Tue, Nov 22, 2022 at 09:35:17AM +0100, Peter Zijlstra wrote: > On Mon, Nov 21, 2022 at 09:16:05PM -0800, Josh Poimboeuf wrote: > > > It's complaining about an unreachable instruction after a call to > > arch_cpu_idle_dead(). In this case objtool detects the fact > > arch_cpu_idle_dead() doesn't return due to its call to the > > non-CONFIG_SMP version of play_dead(). But GCC has no way of detecting > > that because the caller is in another translation unit. > > > > As far as I can tell, that function should never return. Though it > > seems to have some dubious semantics (see xen_pv_play_dead() for > > example, which *does* seem to return?). I'm thinking it would be an > > improvement to enforce that noreturn behavior across all arches and > > platforms, sprinkling __noreturn and BUG() on arch_cpu_idle_dead() and > > maybe some of it callees, where needed. > > > > Peter, what do you think? I could attempt a patch. > > I'm thinking the Xen case makes all this really rather difficult :/ > > While normally a CPU is brought up through a trampoline, Xen seems to > have implemented it by simply returning from play_dead(), and afaict > that is actually a valid way to go about doing it. > > Perhaps the best way would be to stick a REACHABLE annotation in > arch_cpu_idle_dead() or something? When I apply this on -next, I still get the objtool complaint. Is there something else I should also be doing? Thanx, Paul > --- > diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c > index c21b7347a26d..0354be027eb0 100644 > --- a/arch/x86/kernel/process.c > +++ b/arch/x86/kernel/process.c > @@ -712,6 +712,7 @@ void arch_cpu_idle_enter(void) > void arch_cpu_idle_dead(void) > { > play_dead(); > + asm(ASM_REACHABLE); > } > > /*