From nobody Wed Feb 5 15:56:01 2025 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 05FDA1DE2DF for ; Wed, 15 Jan 2025 22:50:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.17.235.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736981419; cv=none; b=fkddolDpmhRpx4UPzfDfjLyURG7PM7hx9KzjJGt7ue+/5kNCla1k9y1VJ8bxXsB96oaAVzBEu7a1wvLjAjzj9UCVPYOhTHI9pECVPJrCvyDiqLiKQx0bJlN5k94lgYNRfgMF7+kGfdgJSW9vkanV0g5ejXjX6JQxVKsJTLZT3CY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736981419; c=relaxed/simple; bh=LnrGt2KAlzy5sv5GWt/HSpRIYrEvSi7R0lyIHIdGvlI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=C3S1V06IkeWUXj4vTXzQzRLP+FmDjaCrSpHyyKY4NP5tFTVnU0xigy3YlLqwtpZ1dIfLJRWa0vT2NJabEvhstQ5SAW1ArLClawGu17Dpgjqd7rPr7rbmF+kUtxfFgHQwgdOihIaQ4wHKd/cQUGA3JjIKIf7CEzupOmUSp28N7p0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=csgroup.eu; spf=pass smtp.mailfrom=csgroup.eu; arc=none smtp.client-ip=93.17.235.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=csgroup.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=csgroup.eu Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4YYLcr118tz9sSm; Wed, 15 Jan 2025 23:43:24 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id guOiPyj1LLke; Wed, 15 Jan 2025 23:43:24 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4YYLcr05Rjz9sSj; Wed, 15 Jan 2025 23:43:24 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id E4AA08B77A; Wed, 15 Jan 2025 23:43:23 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id oIHFxUtQG8ax; Wed, 15 Jan 2025 23:43:23 +0100 (CET) Received: from PO20335.idsi0.si.c-s.fr (unknown [192.168.202.221]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 2FB5C8B774; Wed, 15 Jan 2025 23:43:21 +0100 (CET) From: Christophe Leroy To: Josh Poimboeuf , Peter Zijlstra , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Julien Thierry , Miroslav Benes , Raphael Gault , Michael Ellerman , Nicholas Piggin , Naveen N Rao , Madhavan Srinivasan Cc: Christophe Leroy , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, llvm@lists.linux.dev Subject: [PATCH v5 13/15] objtool: Prepare noreturns.h for more architectures Date: Wed, 15 Jan 2025 23:42:53 +0100 Message-ID: <12729c2b5f944bc2a6938bc3e3b33e5e703a2258.1736955567.git.christophe.leroy@csgroup.eu> X-Mailer: git-send-email 2.47.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1736980964; l=2918; i=christophe.leroy@csgroup.eu; s=20211009; h=from:subject:message-id; bh=LnrGt2KAlzy5sv5GWt/HSpRIYrEvSi7R0lyIHIdGvlI=; b=PeX1SnrfDYVTrlFpXawBVcEdOvOavZBDC0xyS4VRtYab4BdU1TZGD+horiBPuQPyfgaWnPDJa xuwd87ltRpGCBryhJqTYieShBxw3TtH7bQRKClX7gpFt8WmrctQ4c2V X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" noreturns.h is a mix of x86 specific functions and more generic core functions. In preparation of inclusion of powerpc, split x86 functions out of noreturns.h into arch/noreturns.h Signed-off-by: Christophe Leroy --- .../objtool/arch/x86/include/arch/noreturns.h | 20 +++++++++++++++++++ tools/objtool/noreturns.h | 14 ++----------- 2 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 tools/objtool/arch/x86/include/arch/noreturns.h diff --git a/tools/objtool/arch/x86/include/arch/noreturns.h b/tools/objtoo= l/arch/x86/include/arch/noreturns.h new file mode 100644 index 000000000000..a4262aff3917 --- /dev/null +++ b/tools/objtool/arch/x86/include/arch/noreturns.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +/* + * This is a (sorted!) list of all known __noreturn functions in arch/x86. + * It's needed for objtool to properly reverse-engineer the control flow g= raph. + * + * Yes, this is unfortunate. A better solution is in the works. + */ +NORETURN(cpu_bringup_and_idle) +NORETURN(ex_handler_msr_mce) +NORETURN(hlt_play_dead) +NORETURN(hv_ghcb_terminate) +NORETURN(machine_real_restart) +NORETURN(rewind_stack_and_make_dead) +NORETURN(sev_es_terminate) +NORETURN(snp_abort) +NORETURN(x86_64_start_kernel) +NORETURN(x86_64_start_reservations) +NORETURN(xen_cpu_bringup_again) +NORETURN(xen_start_kernel) diff --git a/tools/objtool/noreturns.h b/tools/objtool/noreturns.h index f37614cc2c1b..dfee1c91a70d 100644 --- a/tools/objtool/noreturns.h +++ b/tools/objtool/noreturns.h @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ =20 +#include + /* * This is a (sorted!) list of all known __noreturn functions in the kerne= l. * It's needed for objtool to properly reverse-engineer the control flow g= raph. @@ -19,33 +21,21 @@ NORETURN(__x64_sys_exit_group) NORETURN(arch_cpu_idle_dead) NORETURN(bch2_trans_in_restart_error) NORETURN(bch2_trans_restart_error) -NORETURN(cpu_bringup_and_idle) NORETURN(cpu_startup_entry) NORETURN(do_exit) NORETURN(do_group_exit) NORETURN(do_task_dead) -NORETURN(ex_handler_msr_mce) -NORETURN(hlt_play_dead) -NORETURN(hv_ghcb_terminate) NORETURN(kthread_complete_and_exit) NORETURN(kthread_exit) NORETURN(kunit_try_catch_throw) -NORETURN(machine_real_restart) NORETURN(make_task_dead) NORETURN(mpt_halt_firmware) NORETURN(nmi_panic_self_stop) NORETURN(panic) NORETURN(panic_smp_self_stop) NORETURN(rest_init) -NORETURN(rewind_stack_and_make_dead) NORETURN(rust_begin_unwind) NORETURN(rust_helper_BUG) -NORETURN(sev_es_terminate) -NORETURN(snp_abort) NORETURN(start_kernel) NORETURN(stop_this_cpu) NORETURN(usercopy_abort) -NORETURN(x86_64_start_kernel) -NORETURN(x86_64_start_reservations) -NORETURN(xen_cpu_bringup_again) -NORETURN(xen_start_kernel) --=20 2.47.0