Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6705188rwb; Tue, 22 Nov 2022 17:59:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Gv+j15A8AQ/3nTNfCu1kxWvsg0sPFsRZJ2X8vdvLqpe1PBhWMrqfP0HXnhgKGuHGE2ZCn X-Received: by 2002:a17:907:2c45:b0:7b8:bbbe:5ca with SMTP id hf5-20020a1709072c4500b007b8bbbe05camr4069744ejc.544.1669168781834; Tue, 22 Nov 2022 17:59:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669168781; cv=none; d=google.com; s=arc-20160816; b=KSb4waYGQmq59xIpc9BheCFkQZBRft65dANN9aLGLgblLtKbQzGCy3j6BPZrJTkpuA DlLDFykZ3bjjjAbzObNvoIc6wIUL5iB9DA8qybkjP+wpARzHzEx+KcduEEcPYqMwBaNw 8KV9Kb4H6Cqe0VpwcV80RwWPO/b5qOr9RGqCw4ycNveANw3mSrPUVhTyDC5qPLZ/0Ejd J9agukT8BGTVfQ67NhJi8WrV76yQjBSl4V5cp6gCn0gDuuVyoEQ85R931hwW3O8tFHBU JTRBiRl79P88UV81MxOM3MkCI8OLlM18TYsFmQEq7S46yQhaDOE5mNxrJTs9MlpPLFP4 yHFQ== 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:message-id:subject:cc:to:from:date:dkim-signature; bh=OtDpxXk5QCsUuuQBV2lYHWpvbg90Sdt7dzWLIXMtn6c=; b=sMFsB6ehon1ehcrNOGVeOaRgikTSOOdifdnH6ttf+UzGT2XTOLdLtu4JRHzJNtVlnS TXqxqXNv64Zgk2Jn5dqbT7aRT2bUN9k6CCnFXFv9ayDeRScaFsyBECdaDyfRZC0uYZit KQgb1pxWjhLeMqhp2o6bPtBgJKtyWCdJWsc0ACk8eus4W2uisDigPri55YXy3O14cr++ 7JZmu21qVooo9YY7t97qUX7omWYfR0qIe811mmhURlSLlXV6hfZX3dRGs7S0eFYkMZ09 +j42R0m1EcbIQKxEAfypQ7tUMNwieZB748Z0XYj/QIt75Ddolow/H3tivQy0vzBzeT+h aKcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=svmhc6WY; 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 g5-20020a1709065d0500b0073fc8e72882si16058706ejt.28.2022.11.22.17.59.20; Tue, 22 Nov 2022 17:59:41 -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=svmhc6WY; 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 S234925AbiKWBYW (ORCPT + 89 others); Tue, 22 Nov 2022 20:24:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234830AbiKWBXz (ORCPT ); Tue, 22 Nov 2022 20:23:55 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 052DE7CB99 for ; Tue, 22 Nov 2022 17:23:55 -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 ams.source.kernel.org (Postfix) with ESMTPS id BA849B81E4B for ; Wed, 23 Nov 2022 01:23:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A56CC433C1; Wed, 23 Nov 2022 01:23:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669166632; bh=qPfxX+m8lCHM/zjzvq+qtO+659L/qs8JOHH93oU7u5A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=svmhc6WYTgLXsI/x9Ai3F5/Pek/+azjjx5I4GbOilVcQ5bgBNuNlYge1aUQFRbi0/ 8whb5goDS9awZk8tiZLnHhqy/r46F2zBoJnmQx9F0PBHHMkhBivB3huktZgGGYl0cW 0iPRGsunI4mZ8lGxXTQdpunTzQDi2TlP3U1RxStuQ0WpaLqW8DALYRtBJKKGBTcYkN 1AXtRIABXS8ZeRs9BYl9BH/2C0piGsRjCB1VgXBuPpn3+3eetO+5hUU0AZ0eRG4cgV lSx7fSpld56sFlNxhqkmxs5MS9C7YA8KksFO7VltcpCWle/GBMfiqZJQ1gH9Uu2+hB XpwTcWqZRtvYw== Date: Tue, 22 Nov 2022 17:23:50 -0800 From: Josh Poimboeuf To: Peter Zijlstra Cc: "Paul E. McKenney" , sfr@canb.auug.org.au, linux-kernel@vger.kernel.org Subject: Re: objtool warning for next-20221118 Message-ID: <20221123012350.kelmmadh65lyswqz@treble> 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=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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. o_O How the @#$% is that a valid way of doing it? Why not just do it the normal way? > Perhaps the best way would be to stick a REACHABLE annotation in > arch_cpu_idle_dead() or something? It what universe would we expect a function named "play_dead" to instead finish bringing the CPU up and return? That's just awful... I don't see anything "valid" about it. -- Josh