From patchwork Mon Sep 18 07:30:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 141275 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2490205vqi; Mon, 18 Sep 2023 00:45:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHm5B2UsguN8eIm7rkzh/dxyMjSKiVbVcTgBND9pSfBQ8tX7KVMlJP3AGhbyqLrAwBDeyih X-Received: by 2002:a17:902:8343:b0:1c5:741d:f388 with SMTP id z3-20020a170902834300b001c5741df388mr1221491pln.9.1695023134303; Mon, 18 Sep 2023 00:45:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695023134; cv=none; d=google.com; s=arc-20160816; b=K2/4NeXUM82fVRlfHfTCZKLTlWt6Cf2mf+in7OgNMYgRdTOlOrE0LCPR5NUg6rZ3P2 ZoI/4yxr38j3xIJy9ix0MazUh3IGTF6kTw29VXKC1XnEXXRSEda8Pwj4t0Szu4gm0W2W rYwzeIYCtul2whYZGjfaEevB92aKVsuEEZG0GxP5fJKE9Ypo+bOepL8WQSDo7gvWaHoW JhQty79r41uuUy6ws96D4PeKCuBqEx6zA4ckHpCQ1K740/5DnRNE2ECHOjgu0CVA/6fm bR5PWtGTLCm1KZAzTMPMJs2Fq+D8Esil6ZSQIZpQPjYv3zVfaFU/VN2GkknFfBkQOI7L XLFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=Qw/z5xmnc07wtu1+lFgx8dID9+9DKBbCaChZCJLWAWg=; fh=4yuc61NrNr5OohI9ivssPmFV2JD6V6cZf4y7MRCRojk=; b=K2cZgRKXIrSD+3LnOXGInGNFa8kF1SYQ44Pl+JVgEEbtzrhEaedK2LaH8vGAhfiDdn w4vIKp6bWR/BsaEvou8d2NXQGCF16pta1os1GFYW7wnDi3wqphwXGtjMmcmDZvv8wT0T 9wOOSEfQL+hbRF6O6Xu7jHFteAs7HQ+1MB4BHHccQxt5h8epTZGuHgVC7IOMWU6+24QS /T0eK8owyiIJMpVEGSu7xjwbATwGewKPhmMjDvI/s55nrUToZckyZzs8PX2AsyqFS5Pk tcC4s18p5gO1myBZ2ULtbf17yCCluwYqEmNwAy+0EiLZI+BVCvp+AmYsF/e96AOkL+S9 Q9aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=T5sFB8sH; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=uihGSowK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id n15-20020a170902d2cf00b001c3bd544f9fsi8005843plc.523.2023.09.18.00.45.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 00:45:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=T5sFB8sH; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=uihGSowK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 009988043D1A; Mon, 18 Sep 2023 00:32:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239955AbjIRHb7 (ORCPT + 27 others); Mon, 18 Sep 2023 03:31:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240415AbjIRHbU (ORCPT ); Mon, 18 Sep 2023 03:31:20 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9154195; Mon, 18 Sep 2023 00:31:01 -0700 (PDT) Date: Mon, 18 Sep 2023 07:30:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1695022259; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Qw/z5xmnc07wtu1+lFgx8dID9+9DKBbCaChZCJLWAWg=; b=T5sFB8sHB0u/f550qRxWRY3WIZz18SghodOITU1AP29laB9I9BstjCfBuHSK5qwvsU+qZB uIq/Nr0tUm+Xh61hIor49Juyw+IyH1FKkUlr8aNMzti1NEPDhTx+4lEKR4LEuLp2AVUvlO Ym6Jap++nGQ4Q2qiyOXA3Lhc/ikpdiTUI0WN21ELWrO+4N20IMaA+RsjgXhixrNluYmXtp ewBE2tz35Nm+pRl7WnMdWzTnc8dxN+SIoCAVje+shUq26Hq+TGAUtYfUpa8hPSjaFUF/d4 91Xg7IME6myGH5PNqq5Oq4v9DIWGDQfpMCZ8sW6+xT6fF1Q1qQmrkiz3RvvmCA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1695022259; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Qw/z5xmnc07wtu1+lFgx8dID9+9DKBbCaChZCJLWAWg=; b=uihGSowKdKWW4ahDZQ4bxKRwLNnzkHeuIzmYGTeTUtMqsu9Cp4WB+WCHzGkRV2HUFEC39H GQ/n3nDw/tnSHdDQ== From: "tip-bot2 for Kai Huang" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/tdx] x86/tdx: Fix __noreturn build warning around __tdx_hypercall_failed() Cc: kernel test robot , Kai Huang , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230918041858.331234-1-kai.huang@intel.com> References: <20230918041858.331234-1-kai.huang@intel.com> MIME-Version: 1.0 Message-ID: <169502225930.27769.2712335854456524871.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Mon, 18 Sep 2023 00:32:36 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777360578483576830 X-GMAIL-MSGID: 1777360578483576830 The following commit has been merged into the x86/tdx branch of tip: Commit-ID: 518755a7eeae77a399430eaf211a1e71f6b87d4a Gitweb: https://git.kernel.org/tip/518755a7eeae77a399430eaf211a1e71f6b87d4a Author: Kai Huang AuthorDate: Mon, 18 Sep 2023 16:18:58 +12:00 Committer: Ingo Molnar CommitterDate: Mon, 18 Sep 2023 09:11:39 +02:00 x86/tdx: Fix __noreturn build warning around __tdx_hypercall_failed() LKP reported below build warning: vmlinux.o: warning: objtool: __tdx_hypercall+0x128: __tdx_hypercall_failed() is missing a __noreturn annotation The __tdx_hypercall_failed() function definition already has __noreturn annotation, but it turns out the __noreturn must be annotated to the function declaration. PeterZ explains: "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." Add __noreturn annotation to the declaration of __tdx_hypercall_failed() to fix. It's not a bad idea to document the __noreturn nature at the definition site either, so keep the annotation at the definition. Note is also included by TDX related assembly files. Include only in case of !__ASSEMBLY__ otherwise compiling assembly file would trigger build error. Also, following the objtool documentation, add __tdx_hypercall_failed() to "tools/objtool/noreturns.h". Fixes: c641cfb5c157 ("x86/tdx: Make TDX_HYPERCALL asm similar to TDX_MODULE_CALL") Reported-by: kernel test robot Signed-off-by: Kai Huang Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230918041858.331234-1-kai.huang@intel.com Closes: https://lore.kernel.org/oe-kbuild-all/202309140828.9RdmlH2Z-lkp@intel.com/ --- arch/x86/include/asm/shared/tdx.h | 4 +++- tools/objtool/noreturns.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/shared/tdx.h b/arch/x86/include/asm/shared/tdx.h index b69886e..f74695d 100644 --- a/arch/x86/include/asm/shared/tdx.h +++ b/arch/x86/include/asm/shared/tdx.h @@ -56,6 +56,8 @@ #ifndef __ASSEMBLY__ +#include + /* * Used in __tdcall*() to gather the input/output registers' values of the * TDCALL instruction when requesting services from the TDX module. This is a @@ -108,7 +110,7 @@ static inline u64 _tdx_hypercall(u64 fn, u64 r12, u64 r13, u64 r14, u64 r15) /* Called from __tdx_hypercall() for unrecoverable failure */ -void __tdx_hypercall_failed(void); +void __noreturn __tdx_hypercall_failed(void); bool tdx_accept_memory(phys_addr_t start, phys_addr_t end); diff --git a/tools/objtool/noreturns.h b/tools/objtool/noreturns.h index e45c7cb..875f882 100644 --- a/tools/objtool/noreturns.h +++ b/tools/objtool/noreturns.h @@ -11,6 +11,7 @@ NORETURN(__kunit_abort) NORETURN(__module_put_and_kthread_exit) NORETURN(__reiserfs_panic) NORETURN(__stack_chk_fail) +NORETURN(__tdx_hypercall_failed) NORETURN(__ubsan_handle_builtin_unreachable) NORETURN(arch_call_rest_init) NORETURN(arch_cpu_idle_dead)