From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1E65C6FD18 for ; Wed, 19 Apr 2023 16:44:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232681AbjDSQo5 (ORCPT ); Wed, 19 Apr 2023 12:44:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230522AbjDSQoz (ORCPT ); Wed, 19 Apr 2023 12:44:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53D87BB for ; Wed, 19 Apr 2023 09:44:54 -0700 (PDT) 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 D9825640DF for ; Wed, 19 Apr 2023 16:44:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00256C433D2; Wed, 19 Apr 2023 16:44:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681922693; bh=H0AAYLCGw3D1xIThJOvHWSbllE3+q0cBwJKUNOtqOik=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rDK0T5Lk6twf+NjxuUroLIFf7NYvgHHpF1XMSq3Kga5ZoppzAe0sqQPTo5leiW8uT DFCrPR4BkzGFBg2DzBEkVRQh8ORkBe6yIBCMA1poR8nziYthdHpTjJ8h+7HSLfvtkb T1SXJOy4VRJOIw7XJ9rotkB/+Vi7DQDCtEPCkaRfvFwz/OtzBoPwVVSjuU1/Qv4Eb+ wFXdOHxu3BWHEsB2vIRSB6O8b2p7Wmp5KirOO3Oz/4/543UDNWGhPNR0xwYto5Kw5E MM/KYzazCH9EO54GKstI44WaxoK9RrwDUBOHiEH/w8pz9I4KofQcN+6+rYpPlnJWmv yo7XeS+4HmUBA== Date: Wed, 19 Apr 2023 09:44:51 -0700 From: Josh Poimboeuf To: Juergen Gross Cc: Borislav Petkov , Linus Torvalds , Peter Zijlstra , x86-ml , lkml Subject: Re: [GIT PULL] x86/urgent for v6.3-rc7 Message-ID: <20230419164451.2vtnawrvbhajrb2g@treble> References: <20230416122913.GCZDvqGVe9TPa5LPRm@fat_crate.local> <20230417090412.GAZD0LjH5ZIaGUdoHH@fat_crate.local> <20230418012435.fhjxd6moaz6tmnep@treble> <20230419155900.GCZEAPxNiOUP31q+/H@fat_crate.local> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 19, 2023 at 06:03:53PM +0200, Juergen Gross wrote: > > However, the only call site is in apic_intr_mode_init() which itself is > > __init. So yeah, strictly speaking nothing wrong. > > > > *IF* something calls it later, when __init is gone, then boom. > > > > Dunno, maybe > > > > a) track call sites too but maybe expensive and too much That would indeed be a lot harder to do. > > or > > > > b) make those warnings debug messages in case someone wants to run objtool > > in debug mode, feels really bored and wants to fix potential issues. Possibly, though I suspect nobody's ever going to be that bored ;-) > > Or someone has a better idea. > > > > > Anyway, this is kind of experimental. If any of these warnings don't > > > turn out to be useful I could drop some or all them. > > > > Right, I can certainly see potential and as said, since we're already > > doing objtool massaging of object files, thought this should be pretty > > easy to do. As you've shown. ;-) > > What about splitting the function vectors into __init and non-init parts? > > This would solve above problem automatically, as a non-init function couldn't > deref the __init part of x86_platform. Right, if we moved the __init parts of x86_platform out into a separate struct x86_platform_init which is __initdata, that would solve this particular issue rather cleanly. Though, more generally, if we make the rule that non-init data can't contain references to init data, that would be a much bigger patch set. Which might end up being the reasonable thing to do, but before deciding whether enforcing such a rule would be worth it, we might want to look more deeply at the warnings to figure out what percentage of those (if any) could be real bugs. -- Josh