Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4079295rdb; Thu, 14 Sep 2023 11:05:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEYm1cNNySUZMw7+jVJqtXhjCsga+8C8md+vU+JnYZ30kungQKfERr71gXhHHoMmAXCQYaT X-Received: by 2002:a05:6a20:9384:b0:11f:4707:7365 with SMTP id x4-20020a056a20938400b0011f47077365mr7225402pzh.38.1694714717770; Thu, 14 Sep 2023 11:05:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694714717; cv=none; d=google.com; s=arc-20160816; b=M60G1wferGdUhR/F1maeR5smXQVp+G9y4lAg0Ub3tMEE4bffggg2Xga6PIUB1u3myt cNsVwwWORt6s1ds0snbGi8YR/qzgfNDMSyGyK7V7DheM+X40HsOLwCZojAQ64U8SGbLj nfQtzSNmZypLbG6YrsQx6SomFuz7oGsLECrUpHnj6YL3zM/0ykAP0nTFHFFVXzhmJj4e cpROKZKptgX3kBcnTWRq8htClhUq5K1NC55EGUligHIwX1crkVH0F8aArRyn1DlfB3XS 5j6HiELGKFC5VnMsaNKT4oqm9tVxWEjZpuUyek1BgW6MeunG/n81uGJLpoUGrZv0ZiqA EU1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature:dkim-signature; bh=167lqha1toqxasAvYkAFsUrCAO5mzUe0unVfWbEtKKA=; fh=LDC43trtV61Ch5pDu8j9/rF7gOSeNdjt55/leuKXlcQ=; b=gBhO9eexs9v6HMkSGW/fAn7S+Kixmv6hkup052bS2zGURXusgvodxRkJA59G7qH5we uSaYskeCUO6Dj0QUywCoBuh3YMZOJ0ov8Zi/ClGt70pOQH/kLPNaGnK+1/3IUCxU1Dha MlYFoO1SWRkOeFIcTHbWe0187qbXSamXZwrSJ5JtSXIDLULUssGBS7RLB4RN80a6yYkR ZtQ9xxHDZ2usIjBxCB5w8YuW0aKoRq9l+vXpV03m8MnuDCEfBaqd0exZVTT6nQSe90Fg kIfkZU38EhYNafCvZQT0VQ46S5PnGoUVxBgL8ZHDzorZ3kt5wXJikPxJJ+Z2RCUJVfyd wP4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=s8dV1zwZ; dkim=neutral (no key) header.i=@suse.de header.b=hKtzmz1e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id b31-20020a630c1f000000b005503f25aac2si1848972pgl.241.2023.09.14.11.05.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 11:05:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=s8dV1zwZ; dkim=neutral (no key) header.i=@suse.de header.b=hKtzmz1e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C4EDE818EC04; Thu, 14 Sep 2023 07:52:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234000AbjINOwu (ORCPT + 99 others); Thu, 14 Sep 2023 10:52:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240405AbjINOwt (ORCPT ); Thu, 14 Sep 2023 10:52:49 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B22391FC8 for ; Thu, 14 Sep 2023 07:52:45 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 5E6D22185F; Thu, 14 Sep 2023 14:52:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1694703164; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=167lqha1toqxasAvYkAFsUrCAO5mzUe0unVfWbEtKKA=; b=s8dV1zwZxD6pTrXwcsUH9mnmk5Rl8CYuzb3u758pa9YmzxcF9bjm05JR1yZrowlvYUG2t7 OGlM0ZQlp/7RpOA+s6+Ng8+y19kk94bv580/3k5YJwH2j2dsQAy+6zhltF7JM2JMIJitdD HwaxSehMS/mVtgAd9IYrK1gu09+kZSI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1694703164; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=167lqha1toqxasAvYkAFsUrCAO5mzUe0unVfWbEtKKA=; b=hKtzmz1ebDJhyqVAD9S1K9suz7jomJ7IEPeC8i7a5jDJNBKnKWtfg38RNROq4tGWWfX+oS pgrqyZf2md6MJXAg== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id E7B552C142; Thu, 14 Sep 2023 14:52:43 +0000 (UTC) Received: by wotan.suse.de (Postfix, from userid 10510) id EAF2A680B; Thu, 14 Sep 2023 14:52:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by wotan.suse.de (Postfix) with ESMTP id E87426806; Thu, 14 Sep 2023 14:52:43 +0000 (UTC) Date: Thu, 14 Sep 2023 14:52:43 +0000 (UTC) From: Michael Matz To: Peter Zijlstra cc: Ingo Molnar , "Huang, Kai" , lkp , "kirill.shutemov@linux.intel.com" , "linux-kernel@vger.kernel.org" , "oe-kbuild-all@lists.linux.dev" , "x86@kernel.org" , "dave.hansen@linux.intel.com" Subject: Re: [tip:x86/tdx 8/12] vmlinux.o: warning: objtool: __tdx_hypercall+0x128: __tdx_hypercall_failed() is missing a __noreturn annotation In-Reply-To: <20230914142644.GC18948@noisy.programming.kicks-ass.net> Message-ID: References: <202309140828.9RdmlH2Z-lkp@intel.com> <90f0a4d44704f9c296f3a4d8b72c57f2916aa09d.camel@intel.com> <377b1ce2ecd390f4b6f8cdf68d22c708f7cef6d1.camel@intel.com> <20230914072959.GC16631@noisy.programming.kicks-ass.net> <20230914142644.GC18948@noisy.programming.kicks-ass.net> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 14 Sep 2023 07:52:51 -0700 (PDT) Hey, On Thu, 14 Sep 2023, Peter Zijlstra wrote: > > > > It appears the __noreturn must be annotated to the function declaration > > > > but not the function body. I'll send out the fix as soon as I confirm > > > > the fix with LKP. > > > > > > FWIW, the reason being that... > > > > > > The point of noreturn is that the caller should know to stop generating > > > code. For that the declaration needs the attribute, because call sites > > > typically do not have access to the function definition in C. > > > > BTW., arguably shouldn't the compiler generate a warning to begin with, > > when it encounters a noreturn function definition whose prototype doesn't > > have the attribute? > > Yeah, I would agree with that, That makes sense, yeah. We actually have a warning -Wmissing-attributes that would fit this usecase, but currently doesn't implement this case (it only applies to aliases, not to decl vs. def). > but I think the problem is that gnu > attributes are all considered 'optional' and do not factor into the > actual signature. That actually depends on the attribute :) Most attributes are like that, true, but some aren't optional in that sense as they influence the callee-caller contract (e.g. those that change the ABI, like fastcall). Those must then be part of the functions type. 'noreturn' is optional in that sense. But a warning might still be warranted. Ciao, Michael.